~ruther/guix-local

46ce24fb2d8c9f7dce16c4c08919f0fc108dbfae — Miguel Ángel Arruga Vivas 5 years ago 3428c66
gnu: git: Add phase to restore hooks shebang.

Fixes <https://bugs.gnu.org/25508>.

* gnu/packages/version-control.scm (git)[arguments]: New phase
restore-sample-hooks-shebang.
1 files changed, 10 insertions(+), 0 deletions(-)

M gnu/packages/version-control.scm
M gnu/packages/version-control.scm => gnu/packages/version-control.scm +10 -0
@@ 391,6 391,16 @@ as well as the classic centralized workflow.")
              (install-file "contrib/subtree/git-subtree.1"
                            (string-append subtree "/share/man/man1"))
              #t)))
         (add-after 'install 'restore-sample-hooks-shebang
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (dir (string-append out "/share/git-core/templates/hooks")))
               (for-each (lambda (file)
                           (format #t "restoring shebang on `~a'~%" file)
                           (substitute* file
                             (("^#!.*/bin/sh") "#!/bin/sh")))
                         (find-files dir ".*"))
               #t)))
        (add-after 'install 'split
          (lambda* (#:key inputs outputs #:allow-other-keys)
            ;; Split the binaries to the various outputs.