diff options
author | Leo Famulari <leo@famulari.name> | 2021-02-09 15:09:43 -0500 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2021-02-09 15:09:43 -0500 |
commit | 388bd35dd0df2d231bc2cce3746d7d5fd15df23a (patch) | |
tree | 82e7cc45b8279f83439214c7c79dc7161ffda94d /guix/store.scm | |
parent | f1c7c2f697877fcb68b53ea062ff8a88f274a2fe (diff) | |
parent | d00380b0077b0df2a0b790bb115d07c1533b8863 (diff) | |
download | guix-patches-388bd35dd0df2d231bc2cce3746d7d5fd15df23a.tar guix-patches-388bd35dd0df2d231bc2cce3746d7d5fd15df23a.tar.gz |
Merge branch 'master' into staging-next
Diffstat (limited to 'guix/store.scm')
-rw-r--r-- | guix/store.scm | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/guix/store.scm b/guix/store.scm index 4da39971b5..81bb9eb847 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org> ;;; Copyright © 2019, 2020 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2020 Florian Pelz <pelzflorian@pelzflorian.de> @@ -114,6 +114,7 @@ query-failed-paths clear-failed-paths ensure-path + find-roots add-temp-root add-indirect-root add-permanent-root @@ -340,7 +341,8 @@ (write-string (bytevector->base16-string arg) p)))) (define-syntax read-arg - (syntax-rules (integer boolean string store-path store-path-list string-list + (syntax-rules (integer boolean string store-path + store-path-list string-list string-pairs substitutable-path-list path-info base16) ((_ integer p) (read-int p)) @@ -354,6 +356,8 @@ (read-store-path-list p)) ((_ string-list p) (read-string-list p)) + ((_ string-pairs p) + (read-string-pairs p)) ((_ substitutable-path-list p) (read-substitutable-path-list p)) ((_ path-info p) @@ -1404,6 +1408,15 @@ running a substitute. As a GC root is not created by the daemon, you may want to call ADD-TEMP-ROOT on that store path." boolean) +(define-operation (find-roots) + "Return a list of root/target pairs: for each pair, the first element is the +GC root file name and the second element is its target in the store. + +When talking to a local daemon, this operation is equivalent to the 'gc-roots' +procedure in (guix store roots), except that the 'find-roots' excludes +potential roots that do not point to store items." + string-pairs) + (define-operation (add-temp-root (store-path path)) "Make PATH a temporary root for the duration of the current session. Return #t." @@ -2160,10 +2173,12 @@ valid inputs." (define (store-path-hash-part path) "Return the hash part of PATH as a base32 string, or #f if PATH is not a syntactically valid store path." - (let* ((base (store-path-base path)) - (hash (string-take base 32))) - (and (string-every %nix-base32-charset hash) - hash))) + (match (store-path-base path) + (#f #f) + (base + (let ((hash (string-take base 32))) + (and (string-every %nix-base32-charset hash) + hash))))) (define (derivation-log-file drv) "Return the build log file for DRV, a derivation file name, or #f if it |