[Top][All Lists]

[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 ( 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/" and 
> "t/" 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/"
> -              (("\"#!/gnu.*/bin/sh") "\"#!/bin/sh"))
> +              (((string-append "\"#!" (%store-directory) ".*/bin/sh")) 
> "\"#!/bin/sh") )
>              (substitute* "t/"
> -              (("\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

Thanks in advance, and welcome!

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]