Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Also copy directories in pkg_copy_tree
Baptiste Daroussin committed 14 years ago
commit 0f47bbfc2d13fb983afe32f6f32cfab217b22f5d
parent c55c81cd7d3a143c16ab61a1e284716b85d7df22
1 file changed +9 -0
modified libpkg/pkg.c
@@ -933,6 +933,7 @@ pkg_copy_tree(struct pkg *pkg, const char *src, const char *dest)
{
	struct packing *pack;
	struct pkg_file *file = NULL;
+
	struct pkg_dir *dir = NULL;
	char spath[MAXPATHLEN + 1];
	char dpath[MAXPATHLEN + 1];

@@ -941,6 +942,13 @@ pkg_copy_tree(struct pkg *pkg, const char *src, const char *dest)
		return EPKG_FATAL;
	}

+
	while (pkg_dirs(pkg, &dir) == EPKG_OK) {
+
		snprintf(spath, sizeof(spath), "%s%s", src, pkg_dir_path(dir));
+
		snprintf(dpath, sizeof(dpath), "%s%s", dest, pkg_dir_path(dir));
+
		printf("%s -> %s\n", spath, dpath);
+
		packing_append_file(pack, spath, dpath);
+
	}
+

	while (pkg_files(pkg, &file) == EPKG_OK) {
		snprintf(spath, sizeof(spath), "%s%s", src, pkg_file_path(file));
		snprintf(dpath, sizeof(dpath), "%s%s", dest, pkg_file_path(file));
@@ -948,6 +956,7 @@ pkg_copy_tree(struct pkg *pkg, const char *src, const char *dest)
		packing_append_file(pack, spath, dpath);
	}

+

	return (packing_finish(pack));
}