From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: [PATCH] gnu: password-store: Wrap PATH. Date: Fri, 29 Jul 2016 10:02:45 -0400 Message-ID: References: <1469751624.114434.679895025.599AB6DD@webmail.messagingengine.com> <1469752717.117537.679907329.010AA3BD@webmail.messagingengine.com> <871t2c7qy0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT8NH-0003bT-3J for guix-devel@gnu.org; Fri, 29 Jul 2016 10:02:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bT8NC-00081G-WA for guix-devel@gnu.org; Fri, 29 Jul 2016 10:02:51 -0400 Received: from mail-vk0-x234.google.com ([2607:f8b0:400c:c05::234]:32894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bT8NC-000819-PN for guix-devel@gnu.org; Fri, 29 Jul 2016 10:02:46 -0400 Received: by mail-vk0-x234.google.com with SMTP id x130so55019151vkc.0 for ; Fri, 29 Jul 2016 07:02:46 -0700 (PDT) In-Reply-To: <871t2c7qy0.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mathieu Lirzin Cc: guix-devel On Fri, Jul 29, 2016 at 5:07 AM, Mathieu Lirzin wrote: > Hello, > > Alex Griffin writes: > >> On Thu, Jul 28, 2016, at 07:20 PM, Alex Griffin wrote: >> >> From 74b838fea52293386169299881cdd7cfefff7f4d Mon Sep 17 00:00:00 2001 >> From: Alex Griffin >> Date: Thu, 28 Jul 2016 19:06:10 -0500 >> Subject: [PATCH] gnu: password-store: Wrap PATH. >> >> * gnu/packages/password-utils.scm (password-store): >> [arguments]: Wrap PATH more thoroughly. >> [native-inputs]: Move getopt to inputs. >> [inputs]: Add sed & alphabetize packages. > ^^ > Indentation and formatting changes can be omitted in commit log. > >> --- >> gnu/packages/password-utils.scm | 33 ++++++++++++++++----------------- >> 1 file changed, 16 insertions(+), 17 deletions(-) >> >> diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-uti= ls.scm >> index a03214a..497717f 100644 >> --- a/gnu/packages/password-utils.scm >> +++ b/gnu/packages/password-utils.scm >> @@ -6,6 +6,7 @@ >> ;;; Copyright =C2=A9 2016 Jessica Tallon >> ;;; Copyright =C2=A9 2016 Andreas Enge >> ;;; Copyright =C2=A9 2016 Lukas Gradl >> +;;; Copyright =C2=A9 2016 Alex Griffin >> ;;; >> ;;; This file is part of GNU Guix. >> ;;; >> @@ -266,27 +267,25 @@ any X11 window.") >> '(#:phases >> (modify-phases %standard-phases >> (delete 'configure) >> - (add-after >> - ;; The script requires 'getopt' at run-time, and this allows >> - ;; the user to not install the providing package 'util-linux' >> - ;; in their profile. >> - 'unpack 'patch-path >> - (lambda* (#:key inputs outputs #:allow-other-keys) >> - (let ((getopt (string-append (assoc-ref inputs "getopt") >> - "/bin/getopt"))) >> - (substitute* "src/password-store.sh" >> - (("GETOPT=3D\"getopt\"") >> - (string-append "GETOPT=3D\"" getopt "\""))) >> - #t)))) >> + (add-after 'install 'wrap-path >> + (lambda* (#:key inputs outputs #:allow-other-keys) >> + (let* ((out (assoc-ref outputs "out")) >> + (path (map (lambda (pkg) >> + (string-append (assoc-ref inputs pkg) = "/bin")) >> + '("coreutils" "getopt" "git" "gnupg" "pw= gen" >> + "sed" "tree" "which" "xclip")))) >> + (wrap-program (string-append out "/bin/pass") >> + `("PATH" ":" prefix (,(string-join path ":")))))))) > > 'let*' can safely be replaced by 'let' here. > >> #:make-flags (list "CC=3Dgcc" (string-append "PREFIX=3D" %output= )) >> #:test-target "test")) >> - (native-inputs `(("getopt" ,util-linux))) ; getopt for the tests >> - (inputs `(("gnupg" ,gnupg) >> - ("pwgen" ,pwgen) >> - ("xclip" ,xclip) >> + (inputs `(("getopt" ,util-linux) >> ("git" ,git) >> + ("gnupg" ,gnupg) >> + ("pwgen" ,pwgen) >> + ("sed" ,sed) >> ("tree" ,tree) >> - ("which" ,which))) >> + ("which" ,which) >> + ("xclip" ,xclip))) >> (home-page "http://www.passwordstore.org/") >> (synopsis "Encrypted password manager") >> (description "Password-store is a password manager which uses GnuPG= to > > Pushed in commit 61201e46a72b715e1a38ce56932c3f4f2d3885b4. Sorry I'm late, but I don't think this is the right fix. Wrapping programs should only be considered after other options are exhausted. The correct fix is to patch the source directly to refer to executables by their absolute path. Why wasn't it done this way? - Dave