diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-10-21 11:11:25 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-21 14:43:34 +0200 |
commit | 0a7c5a09fe74d93c473b0f07ee096c2e6896910e (patch) | |
tree | fc0bbff1aec5a81b71c235c5bae2a11894b0abe0 /guix/scripts | |
parent | cbaf0f11ddbe4228ddd3c81af18702ac86ae361c (diff) | |
download | gnu-guix-0a7c5a09fe74d93c473b0f07ee096c2e6896910e.tar gnu-guix-0a7c5a09fe74d93c473b0f07ee096c2e6896910e.tar.gz |
gnu-maintenance: Generalize, leading to (guix upstream).
* guix/gnu-maintenance.scm (<gnu-release>): Remove.
(coalesce-releases): Move to upstream.scm. Rename to
'coalesce-sources'; adjust callers.
(releases, latest-release): Return <upstream-source> objects instead
of <gnu-release> objects.
(latest-release*, non-emacs-gnu-package?): New procedures.
(gnu-release-archive-types): Remove.
(%gnu-updater): New variable.
(package-update-path, download-tarball, package-update,
update-package-source): Move to...
* guix/upstream.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
* po/guix/POTFILES.in: Replace gnu-maintenance.scm with upstream.scm.
* guix/scripts/refresh.scm (%updaters): New variable.
(update-package): Adjust to new 'package-update' interface.
(guix-refresh): Adjust to new 'package-update-path'. Remove
'false-if-exception' around it.
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/refresh.scm | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index 097059e372..8d4f26e3b0 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -25,7 +25,8 @@ #:use-module (guix store) #:use-module (guix utils) #:use-module (guix packages) - #:use-module (guix gnu-maintenance) + #:use-module (guix upstream) + #:use-module ((guix gnu-maintenance) #:select (%gnu-updater)) #:use-module (guix gnupg) #:use-module (gnu packages) #:use-module ((gnu packages commencement) #:select (%final-inputs)) @@ -124,6 +125,15 @@ specified with `--select'.\n")) (newline) (show-bug-report-information)) + +;;; +;;; Updates. +;;; + +(define %updaters + ;; List of "updaters" used by default. + (list %gnu-updater)) + (define* (update-package store package #:key (key-download 'interactive)) "Update the source file that defines PACKAGE with the new version. KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed @@ -131,12 +141,12 @@ values: 'interactive' (default), 'always', and 'never'." (let-values (((version tarball) (catch #t (lambda () - (package-update store package #:key-download key-download)) + (package-update store package %updaters + #:key-download key-download)) (lambda _ (values #f #f)))) ((loc) - (or (package-field-location package - 'version) + (or (package-field-location package 'version) (package-location package)))) (when version (if (and=> tarball file-exists?) @@ -153,7 +163,6 @@ values: 'interactive' (default), 'always', and 'never'." downloaded and authenticated; not updating~%") (package-name package) version))))) - ;;; ;;; Entry point. @@ -262,14 +271,14 @@ dependent packages are rebuilt: ~{~a~^ ~}~%" packages)))) (else (for-each (lambda (package) - (match (false-if-exception (package-update-path package)) - ((new-version . directory) + (match (package-update-path package %updaters) + ((? upstream-source? source) (let ((loc (or (package-field-location package 'version) (package-location package)))) (format (current-error-port) (_ "~a: ~a would be upgraded from ~a to ~a~%") (location->string loc) (package-name package) (package-version package) - new-version))) - (_ #f))) + (upstream-source-version source)))) + (#f #f))) packages)))))) |