challenge: When using '--diff', do not attempt to chmod symlinks.

This is a followup to 2a2856d5cc.

* guix/scripts/challenge.scm (make-directory-writable): Do not call
'make-file-writable' on symlinks.
This commit is contained in:
Ludovic Courtès 2022-06-15 11:02:54 +02:00
parent 1cde647cc0
commit 5d4b189120
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -316,7 +316,8 @@ (define (make-directory-writable directory)
'chmod -R +w DIRECTORY'."
(file-system-fold (const #t)
(lambda (file stat _) ;leaf
(make-file-writable file))
(unless (eq? 'symlink (stat:type stat))
(make-file-writable file)))
(lambda (directory stat _) ;down
(make-file-writable directory))
(const #t) ;up