Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Workaround libarchive no 100% supporting mtree (doesn't know nocache)
Baptiste Daroussin committed 13 years ago
commit bcfa83c668e5cfedcb92c665f416a65dcfea05e6
parent ee3903a
1 file changed +6 -7
modified libpkg/pkg_add.c
@@ -124,7 +124,12 @@ do_extract_mtree(char *mtree, const char *prefix)
		goto cleanup;
	}

-
	while ((ret = archive_read_next_header(a, &ae)) == ARCHIVE_OK) {
+
	while ((ret = archive_read_next_header(a, &ae)) != ARCHIVE_EOF) {
+
		if (ret != ARCHIVE_OK) {
+
			pkg_emit_error("Skipping unsupported mtree line: %s",
+
			    archive_error_string(a));
+
			continue;
+
		}
		fpath = archive_entry_pathname(ae);

		if (*fpath != '/') {
@@ -140,12 +145,6 @@ do_extract_mtree(char *mtree, const char *prefix)
		}
	}

-
	if (ret != ARCHIVE_EOF) {
-
		pkg_emit_error("Fail to walk in the mtree file: %s",
-
		    archive_error_string(a));
-
		retcode = EPKG_FATAL;
-
	}
-

cleanup:
	if (a != NULL)
		archive_read_finish(a);