locate: Request writable db for --clear.

Fixes <https://issues.guix.gnu.org/76141>.

* guix/scripts/locate.scm (guix-locate): Use writable db when --clear is given.

Change-Id: I2e4e945cef022b08dd6af4c252e67c2a4d5bf38c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Yelninei 2025-04-13 09:08:39 +00:00 committed by Ludovic Courtès
parent c2af548798
commit c9ac6c8715
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -624,7 +624,8 @@ Locate FILE and return the list of packages that contain it.\n"))
(clear? (assoc-ref opts 'clear?)) (clear? (assoc-ref opts 'clear?))
(update? (assoc-ref opts 'update?)) (update? (assoc-ref opts 'update?))
(glob? (assoc-ref opts 'glob?)) (glob? (assoc-ref opts 'glob?))
(database ((assoc-ref opts 'database) update? age-update-threshold)) (database ((assoc-ref opts 'database)
(or clear? update?) age-update-threshold))
(method (assoc-ref opts 'method)) (method (assoc-ref opts 'method))
(files (reverse (filter-map (match-lambda (files (reverse (filter-map (match-lambda
(('argument . arg) arg) (('argument . arg) arg)