pack: Allow for "-S /opt/foo=".

Reported by Andy Wingo.

* guix/scripts/pack.scm (%options): Use 'string-split' instead of
'string-tokenize'.
This commit is contained in:
Ludovic Courtès 2017-03-16 22:46:43 +01:00
parent 9e84ea3673
commit db3f2b61ad
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 4 additions and 3 deletions

View File

@ -283,9 +283,10 @@ with COMPRESSOR. It can be passed to 'docker load'."
result)))
(option '(#\S "symlink") #t #f
(lambda (opt name arg result)
(match (string-tokenize arg
(char-set-complement
(char-set #\=)))
;; Note: Using 'string-split' allows us to handle empty
;; TARGET (as in "/opt/guile=", meaning that /opt/guile is
;; a symlink to the profile) correctly.
(match (string-split arg (char-set #\=))
((source target)
(let ((symlinks (assoc-ref result 'symlinks)))
(alist-cons 'symlinks