diff options
author | Tobias Geerinckx-Rice <me@tobias.gr> | 2020-11-18 18:07:57 +0100 |
---|---|---|
committer | Tobias Geerinckx-Rice <me@tobias.gr> | 2020-11-18 18:07:57 +0100 |
commit | a45f8223e1a05ac3583708061209a1380b8a9d40 (patch) | |
tree | 467eb1de1bcae7bc0d300fff021783bc4b455b53 /gnu/services/shepherd.scm | |
parent | b4b08ee53bb11016a7471e20a940f8e343a3b61d (diff) | |
parent | 207c3c594e22b678ddcea8ebc78f19b839612187 (diff) |
Merge remote-tracking branch 'upstream/version-1.2.0'
Diffstat (limited to 'gnu/services/shepherd.scm')
-rw-r--r-- | gnu/services/shepherd.scm | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm index e14ceca231c..1faeb350dfb 100644 --- a/gnu/services/shepherd.scm +++ b/gnu/services/shepherd.scm @@ -224,16 +224,21 @@ which is not provided by any service") (for-each assert-satisfied-requirements services)) +(define %store-characters + ;; Valid store characters; see 'checkStoreName' in the daemon. + (string->char-set + "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+-._?=")) + (define (shepherd-service-file-name service) "Return the file name where the initialization code for SERVICE is to be stored." (let ((provisions (string-join (map symbol->string (shepherd-service-provision service))))) (string-append "shepherd-" - (string-map (match-lambda - (#\/ #\-) - (#\ #\-) - (chr chr)) + (string-map (lambda (chr) + (if (char-set-contains? %store-characters chr) + chr + #\-)) provisions) ".scm"))) |