Skip to content

Commit

Permalink
Merge pull request freebsd#398 from namore/issue377
Browse files Browse the repository at this point in the history
fixes issue freebsd#377
  • Loading branch information
jlaffaye committed Nov 27, 2012
2 parents e675243 + a2bbad4 commit 440d500
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,11 @@ print_jobs_summary(struct pkg_jobs *jobs, pkg_jobs_t type, const char *msg, ...)

switch (type) {
case PKG_JOBS_INSTALL:
dlsize += pkgsize;
snprintf(path, MAXPATHLEN, "%s/%s", cachedir, pkgrepopath);
if (stat(path, &st) != -1)
dlsize -= st.st_size;
if (stat(path, &st) == -1 || pkgsize != st.st_size)
/* file looks corrupted (wrong size), assume a checksum mismatch will
occur later and the file will be fetched from remote again */
dlsize += pkgsize;

if (newversion != NULL) {
switch (pkg_version_cmp(version, newversion)) {
Expand Down

0 comments on commit 440d500

Please sign in to comment.