From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3QJr-0000uY-Bj for guix-patches@gnu.org; Tue, 03 Apr 2018 14:06:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3QJn-000530-5X for guix-patches@gnu.org; Tue, 03 Apr 2018 14:06:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57674) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f3QJm-00052v-TM for guix-patches@gnu.org; Tue, 03 Apr 2018 14:06:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f3QJm-0004Kt-M1 for guix-patches@gnu.org; Tue, 03 Apr 2018 14:06:02 -0400 Subject: [bug#31016] [PATCH] gnu: git: Fix checksum patch in 'patch-tests'. Resent-Message-ID: From: YOANN P Date: Tue, 3 Apr 2018 18:05:41 +0000 Message-ID: References: , <87h8osbmfk.fsf@fastmail.com> In-Reply-To: <87h8osbmfk.fsf@fastmail.com> Content-Language: fr-FR Content-Type: multipart/alternative; boundary="_000_DB6P18901MB002280383A8DB2C3FC4AC9B3DBA50DB6P18901MB0022_" MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Marius Bakke , "31016@debbugs.gnu.org" <31016@debbugs.gnu.org> --_000_DB6P18901MB002280383A8DB2C3FC4AC9B3DBA50DB6P18901MB0022_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable >Hi Yoann, > > Hi Marius, And thanks again for yesterday on irc to point me at how to solve this bug = ^^ >YOANN P writes: > >> Hi Guix Team, >> >> First contribution to Guix project so i hope i forgot nothing in the pro= cess 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? Sorry for the indentation, I indeed used my VIMorite editor and don't use E= macs to be able to use the indentation plugin :/ Please find bellow the patch modified with the modifications asked ( I just= recompiled Git with those modifications to be sure and seems ok) ---- >From 3df3fbfadf24b2521a1b60ea853d7fcec6452f44 Mon Sep 17 00:00:00 2001 From: RockAndSka Date: Sun, 1 Apr 2018 16:11:30 +0200 Subject: [PATCH] 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. --- gnu/packages/version-control.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-contro= l.scm index ba985f6..619052d 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -217,6 +217,7 @@ as well as the classic centralized workflow.") #t)) (add-before 'check 'patch-tests (lambda _ + (let ((store-directory (%store-directory))) ;; These files contain some funny bytes that Guile is unable ;; to decode for shebang patching. Just delete them. (for-each delete-file '("t/t4201-shortlog.sh" @@ -238,10 +239,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")) "'#!/bi= n/sh")) ;; FIXME: Some hooks fail with "basename: command not found". ;; See 't/trash directory.t9164.../svn-hook.log'. (delete-file "t/t9164-git-svn-dcommit-concurrent.sh") @@ -252,7 +253,7 @@ as well as the classic centralized workflow.") '("t/t9128-git-svn-cmd-branch.sh" "t/t9167-git-svn-cmd-branch-subproject.sh" "t/t9141-git-svn-multiple-branches.sh")) - #t)) + #t))) (add-after 'install 'install-shell-completion (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) -- 2.7.4 > >Thanks in advance, and welcome! Thanks to you and all the hard work provided by people like you to provide = us tools like Guix :) Let me know if I missed something Regards, --_000_DB6P18901MB002280383A8DB2C3FC4AC9B3DBA50DB6P18901MB0022_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

=

>Hi Yoann,
>
>

Hi Marius,

And thanks again for yesterday on irc to point me at how to solve this= bug ^^

>YOANN P <yoann_mac_donald@hotmail.com> 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 'patc= h-tests'
>> phase, use %store-directory instead of '/gnu' to prevent test= s failure
>> in case a custom store path is used.
>
>[...]
>
>> @@ -238,10 +238,10 @@ as well as the classic centralized = workflow.")
>>                ((&quo= t;\tcommit_template_commented") "\ttrue"))
>>              ;; More check= sum mismatches due to odd shebangs.
>>              (substitute* = "t/t9100-git-svn-basic.sh"
>> -              (("\&q= uot;#!/gnu.*/bin/sh") "\"#!/bin/sh"))
>> +              (((stri= ng-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"))
>> +              (((stri= ng-append "\t#!" (%store-directory) ".*/bin/sh")) "= ;\t#!/bin/sh")
>> +              (((stri= ng-append "'#!" (%store-directory) ".*/bin/sh")) "= '#!/bin/sh"))
>
>Calling out to (%store-directory) inside a string substitution mul= tiple
>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?

Sorry for the indentation, I indeed used my VIMorite editor and don't = use Emacs to be able to use the indentation plugin :/
Please find bellow the patch modified with the modifications asked ( I=  just recompiled Git with those modifications to be sure and seems ok)=

----

From 3df3fbfadf24b2521a1b60ea853d7fcec6452f44 Mon Sep 17 00:00:00 2001=
From: RockAndSka <yoann_mac_donald@hotmail.com>
Date: Sun, 1 Apr 2018 16:11:30 +0200
Subject: [PATCH] gnu: git: Fix checksum patch in 'patch-tests'.

* gnu/packages/version-control.scm (git)[arguments]: In 'patch-tests'<= /div>
phase, use %store-directory instead of '/gnu' to prevent tests failure=
in case a custom store path is used.
---
 gnu/packages/version-control.scm | 9 +++++--= --
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-c= ontrol.scm
index ba985f6..619052d 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -217,6 +217,7 @@ as well as the classic centralized workflow.&q= uot;)
             #t))
         (add-before 'check 'patch-tests
           (lambda _
+     (let ((stor= e-directory (%store-directory)))
             ;; These files contain= some funny bytes that Guile is unable
             ;; to decode for sheba= ng patching. Just delete them.
             (for-each delete-file = '("t/t4201-shortlog.sh"
@@ -238,10 +239,10 @@ as well as the classic centralized workflow.= ")
               (("\tcommi= t_template_commented") "\ttrue"))
             ;; More checksum misma= tches due to odd shebangs.
             (substitute* "t/t= 9100-git-svn-basic.sh"
-              (("\"#!/gn= u.*/bin/sh") "\"#!/bin/sh"))
+              (((string-append= "\"#!" store-directory ".*/bin/sh")) "\"= ;#!/bin/sh") )
             (substitute* "t/t= 9300-fast-import.sh"
-              (("\t#!/gnu.*/b= in/sh") "\t#!/bin/sh")
-              (("'#!/gnu.*/bi= n/sh") "'#!/bin/sh"))
+              (((string-append= "\t#!" store-directory ".*/bin/sh")) "\t#!/bin/sh= ")
+              (((string-append= "'#!" store-directory ".*/bin/sh")) "'#!/bin/sh&q= uot;))
             ;; FIXME: Some hooks f= ail with "basename: command not found".
             ;; See 't/trash direct= ory.t9164.../svn-hook.log'.
             (delete-file "t/t= 9164-git-svn-dcommit-concurrent.sh")
@@ -252,7 +253,7 @@ as well as the classic centralized workflow.&q= uot;)
                    =    '("t/t9128-git-svn-cmd-branch.sh"
                    =      "t/t9167-git-svn-cmd-branch-subproject.sh"
                    =      "t/t9141-git-svn-multiple-branches.sh"))
-            #t))
+            #t)))
         (add-after 'install 'install-shell-c= ompletion
           (lambda* (#:key outputs #:all= ow-other-keys)
             (let* ((out  &nbs= p;      (assoc-ref outputs "out"))
-- 
2.7.4



>
>Thanks in advance, and welcome!

Thanks to you and all the hard work provided by pe= ople like you to provide us tools like Guix :)

Let me know if I missed something

Regards,
--_000_DB6P18901MB002280383A8DB2C3FC4AC9B3DBA50DB6P18901MB0022_--