diff options
author | Leo Famulari <leo@famulari.name> | 2018-01-03 14:18:01 -0500 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2018-01-03 14:18:01 -0500 |
commit | 4ed41f472bd2be465b371abf6760e8713ec59f92 (patch) | |
tree | e44eec8362c732ae3c5f1e773fe7797d3e69cc5f /nix/scripts/list-runtime-roots.in | |
parent | 9d7d8e71810388985edbc0cb6e6e46e6038ae830 (diff) | |
parent | 0c84e8679c6d41e46416cfe97d63221a64beee55 (diff) | |
download | guix-4ed41f472bd2be465b371abf6760e8713ec59f92.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'nix/scripts/list-runtime-roots.in')
-rw-r--r-- | nix/scripts/list-runtime-roots.in | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nix/scripts/list-runtime-roots.in b/nix/scripts/list-runtime-roots.in index 48a07edf5f..5f2660fb5e 100644 --- a/nix/scripts/list-runtime-roots.in +++ b/nix/scripts/list-runtime-roots.in @@ -130,12 +130,13 @@ or the empty list." (< (string->number a) (string->number b)))))) (define canonicalize-store-item - (let ((prefix (+ 1 (string-length %store-directory)))) + (let* ((store (string-append %store-directory "/")) + (prefix (string-length store))) (lambda (file) "Return #f if FILE is not a store item; otherwise, return the store file name without any sub-directory components." - (and (string-prefix? %store-directory file) - (string-append %store-directory "/" + (and (string-prefix? store file) + (string-append store (let ((base (string-drop file prefix))) (match (string-index base #\/) (#f base) |