mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
refresh: Honor user-provided target version and report downgrades.
Previously, 'guix refresh guile=3.0.0' would print:
3.0.8 is already the latest version of guile
With this change, it prints:
guile would be downgraded from 3.0.8 to 3.0.0
This is a followup to 8aeccc6240
.
* guix/scripts/refresh.scm (check-for-package-update): Take an
<update-spec> instead of a <package>. Report downgrades as such when
UPDATE-SPEC specifies a target version.
(guix-refresh): Adjust caller.
This commit is contained in:
parent
a330bfdf5b
commit
11235dd85a
1 changed files with 31 additions and 15 deletions
|
@ -382,10 +382,15 @@ downloaded and authenticated; not updating~%")
|
||||||
(when warn?
|
(when warn?
|
||||||
(warn-no-updater package))))
|
(warn-no-updater package))))
|
||||||
|
|
||||||
(define* (check-for-package-update package updaters #:key warn?)
|
(define* (check-for-package-update update-spec updaters #:key warn?)
|
||||||
"Check whether an update is available for PACKAGE and print a message. When
|
"Check whether UPDATE-SPEC is feasible, and print a message.
|
||||||
WARN? is true and no updater exists for PACKAGE, print a warning."
|
When WARN? is true and no updater exists for PACKAGE, print a warning."
|
||||||
(match (package-latest-release package updaters)
|
(define package
|
||||||
|
(update-spec-package update-spec))
|
||||||
|
|
||||||
|
(match (package-latest-release package updaters
|
||||||
|
#:version
|
||||||
|
(update-spec-version update-spec))
|
||||||
((? upstream-source? source)
|
((? upstream-source? source)
|
||||||
(let ((loc (or (package-field-location package 'version)
|
(let ((loc (or (package-field-location package 'version)
|
||||||
(package-location package))))
|
(package-location package))))
|
||||||
|
@ -403,23 +408,34 @@ WARN? is true and no updater exists for PACKAGE, print a warning."
|
||||||
(package-version package)
|
(package-version package)
|
||||||
(package-name package))))
|
(package-name package))))
|
||||||
(else
|
(else
|
||||||
(when warn?
|
(if (update-spec-version update-spec)
|
||||||
(warning loc
|
(info loc
|
||||||
(G_ "~a is greater than \
|
(G_ "~a would be downgraded from ~a to ~a~%")
|
||||||
|
(package-name package)
|
||||||
|
(package-version package)
|
||||||
|
(upstream-source-version source))
|
||||||
|
(when warn?
|
||||||
|
(warning loc
|
||||||
|
(G_ "~a is greater than \
|
||||||
the latest known version of ~a (~a)~%")
|
the latest known version of ~a (~a)~%")
|
||||||
(package-version package)
|
(package-version package)
|
||||||
(package-name package)
|
(package-name package)
|
||||||
(upstream-source-version source)))))))
|
(upstream-source-version source))))))))
|
||||||
(#f
|
(#f
|
||||||
(when warn?
|
(when warn?
|
||||||
;; Distinguish between "no updater" and "failing updater."
|
;; Distinguish between "no updater" and "failing updater."
|
||||||
(match (lookup-updater package updaters)
|
(match (lookup-updater package updaters)
|
||||||
((? upstream-updater? updater)
|
((? upstream-updater? updater)
|
||||||
(warning (package-location package)
|
(if (update-spec-version update-spec)
|
||||||
(G_ "'~a' updater failed to determine available \
|
(warning (G_ "'~a' updater failed to find version ~a of '~a'~%")
|
||||||
|
(upstream-updater-name updater)
|
||||||
|
(update-spec-version update-spec)
|
||||||
|
(package-name package))
|
||||||
|
(warning (package-location package)
|
||||||
|
(G_ "'~a' updater failed to determine available \
|
||||||
releases for ~a~%")
|
releases for ~a~%")
|
||||||
(upstream-updater-name updater)
|
(upstream-updater-name updater)
|
||||||
(package-name package)))
|
(package-name package))))
|
||||||
(#f
|
(#f
|
||||||
(warn-no-updater package)))))))
|
(warn-no-updater package)))))))
|
||||||
|
|
||||||
|
@ -591,5 +607,5 @@ all are dependent packages: ~{~a~^ ~}~%")
|
||||||
(else
|
(else
|
||||||
(for-each (cut check-for-package-update <> updaters
|
(for-each (cut check-for-package-update <> updaters
|
||||||
#:warn? warn?)
|
#:warn? warn?)
|
||||||
(map update-spec-package update-specs))
|
update-specs)
|
||||||
(return #t)))))))))
|
(return #t)))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue