From 9f0e9eea6d7c338fba234c2f8935ba76b1d94b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Mon, 16 Nov 2020 19:06:40 +0100 Subject: [PATCH] gnu: git: Add phase to restore hooks shebang. Fixes . * gnu/packages/version-control.scm (git)[arguments]: New phase restore-sample-hooks-shebang. --- gnu/packages/version-control.scm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 3e46a6162b..1842528ff6 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -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. -- 2.29.2