From 69d9a020949c77c77b449c1faf04397b95eef5b7 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 15 Nov 2023 18:12:24 +0100 Subject: locate: Accept ‘--clear’ without additional arguments. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a bug whereby ‘guix locate --clear’ would end with the “no files to search for” error. Fixes . * guix/scripts/locate.scm (guix-locate): Do not emit “no files to search for” error when 'clear? is set in OPTS. * tests/guix-locate.sh: Test it. Reported-by: Maciej Kalandyk Change-Id: Ib8fa125c18481d7f5408bd89df9503713527641d --- guix/scripts/locate.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix') diff --git a/guix/scripts/locate.scm b/guix/scripts/locate.scm index ae64f46896..92af3509bf 100644 --- a/guix/scripts/locate.scm +++ b/guix/scripts/locate.scm @@ -657,7 +657,7 @@ Locate FILE and return the list of packages that contain it.\n")) files))) (() (if (null? files) - (unless update? + (unless (or update? (assoc-ref opts 'clear?)) (leave (G_ "no files to search for~%"))) (leave (N_ "file~{ '~a'~} not found in database '~a'~%" "files~{ '~a'~} not found in database '~a'~%" -- cgit v1.2.3