Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix packaging symlinks
Baptiste Daroussin committed 14 years ago
commit 2c1f664531363b488034dcfc134decab57945538
parent e6911dd
1 file changed +10 -0
modified libpkg/packing.c
@@ -83,8 +83,10 @@ packing_append_file(struct packing *pack, const char *filepath, const char *newp
{
	int fd;
	int len;
+
	char linkdest[MAXPATHLEN];
	char buf[BUFSIZ];
	int retcode = EPKG_OK;
+
	struct stat st;

	archive_entry_clear(pack->entry);
	archive_entry_copy_sourcepath(pack->entry, filepath);
@@ -97,6 +99,14 @@ packing_append_file(struct packing *pack, const char *filepath, const char *newp
		goto cleanup;
	}

+
	lstat(filepath, &st);
+
	archive_entry_copy_stat(pack->entry, &st);
+

+
	if (S_ISLNK(st.st_mode)) {
+
		readlink(filepath, linkdest, MAXPATHLEN);
+
		archive_entry_set_symlink(pack->entry, linkdest);
+
	}
+

	if (newpath != NULL)
		archive_entry_set_pathname(pack->entry, newpath);