Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fixed issue with a cached packages which have a wrong size someway.
Andrej Zverev committed 11 years ago
commit 1f9a07c3159723bf5beeb338653ade961c97bea6
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)