mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
profiles: Raise an error for unmatched patterns.
Previously, "guix package -r something-not-installed" would silently complete. Now an error is raised. * guix/profiles.scm (&unmatched-pattern-error): New condition type. (manifest-matching-entries): Rewrite to raise an error when one of PATTERNS is not matched. * guix/ui.scm (call-with-error-handling): Handle 'unmatched-pattern-error?'. * tests/guix-package.sh: Add test. * tests/profiles.scm ("manifest-matching-entries"): Don't try to remove unmatched pattern. ("manifest-matching-entries, no match"): New test. ("manifest-transaction-effects"): Remove 'remove' field.
This commit is contained in:
parent
89ea6252b6
commit
487cbb0164
4 changed files with 49 additions and 17 deletions
|
@ -643,6 +643,14 @@ or remove one of them from the profile.")
|
|||
(leave (G_ "generation ~a of profile '~a' does not exist~%")
|
||||
(missing-generation-error-generation c)
|
||||
(profile-error-profile c)))
|
||||
((unmatched-pattern-error? c)
|
||||
(let ((pattern (unmatched-pattern-error-pattern c)))
|
||||
(leave (G_ "package '~a~@[@~a~]~@[:~a~]' not found in profile~%")
|
||||
(manifest-pattern-name pattern)
|
||||
(manifest-pattern-version pattern)
|
||||
(match (manifest-pattern-output pattern)
|
||||
("out" #f)
|
||||
(output output)))))
|
||||
((profile-collision-error? c)
|
||||
(let ((entry (profile-collision-error-entry c))
|
||||
(conflict (profile-collision-error-conflict c)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue