From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fe3x7-0002Qr-Hw for guix-patches@gnu.org; Fri, 13 Jul 2018 15:42:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fe3x4-0002Sd-KR for guix-patches@gnu.org; Fri, 13 Jul 2018 15:42:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:51360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fe3x4-0002S8-FC for guix-patches@gnu.org; Fri, 13 Jul 2018 15:42:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fe3x4-0004lv-9L for guix-patches@gnu.org; Fri, 13 Jul 2018 15:42:02 -0400 Subject: [bug#30809] [PATCH 1/2] gnu: Modify the gitolite package to support the Guix service. References: <87woyfzmir.fsf@cbaines.net> In-Reply-To: <87woyfzmir.fsf@cbaines.net> Resent-Message-ID: From: Christopher Baines Date: Fri, 13 Jul 2018 20:41:00 +0100 Message-Id: <20180713194101.14891-1-mail@cbaines.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 30809@debbugs.gnu.org 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(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 2bd59ae95..3bbc586e1 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -1026,12 +1026,42 @@ also walk each side of a merge and test those changes individually.") ((" perl -") (string-append " " perl " -"))) + (substitute* (find-files "src/triggers" ".*") + ((" sed ") + (string-append " " (which "sed") " "))) + + (substitute* + '("src/triggers/post-compile/update-gitweb-access-list" + "src/triggers/post-compile/ssh-authkeys-split" + "src/triggers/upstream") + ((" grep ") + (string-append " " (which "grep") " "))) + ;; Avoid references to the store in authorized_keys. ;; This works because gitolite-shell is in the PATH. (substitute* "src/triggers/post-compile/ssh-authkeys" (("\\$glshell \\$user") "gitolite-shell $user")) #t))) + (add-before 'install 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + ;; Gitolite uses cat to test the readability of the + ;; pubkey + (substitute* "src/lib/Gitolite/Setup.pm" + (("\"cat ") + (string-append "\"" (which "cat") " ")) + (("\"ssh-keygen") + (string-append "\"" (which "ssh-keygen")))) + + (substitute* "src/lib/Gitolite/Common.pm" + (("\"ssh-keygen") + (string-append "\"" (which "ssh-keygen"))) + (("\"logger\"") + (string-append "\"" + (assoc-ref inputs "inetutils") + "/bin/logger\""))) + + #t)) (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")))) + + #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 -- 2.17.1