Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #398 from namore/issue377
Julien Laffaye committed 13 years ago
commit 440d5009b152501b20fb6fba62600ebfd7b4de5d
parent e675243
1 file changed +4 -3
modified pkg/utils.c
@@ -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)) {