diff options
author | Ludovic Courtès <ludo@gnu.org> | 2017-06-24 18:58:44 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-06-24 23:28:23 +0200 |
commit | 4c228f9e54180ffe733957fee586fc7179f64e28 (patch) | |
tree | 2a6d007a434a759e9eaa122fc4d1fee1f87911f8 /guix/scripts | |
parent | 048175e2ce913067b4610d5eeb5384cf78c44665 (diff) | |
download | gnu-guix-4c228f9e54180ffe733957fee586fc7179f64e28.tar gnu-guix-4c228f9e54180ffe733957fee586fc7179f64e28.tar.gz |
refresh: Be more verbose when passed an explicit package list.
* guix/scripts/refresh.scm (check-for-package-update): Use
'version-compare' instead of 'version>?'. When WARN? is true, print
something for the '=' and '<' cases.
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/refresh.scm | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index dd93e7d3e7..5add64d8e8 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -253,15 +253,32 @@ downloaded and authenticated; not updating~%") WARN? is true and no updater exists for PACKAGE, print a warning." (match (package-latest-release package updaters) ((? upstream-source? source) - (when (version>? (upstream-source-version source) - (package-version package)) - (let ((loc (or (package-field-location package 'version) - (package-location package)))) - (format (current-error-port) - (G_ "~a: ~a would be upgraded from ~a to ~a~%") - (location->string loc) - (package-name package) (package-version package) - (upstream-source-version source))))) + (let ((loc (or (package-field-location package 'version) + (package-location package)))) + (case (version-compare (upstream-source-version source) + (package-version package)) + ((>) + (format (current-error-port) + (G_ "~a: ~a would be upgraded from ~a to ~a~%") + (location->string loc) + (package-name package) (package-version package) + (upstream-source-version source))) + ((=) + (when warn? + (format (current-error-port) + (G_ "~a: info: ~a is already the latest version of ~a~%") + (location->string loc) + (package-version package) + (package-name package)))) + (else + (when warn? + (format (current-error-port) + (G_ "~a: warning: ~a is greater than \ +the latest known version of ~a (~a)~%") + (location->string loc) + (package-version package) + (package-name package) + (upstream-source-version source))))))) (#f (when warn? (warn-no-updater package))))) |