From owner-svn-ports-head@freebsd.org Thu Feb 25 22:35:11 2016 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA0FAAB4686; Thu, 25 Feb 2016 22:35:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94DA1FB0; Thu, 25 Feb 2016 22:35:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1PMZA3d012806; Thu, 25 Feb 2016 22:35:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1PMZAfp012804; Thu, 25 Feb 2016 22:35:10 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201602252235.u1PMZAfp012804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 25 Feb 2016 22:35:10 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r409566 - in head/ports-mgmt/pkg: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2016 22:35:11 -0000 Author: bdrewery Date: Thu Feb 25 22:35:10 2016 New Revision: 409566 URL: https://svnweb.freebsd.org/changeset/ports/409566 Log: Add missing patch for r409562 Added: head/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch (contents, props changed) Modified: head/ports-mgmt/pkg/Makefile Modified: head/ports-mgmt/pkg/Makefile ============================================================================== --- head/ports-mgmt/pkg/Makefile Thu Feb 25 22:27:41 2016 (r409565) +++ head/ports-mgmt/pkg/Makefile Thu Feb 25 22:35:10 2016 (r409566) @@ -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 Added: head/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch Thu Feb 25 22:35:10 2016 (r409566) @@ -0,0 +1,77 @@ +commit 34f3802a9e68f60e54671dca159c9e788063e291 +Author: Vsevolod Stakhov +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 + * Copyright (c) 2011-2012 Julien Laffaye ++ * 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 */