[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/09: locate: Accept ‘--clear’ without additional arguments.
From: |
guix-commits |
Subject: |
03/09: locate: Accept ‘--clear’ without additional arguments. |
Date: |
Wed, 15 Nov 2023 12:33:41 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 69d9a020949c77c77b449c1faf04397b95eef5b7
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed Nov 15 18:12:24 2023 +0100
locate: Accept ‘--clear’ without additional arguments.
Fixes a bug whereby ‘guix locate --clear’ would end with the “no files
to search for” error.
Fixes <https://issues.guix.gnu.org/66799>.
* 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 <m.kalandyk@outlook.com>
Change-Id: Ib8fa125c18481d7f5408bd89df9503713527641d
---
guix/scripts/locate.scm | 2 +-
tests/guix-locate.sh | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
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'~%"
diff --git a/tests/guix-locate.sh b/tests/guix-locate.sh
index 43f8ba53b0..de0ea5769d 100755
--- a/tests/guix-locate.sh
+++ b/tests/guix-locate.sh
@@ -70,3 +70,9 @@ then
$cmd_store guile | grep "$(guix build guile-bootstrap)/bin/guile"
$cmd_store boot-9.scm | grep ^guile-bootstrap
fi
+
+# The command below is an error: "no files to search for"...
+guix locate && false
+
+# ... but this one is fine.
+guix locate --clear
- branch master updated (7e6580670b -> d987b75618), guix-commits, 2023/11/15
- 02/09: gnu: musescore: Update to 4.1.1., guix-commits, 2023/11/15
- 06/09: gnu: tor: Update to 0.4.8.9 [security fixes]., guix-commits, 2023/11/15
- 01/09: gnu: psm2: Update Git tag name., guix-commits, 2023/11/15
- 07/09: gnu: python-types-pytz: Update to 2023.3.1.1., guix-commits, 2023/11/15
- 03/09: locate: Accept ‘--clear’ without additional arguments.,
guix-commits <=
- 04/09: build-system/guile: Add target-guile-scm+go procedure., guix-commits, 2023/11/15
- 05/09: gnu: whoogle-search: Update to 0.8.3., guix-commits, 2023/11/15
- 08/09: gnu: Add python-tdda., guix-commits, 2023/11/15
- 09/09: gnu: Add monsterid., guix-commits, 2023/11/15