Subject: Re: [PATCH v2] gnu: make-gitolite: Fix inputs references
From: Hilton Chain <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Sun, 08 Dec 2024 15:45:27 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Ashish,

On Mon, 02 Dec 2024 17:48:23 +0800,
[email-masked] wrote:
>
> From: Ashish SHUKLA <[email-masked]>
>
> * gnu/packages/version-control.scm (make-gitolite)[#:phases]
> <patch-scripts,patch-source,wrap-scripts>: Update functions to reference
> inputs from the inputs alist, instead of hardcoding.
>
> Change-Id: Ia2468235b43c257ee1816d19325671d373ed2870
> ---
> Hi Hilton,
>
> Thanks for your comments. The patch is amended to incorporate your suggestions.
>
>  gnu/packages/version-control.scm | 28 ++++++++++++++--------------
>  1 file changed, 14 insertions(+), 14 deletions(-)

Applied v2 as 810cc4764a27ddac3e15f325b02a4f665067f4ac with following change:

--8<---------------cut here---------------start------------->8---
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 3987a6e3dc..b4863698e5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -2078,18 +2078,21 @@ (define* (make-gitolite #:optional (extra-inputs '()))
                    ;; invokes Perl.
                    (substitute* (find-files ".")
                      ((" perl -")
-                      (string-append " " (search-input-file inputs "/bin/perl") " -")))
+                      (string-append
+                       " " (search-input-file inputs "bin/perl") " -")))

                    (substitute* (find-files "src/triggers" ".*")
                      ((" sed ")
-                      (string-append " " (search-input-file inputs "/bin/sed") " ")))
+                      (string-append
+                       " " (search-input-file inputs "bin/sed") " ")))

                    (substitute*
                        '("src/triggers/post-compile/update-gitweb-access-list"
                          "src/triggers/post-compile/ssh-authkeys-split"
                          "src/triggers/upstream")
                      ((" grep ")
-                      (string-append " " (search-input-file inputs "/bin/grep") " ")))
+                      (string-append
+                       " " (search-input-file inputs "bin/grep") " ")))

                    ;; Avoid references to the store in authorized_keys.
                    ;; This works because gitolite-shell is in the PATH.
@@ -2102,20 +2105,24 @@ (define* (make-gitolite #:optional (extra-inputs '()))
                    ;; pubkey
                    (substitute* "src/lib/Gitolite/Setup.pm"
                      (("\"cat ")
-                      (string-append "\"" (search-input-file inputs "/bin/cat") " "))
+                      (string-append
+                       "\"" (search-input-file inputs "bin/cat") " "))
                      (("\"ssh-keygen")
-                      (string-append "\"" (search-input-file inputs "/bin/ssh-keygen"))))
+                      (string-append
+                       "\"" (search-input-file inputs "bin/ssh-keygen"))))

                    (substitute* '("src/lib/Gitolite/Hooks/PostUpdate.pm"
                                   "src/lib/Gitolite/Hooks/Update.pm")
                      (("/usr/bin/perl")
-                      (search-input-file inputs "/bin/perl")))
+                      (search-input-file inputs "bin/perl")))

                    (substitute* "src/lib/Gitolite/Common.pm"
                      (("\"ssh-keygen")
-                      (string-append "\"" (search-input-file inputs "/bin/ssh-keygen")))
+                      (string-append
+                       "\"" (search-input-file inputs "bin/ssh-keygen")))
                      (("\"logger\"")
-                      (string-append "\"" (search-input-file inputs "/bin/logger") "\"")))
+                      (string-append
+                       "\"" (search-input-file inputs "bin/logger") "\"")))

                    (substitute* "src/lib/Gitolite/Cache.pm"
                      (("/usr/sbin/redis-server") "redis-server"))
@@ -2139,13 +2146,17 @@ (define* (make-gitolite #:optional (extra-inputs '()))
                    (for-each (lambda (file-name)
                                (wrap-program (string-append #$output file-name)
                                  `("PATH" ":" prefix
-                                   ,(map (lambda (dir)
+                                   ,(append
+                                     (map (lambda (command)
+                                            (dirname
+                                             (search-input-file
+                                              inputs
+                                              (string-append "bin/" command))))
+                                          '("chmod" "find" "git"))
+                                     (map (lambda (dir)
                                            (string-append dir "/bin"))
                                          (list #$output
-                                               (assoc-ref inputs "coreutils")
-                                               (assoc-ref inputs "findutils")
-                                               (assoc-ref inputs "git")
-                                               #$@extra-inputs)))))
+                                               #$@extra-inputs))))))
                              '("/bin/gitolite" "/bin/gitolite-shell")))))))
     (inputs
      (append (list bash-minimal coreutils findutils git inetutils openssh perl)
--8<---------------cut here---------------end--------------->8---

Thanks