From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 22 18:26:11 2018 Received: (at 30809) by debbugs.gnu.org; 22 Jul 2018 22:26:11 +0000 Received: from localhost ([127.0.0.1]:52770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhMnr-0003SM-0Y for submit@debbugs.gnu.org; Sun, 22 Jul 2018 18:26:11 -0400 Received: from mail.lassieur.org ([83.152.10.219]:50238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhMnp-0003SC-5V for 30809@debbugs.gnu.org; Sun, 22 Jul 2018 18:26:09 -0400 Received: from rodion (88.191.118.83 [88.191.118.83]) by mail.lassieur.org (OpenSMTPD) with ESMTPSA id c47df01b (TLSv1.2:ECDHE-RSA-CHACHA20-POLY1305:256:NO); Sun, 22 Jul 2018 22:26:07 +0000 (UTC) References: <87woyfzmir.fsf@cbaines.net> <20180714062855.18705-1-mail@cbaines.net> User-agent: mu4e 1.0; emacs 26.1 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur To: Christopher Baines Subject: Re: [bug#30809] [PATCH 1/2] gnu: Modify the gitolite package to support the Guix service. In-reply-to: <20180714062855.18705-1-mail@cbaines.net> Date: Mon, 23 Jul 2018 00:26:06 +0200 Message-ID: <87wotmq54x.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30809 Cc: 30809@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Christopher! Christopher Baines writes: > Previously the gitolite package worked, but there were problems using it for > the service where you might have a minimal PATH. This commit patches the > source and scripts where possible to use store paths, and also wraps the > gitolite script to handle the harder dependencies. > > * gnu/packages/version-control.scm (gitolite)[arguments]: Add more patching to > the patch-scripts phase, and add two new phases (patch-source and > wrap-scripts). > [inputs]: Add coreutils, findutils and inetutils. > --- > gnu/packages/version-control.scm | 53 ++++++++++++++++++++++++++++++-- > 1 file changed, 51 insertions(+), 2 deletions(-) [...] > (replace 'install > (lambda* (#:key outputs #:allow-other-keys) > (let* ((output (assoc-ref outputs "out")) > @@ -1045,9 +1075,28 @@ also walk each side of a merge and test those changes individually.") > (symlink (string-append sharedir "/" script) > (string-append bindir "/" script))) > '("gitolite" "gitolite-shell")) > - #t)))))) > + #t))) > + (add-after 'install 'wrap-scripts > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (wrap-program (string-append (assoc-ref outputs "out") > + "/bin/gitolite") > + `("PATH" ":" prefix > + (,(string-append (assoc-ref outputs "out") > + "/bin") > + ,(string-append (assoc-ref inputs "coreutils") > + "/bin") > + ;; find is used in quite a few places > + ,(string-append (assoc-ref inputs "findutils") > + "/bin") > + ,(string-append (assoc-ref inputs "git") > + "/bin")))) Here you can avoid some repetitions like this: (let ((out (assoc-ref outputs "out")) (coreutils (assoc-ref inputs "coreutils")) (findutils (assoc-ref inputs "findutils")) (git (assoc-ref inputs "git"))) (wrap-program (string-append out "/bin/gitolite") `("PATH" ":" prefix ,(map (lambda (dir) (string-append dir "/bin")) (list out coreutils findutils git)))) #t) > + > + #t))))) > (inputs > - `(("perl" ,perl))) > + `(("perl" ,perl) > + ("coreutils" ,coreutils) > + ("findutils" ,findutils) > + ("inetutils" ,inetutils))) > ;; git and openssh are propagated because trying to patch the source via > ;; regexp matching is too brittle and prone to false positives. > (propagated-inputs Otherwise, LGTM, thank you!