aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-02-26 06:35:10 +0800
committerbdrewery <bdrewery@FreeBSD.org>2016-02-26 06:35:10 +0800
commita1ac8e8a233b101f4c853460e261e71ee7a3e9a7 (patch)
treec5c0b4127fdec225cbf135f840214a761293cd7c /ports-mgmt
parentcf09ad256b530a8fda0bbad4169bfe989c52c05f (diff)
downloadfreebsd-ports-gnome-a1ac8e8a233b101f4c853460e261e71ee7a3e9a7.tar.gz
freebsd-ports-gnome-a1ac8e8a233b101f4c853460e261e71ee7a3e9a7.tar.zst
freebsd-ports-gnome-a1ac8e8a233b101f4c853460e261e71ee7a3e9a7.zip
Add missing patch for r409562
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/pkg/Makefile2
-rw-r--r--ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch77
2 files changed, 78 insertions, 1 deletions
diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile
index a8dc1966b708..fe9abd72d106 100644
--- a/ports-mgmt/pkg/Makefile
+++ b/ports-mgmt/pkg/Makefile
@@ -30,7 +30,7 @@ CFLAGS+= -Wno-error
EXTRA_PATCHES= ${FILESDIR}/extra-patch-docs_pkg.8
.endif
-EXTRA_PATCHES+= ${FILESDIR}/0001-Fix-installation-of-hardlinks.patch:-p1
+EXTRA_PATCHES+= ${FILESDIR}/0001-Fix-installation-of-hardlinks.patch
.include <bsd.port.pre.mk>
diff --git a/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch b/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch
new file mode 100644
index 000000000000..14cf4aec2755
--- /dev/null
+++ b/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch
@@ -0,0 +1,77 @@
+commit 34f3802a9e68f60e54671dca159c9e788063e291
+Author: Vsevolod Stakhov <vsevolod@highsecure.ru>
+Date: Tue Feb 23 11:08:32 2016 +0000
+
+ Fix installation of hardlinks
+
+ In case of hardlinks, `pathname` var was incorrectly restored from `rpath`
+ which is intended to be a temporary name. Hence, renaming was meaningless
+ afterwards.
+
+ Issue: #1394
+ Reported by: many
+
+diff --git libpkg/pkg_add.c libpkg/pkg_add.c
+index adabb59..497e0fb 100644
+--- libpkg/pkg_add.c
++++ libpkg/pkg_add.c
+@@ -1,8 +1,9 @@
+ /*-
+ * Copyright (c) 2011-2013 Baptiste Daroussin <bapt@FreeBSD.org>
+ * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
++ * Copyright (c) 2016, Vsevolod Stakhov
+ * All rights reserved.
+- *
++ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+@@ -12,7 +13,7 @@
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+- *
++ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+@@ -118,7 +119,7 @@ attempt_to_merge(bool renamed, struct pkg_config_file *rcf,
+ pkg_debug(3, "Empty configuration content for local package");
+ return;
+ }
+-
++
+ pkg_debug(1, "Config file found %s", pathname);
+ file_to_buffer(pathname, &localconf, &sz);
+
+@@ -182,7 +183,7 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location,
+ int retcode = EPKG_OK;
+ int ret = 0, cur_file = 0;
+ char path[MAXPATHLEN], pathname[MAXPATHLEN], rpath[MAXPATHLEN];
+- char linkpath[MAXPATHLEN], bd[MAXPATHLEN], *cp;
++ char linkpath[MAXPATHLEN], tmppath[MAXPATHLEN], bd[MAXPATHLEN], *cp;
+ const char *lp;
+ struct stat st;
+ const struct stat *aest;
+@@ -244,17 +245,16 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location,
+
+ archive_entry_set_pathname(ae, rpath);
+ /*
+- * Deal with hardlinks to rooted path. Use pathname as
+- * temporary work space, restore it from rpath for use below.
++ * Deal with hardlinks to rooted path. Use tmppath as
++ * temporary work space
+ */
+ lp = archive_entry_hardlink(ae);
+ if (lp != NULL) {
+ pkg_absolutepath(lp, linkpath, sizeof(linkpath));
+- snprintf(pathname, sizeof(pathname), "%s%s%s",
++ snprintf(tmppath, sizeof(tmppath), "%s%s%s",
+ location ? location : "", *linkpath == '/' ? "" : "/",
+ linkpath);
+- archive_entry_set_hardlink(ae, pathname);
+- strcpy(pathname, rpath);
++ archive_entry_set_hardlink(ae, tmppath);
+ }
+
+ /* load in memory the content of config files */