Subject: Re: [bug#75711] [PATCH] gnu: git: Update to 2.48.1. [security fixes]
From: Ludovic Courtès <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Tue, 28 Jan 2025 15:51:08 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

[email-masked] skribis:

> From: Ashish SHUKLA <[email-masked]>
>
> Fixes the CVE-2024-50349 and CVE-2024-52006.
>
> * gnu/packages/version-control.scm (git-minimal): Update to 2.48.1.
> [#:phases]<patch-tests>: Purge purged tests in meson.build.
> (git)[#:phases]<build-subtree>: Update to also generate asciidoc.conf.
> <install-man-pages>: Update hash.
>
> Change-Id: I6616e95822ded252a9bec1312702016985cb9de7

Applied with the following change to avoid a rebuild of
‘git-minimal/pinned’ and everything that depends on it.

Thanks,
Ludo’.

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 96cbac0824..636509d6c5 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Nikita Karetnikov <[email-masked]>
 ;;; Copyright © 2013 Cyril Roelandt <[email-masked]>
-;;; Copyright © 2013-2022, 2024 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2013-2022, 2024-2025 Ludovic Courtès <[email-masked]>
 ;;; Copyright © 2013, 2014 Andreas Enge <[email-masked]>
 ;;; Copyright © 2015, 2016 Mathieu Lirzin <[email-masked]>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <[email-masked]>
@@ -435,18 +435,23 @@ (define-public git-minimal
                           '("t/t9128-git-svn-cmd-branch.sh"
                             "t/t9167-git-svn-cmd-branch-subproject.sh"
                             "t/t9141-git-svn-multiple-branches.sh"))
-                ;; Purge the purged tests in meson.build
-                (substitute "t/meson.build"
-                  (list (cons "^(.+')(t[^']+[.]sh)('.*)$"
-                          (lambda (line matches)
-                            (let* ((match-offset (vector-ref (car matches) 3))
-                                   (test-file (string-append "t/"
-                                                (substring line
-                                                  (car match-offset)
-                                                  (cdr match-offset)))))
-                              (if (file-exists? test-file)
-                                line
-                                "")))))))))
+
+                #$@(if (version>=? (package-version this-package)
+                                   "2.48.0")
+                       ;; Purge the purged tests in meson.build
+                       #~((substitute
+                           "t/meson.build"
+                           (list (cons "^(.+')(t[^']+[.]sh)('.*)$"
+                                       (lambda (line matches)
+                                         (let* ((match-offset (vector-ref (car matches) 3))
+                                                (test-file (string-append "t/"
+                                                                          (substring line
+                                                                                     (car match-offset)
+                                                                                     (cdr match-offset)))))
+                                           (if (file-exists? test-file)
+                                               line
+                                               "")))))))
+                       #~()))))
           (add-after 'install 'install-shell-completion
             (lambda _
               (let ((bash (string-append #$output "/etc/bash_completion.d"))