[bug#63092,v3,2/2] gnu: git-minimal: Check files exist before delete.
Commit Message
* 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(-)
Comments
Hi Greg,
Greg Hogan <code@greghogan.com> skribis:
> * 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.
[...]
> + (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.
The ‘file-exists?’ and ‘delete-file’ calls are passed different file
names. Also, this won’t prevent a rebuild of ‘git-minimal/pinned’.
So I went with a different approach to achieve that goal. Applied now.
Thanks!
Ludo’.
@@ -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"