From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BB7D013877A for ; Tue, 24 Jun 2014 21:49:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AD4A5E0912; Tue, 24 Jun 2014 21:49:43 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 41751E0912 for ; Tue, 24 Jun 2014 21:49:43 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 29EBA33FE97 for ; Tue, 24 Jun 2014 21:49:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id D583E18F67 for ; Tue, 24 Jun 2014 21:49:39 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1403646607.18586b8eef2dee0f432d7f57b642fa177aebc788.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:master commit in: misc/install-xattr/ X-VCS-Repository: proj/elfix X-VCS-Files: misc/install-xattr/checkcopyattrs.sh misc/install-xattr/install-xattr.c X-VCS-Directories: misc/install-xattr/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 18586b8eef2dee0f432d7f57b642fa177aebc788 X-VCS-Branch: master Date: Tue, 24 Jun 2014 21:49:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: c4b2d74f-5d46-4c86-a09c-e64bb1d44a02 X-Archives-Hash: e98c946f63272aee72a3439902175fed commit: 18586b8eef2dee0f432d7f57b642fa177aebc788 Author: Jason Zaman perfinion com> AuthorDate: Tue Jun 24 19:07:08 2014 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Tue Jun 24 21:50:07 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=18586b8e Correctly determine dst path if src is in a dir There is a mismatch between how install and install-xattr determines the destination path. When running `install src/a dst/' the correct output is `dst/a'. install-xattr was incorrectly joining the paths so thought the output was `dst/src/a' which did not exist. A test case has been added to the test script too. Signed-off-by: Jason Zaman perfinion.com> Signed-off-by: Anthony G. Basile gentoo.org> --- misc/install-xattr/checkcopyattrs.sh | 11 ++++++++++- misc/install-xattr/install-xattr.c | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/misc/install-xattr/checkcopyattrs.sh b/misc/install-xattr/checkcopyattrs.sh index 2e8f30f..0249013 100755 --- a/misc/install-xattr/checkcopyattrs.sh +++ b/misc/install-xattr/checkcopyattrs.sh @@ -2,7 +2,7 @@ set -e touch a b c -mkdir -p d e +mkdir -p d e f setfattr -n user.foo -v "bar" a setfattr -n user.bas -v "x" a setfattr -n user.pax.flags -v "mr" a @@ -27,6 +27,15 @@ setfattr -n user.pax.flags -v "r" c [ "$(getfattr --only-values -n user.pax.flags d/b)" == "p" ] [ "$(getfattr --only-values -n user.pax.flags d/c)" == "r" ] +# This tests if the src file was inside a directory +# the correct dst location should be f/a. NOT f/d/a. +./install-xattr d/a f + +[ -x f/a ] +[ ! -x f/d/a ] +[ "$(getfattr --only-values -n user.foo f/a)" == "bar" ] +[ "$(getfattr --only-values -n user.bas f/a)" == "x" ] + ./install-xattr -t e a b c [ "$(getfattr --only-values -n user.foo e/a)" == "bar" ] diff --git a/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c index 3d70b5e..f2157fd 100644 --- a/misc/install-xattr/install-xattr.c +++ b/misc/install-xattr/install-xattr.c @@ -382,7 +382,7 @@ main(int argc, char* argv[]) if (S_ISDIR(s.st_mode)) continue; - path = path_join(target, argv[i]); + path = path_join(target, basename(argv[i])); copyxattr(argv[i], path); free(path); }