gnu: git: Fix checksum patch in 'patch-tests'.

* gnu/packages/version-control.scm (git)[arguments]: In 'patch-tests'
phase, use %store-directory instead of '/gnu' to prevent tests failure
in case a custom store path is used.

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
This commit is contained in:
YOANN P 2018-04-03 18:05:41 +00:00 committed by Marius Bakke
parent 385b2dde61
commit 6e0efe8cd5
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 36 additions and 35 deletions

View File

@ -223,42 +223,43 @@ as well as the classic centralized workflow.")
#t)) #t))
(add-before 'check 'patch-tests (add-before 'check 'patch-tests
(lambda _ (lambda _
;; These files contain some funny bytes that Guile is unable (let ((store-directory (%store-directory)))
;; to decode for shebang patching. Just delete them. ;; These files contain some funny bytes that Guile is unable
(for-each delete-file '("t/t4201-shortlog.sh" ;; to decode for shebang patching. Just delete them.
"t/t7813-grep-icase-iso.sh")) (for-each delete-file '("t/t4201-shortlog.sh"
;; Many tests contain inline shell scripts (hooks etc). "t/t7813-grep-icase-iso.sh"))
(substitute* (find-files "t" "\\.sh$") ;; Many tests contain inline shell scripts (hooks etc).
(("#!/bin/sh") (string-append "#!" (which "sh")))) (substitute* (find-files "t" "\\.sh$")
;; Un-do shebang patching here to prevent checksum mismatch. (("#!/bin/sh") (string-append "#!" (which "sh"))))
(substitute* '("t/t4034/perl/pre" "t/t4034/perl/post") ;; Un-do shebang patching here to prevent checksum mismatch.
(("^#!.*/bin/perl") "#!/usr/bin/perl")) (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
(substitute* "t/t5003-archive-zip.sh" (("^#!.*/bin/perl") "#!/usr/bin/perl"))
(("cp /bin/sh") (string-append "cp " (which "sh")))) (substitute* "t/t5003-archive-zip.sh"
(substitute* "t/t6030-bisect-porcelain.sh" (("cp /bin/sh") (string-append "cp " (which "sh"))))
(("\"/bin/sh\"") (string-append "\"" (which "sh") "\""))) (substitute* "t/t6030-bisect-porcelain.sh"
;; FIXME: This test runs `git commit` with a bogus EDITOR (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
;; and empty commit message, but does not fail the way it's ;; FIXME: This test runs `git commit` with a bogus EDITOR
;; expected to. The test passes when invoked interactively. ;; and empty commit message, but does not fail the way it's
(substitute* "t/t7508-status.sh" ;; expected to. The test passes when invoked interactively.
(("\tcommit_template_commented") "\ttrue")) (substitute* "t/t7508-status.sh"
;; More checksum mismatches due to odd shebangs. (("\tcommit_template_commented") "\ttrue"))
(substitute* "t/t9100-git-svn-basic.sh" ;; More checksum mismatches due to odd shebangs.
(("\"#!/gnu.*/bin/sh") "\"#!/bin/sh")) (substitute* "t/t9100-git-svn-basic.sh"
(substitute* "t/t9300-fast-import.sh" (((string-append "\"#!" store-directory ".*/bin/sh")) "\"#!/bin/sh") )
(("\t#!/gnu.*/bin/sh") "\t#!/bin/sh") (substitute* "t/t9300-fast-import.sh"
(("'#!/gnu.*/bin/sh") "'#!/bin/sh")) (((string-append "\t#!" store-directory ".*/bin/sh")) "\t#!/bin/sh")
;; FIXME: Some hooks fail with "basename: command not found". (((string-append "'#!" store-directory ".*/bin/sh")) "'#!/bin/sh"))
;; See 't/trash directory.t9164.../svn-hook.log'. ;; FIXME: Some hooks fail with "basename: command not found".
(delete-file "t/t9164-git-svn-dcommit-concurrent.sh") ;; See 't/trash directory.t9164.../svn-hook.log'.
(delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
;; XXX: These tests fail intermittently for unknown reasons: ;; XXX: These tests fail intermittently for unknown reasons:
;; <https://bugs.gnu.org/29546>. ;; <https://bugs.gnu.org/29546>.
(for-each delete-file (for-each delete-file
'("t/t9128-git-svn-cmd-branch.sh" '("t/t9128-git-svn-cmd-branch.sh"
"t/t9167-git-svn-cmd-branch-subproject.sh" "t/t9167-git-svn-cmd-branch-subproject.sh"
"t/t9141-git-svn-multiple-branches.sh")) "t/t9141-git-svn-multiple-branches.sh"))
#t)) #t)))
(add-after 'install 'install-shell-completion (add-after 'install 'install-shell-completion
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))