guix gc: '-d' does not attempt to delete non-user-owned roots.
* guix/scripts/gc.scm (guix-gc)[delete-generations]: Limit to user-owned roots, unless we're running as root.
This commit is contained in:
parent
c2f6f4e500
commit
c1df77e215
|
@ -245,7 +245,11 @@ is deprecated; use '-D'~%"))
|
||||||
(define (delete-generations store pattern)
|
(define (delete-generations store pattern)
|
||||||
;; Delete the generations matching PATTERN of all the user's profiles.
|
;; Delete the generations matching PATTERN of all the user's profiles.
|
||||||
(let ((profiles (delete-duplicates
|
(let ((profiles (delete-duplicates
|
||||||
(filter-map generation-profile (gc-roots)))))
|
(filter-map (lambda (root)
|
||||||
|
(and (or (zero? (getuid))
|
||||||
|
(user-owned? root))
|
||||||
|
(generation-profile root)))
|
||||||
|
(gc-roots)))))
|
||||||
(for-each (lambda (profile)
|
(for-each (lambda (profile)
|
||||||
(delete-old-generations store profile pattern))
|
(delete-old-generations store profile pattern))
|
||||||
profiles)))
|
profiles)))
|
||||||
|
|
Loading…
Reference in New Issue