Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Just warn and ignore in case of file duplication
Baptiste Daroussin committed 14 years ago
commit 1c48b9ab5b0ddd91864f770f78b616e48e327eb4
parent d5fd865436748f7afd90d26dedfcdc35abf27c38
1 file changed +8 -1
modified libpkg/pkg.c
@@ -523,11 +523,18 @@ pkg_addfile(struct pkg *pkg, const char *path, const char *sha256)
int
pkg_addfile_attr(struct pkg *pkg, const char *path, const char *sha256, const char *uname, const char *gname, mode_t perm)
{
-
	struct pkg_file *f;
+
	struct pkg_file *f = NULL;

	assert(pkg != NULL);
	assert(path != NULL && path[0] != '\0');

+
	while (pkg_files(pkg, &f) != EPKG_END) {
+
		if (!strcmp(path, pkg_file_path(f))) {
+
			pkg_emit_error("duplicate file listing: %s, ignoring", pkg_file_path(f));
+
			return (EPKG_OK);
+
		}
+
	}
+

	pkg_file_new(&f);
	strlcpy(f->path, path, sizeof(f->path));