Subject: [bug#63092] [PATCH v3 2/2] gnu: git-minimal: Check files exist before delete.

From: Greg Hogan <[email-masked]>
Date: Wed, 26 Apr 2023 19:03:46 +0000

* gnu/packages/version-control.scm (git-minimal)
[arguments]<#:phases>(remove-unusable-perl-commands): Add file check
before deleting perl scripts so that this phase works for both new and
old, pinned versions.
---
 gnu/packages/version-control.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 5f6766f510..0467e9f4cb 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -634,8 +634,11 @@ (define-public git-minimal
                       (bin     (string-append out "/bin"))
                       (libexec (string-append out "/libexec")))
                  (for-each (lambda (file)
-                             (delete-file (string-append libexec
-                                                         "/git-core/" file)))
+                             (if (file-exists? file)
+                               (delete-file (string-append libexec
+                                                           "/git-core/" file))))
+                           ;; git-add--interactive was removed in Git 2.40 but
+                           ;; this phase is inherited by older versions.
                            '("git-svn" "git-cvsimport" "git-archimport"
                              "git-cvsserver" "git-request-pull"
                              "git-add--interactive" "git-cvsexportcommit"
-- 
2.40.0