[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#31016] [PATCH] gnu: git: Fix checksum patch in 'patch-tests'.
From: |
Marius Bakke |
Subject: |
[bug#31016] [PATCH] gnu: git: Fix checksum patch in 'patch-tests'. |
Date: |
Tue, 03 Apr 2018 12:42:55 +0200 |
User-agent: |
Notmuch/0.26 (https://notmuchmail.org) Emacs/25.3.1 (x86_64-pc-linux-gnu) |
Hi Yoann,
YOANN P <address@hidden> writes:
> Hi Guix Team,
>
> First contribution to Guix project so i hope i forgot nothing in the process
> to submit my patch.
> There is already some patchs for "t/t9100-git-svn-basic.sh" and
> "t/t9300-fast-import.sh" but they
> assume than the store is always "/gnu/store".
> The bellow patch is intend to correct this and lets the check phase work the
> same way if a custom
> store is used.
Thank you for this patch!
[...]
> * 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.
[...]
> @@ -238,10 +238,10 @@ as well as the classic centralized workflow.")
> (("\tcommit_template_commented") "\ttrue"))
> ;; More checksum mismatches due to odd shebangs.
> (substitute* "t/t9100-git-svn-basic.sh"
> - (("\"#!/gnu.*/bin/sh") "\"#!/bin/sh"))
> + (((string-append "\"#!" (%store-directory) ".*/bin/sh"))
> "\"#!/bin/sh") )
> (substitute* "t/t9300-fast-import.sh"
> - (("\t#!/gnu.*/bin/sh") "\t#!/bin/sh")
> - (("'#!/gnu.*/bin/sh") "'#!/bin/sh"))
> + (((string-append "\t#!" (%store-directory) ".*/bin/sh"))
> "\t#!/bin/sh")
> + (((string-append "'#!" (%store-directory) ".*/bin/sh"))
> "'#!/bin/sh"))
Calling out to (%store-directory) inside a string substitution multiple
times is not great. Can you try wrapping this phase in a let binding
that expands (%store-directory) once, and use that?
Something along the lines of:
(add-before 'check 'patch-tests
(lambda _
(let ((store-directory (%store-directory)))
[...]
(string-append "..." store-directory ".*/bin/sh"))))
We'll have to reindent it, but that's okay. Can you send an updated
patch?
Thanks in advance, and welcome!
signature.asc
Description: PGP signature