Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #1150 from andrejzverev/issue1149
Vsevolod Stakhov committed 11 years ago
commit a31d851a7aee9bb7dbca5cf9042daa3774301a95
parent 4bf0efd
2 files changed +4 -2
modified libpkg/repo/binary/fetch.c
@@ -80,7 +80,7 @@ pkg_repo_binary_get_cached_name(struct pkg_repo *repo, struct pkg *pkg,
		 */
		pkg_snprintf(dest, destlen, "%S/%n-%v-%z",
				cachedir, pkg, pkg, pkg);
-
		if (stat (dest, &st) != -1)
+
		if (stat (dest, &st) != -1 || pkg->pkgsize != st.st_size)
			return (EPKG_FATAL);

		/*
modified libpkg/repo/binary/query.c
@@ -372,7 +372,9 @@ pkg_repo_binary_ensure_loaded(struct pkg_repo *repo,
		 * Try to get that information from fetched package in cache
		 */
		pkg_manifest_keys_new(&keys);
-
		pkg_repo_cached_name(pkg, path, sizeof(path));
+
		
+
		if (pkg_repo_cached_name(pkg, path, sizeof(path)) != EPKG_OK)
+
			return (EPKG_FATAL);

		pkg_debug(1, "Binary> loading %s", path);
		if (pkg_open(&cached, path, keys, PKG_OPEN_TRY) != EPKG_OK)