Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Relax directory extraction
Baptiste Daroussin committed 9 years ago
commit 79a1f54e0d406a495863addfb4487408913d40b0
parent aee25a1
2 files changed +6 -2
modified libpkg/pkg.c
@@ -820,6 +820,10 @@ pkg_adddir_attr(struct pkg *pkg, const char *path, const char *uname,
	assert(pkg != NULL);
	assert(path != NULL && path[0] != '\0');

+
	if (strcmp(path, "/") == 0) {
+
		pkg_emit_error("skipping useless directory: '%s'\n", path);
+
		return (EPKG_OK);
+
	}
	path = pkg_absolutepath(path, abspath, sizeof(abspath), false);
	pkg_debug(3, "Pkg: add new directory '%s'", path);
	if (check_duplicates && kh_contains(pkg_dirs, pkg->dirhash, path)) {
modified libpkg/pkg_add.c
@@ -323,8 +323,8 @@ do_extract_dir(struct pkg* pkg, struct archive *a __unused, struct archive_entry

	d = pkg_get_dir(pkg, path);
	if (d == NULL) {
-
		pkg_emit_error("Directory %s not specified in the manifest");
-
		return (EPKG_FATAL);
+
		pkg_emit_error("Directory %s not specified in the manifest, skipping");
+
		return (EPKG_OK);
	}
	aest = archive_entry_stat(ae);
	d->perm = aest->st_mode;