me
/
guix
Archived
1
0
Fork 0

refresh: Support non-tarball sources.

* guix/scripts/refresh.scm (update-package): Use 'file-hash*' instead of
'port-sha256'.  Rename TARBALL to OUTPUT.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
master
Sarah Morgensen 2022-01-05 14:07:49 +00:00 committed by Ludovic Courtès
parent b4c677c2ed
commit 1c32b4c965
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 5 additions and 5 deletions

View File

@ -8,6 +8,7 @@
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com> ;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -26,7 +27,6 @@
(define-module (guix scripts refresh) (define-module (guix scripts refresh)
#:use-module (guix ui) #:use-module (guix ui)
#:use-module (gcrypt hash)
#:use-module (guix scripts) #:use-module (guix scripts)
#:use-module ((guix scripts build) #:select (%standard-build-options)) #:use-module ((guix scripts build) #:select (%standard-build-options))
#:use-module (guix store) #:use-module (guix store)
@ -38,6 +38,7 @@
#:use-module (guix scripts graph) #:use-module (guix scripts graph)
#:use-module (guix monads) #:use-module (guix monads)
#:use-module (guix gnupg) #:use-module (guix gnupg)
#:use-module (guix hash)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module ((gnu packages commencement) #:select (%final-inputs)) #:use-module ((gnu packages commencement) #:select (%final-inputs))
#:use-module (ice-9 match) #:use-module (ice-9 match)
@ -314,14 +315,14 @@ KEY-DOWNLOAD specifies a download policy for missing OpenPGP keys; allowed
values: 'interactive' (default), 'always', and 'never'. When WARN? is true, values: 'interactive' (default), 'always', and 'never'. When WARN? is true,
warn about packages that have no matching updater." warn about packages that have no matching updater."
(if (lookup-updater package updaters) (if (lookup-updater package updaters)
(let-values (((version tarball source) (let-values (((version output source)
(package-update store package updaters (package-update store package updaters
#:key-download key-download)) #:key-download key-download))
((loc) ((loc)
(or (package-field-location package 'version) (or (package-field-location package 'version)
(package-location package)))) (package-location package))))
(when version (when version
(if (and=> tarball file-exists?) (if (and=> output file-exists?)
(begin (begin
(info loc (info loc
(G_ "~a: updating from version ~a to version ~a...~%") (G_ "~a: updating from version ~a to version ~a...~%")
@ -363,8 +364,7 @@ warn about packages that have no matching updater."
(info loc (G_ "~a: consider removing this propagated input: ~a~%") (info loc (G_ "~a: consider removing this propagated input: ~a~%")
name change-name)))) name change-name))))
(upstream-source-input-changes source)) (upstream-source-input-changes source))
(let ((hash (call-with-input-file tarball (let ((hash (file-hash* output)))
port-sha256)))
(update-package-source package source hash))) (update-package-source package source hash)))
(warning (G_ "~a: version ~a could not be \ (warning (G_ "~a: version ~a could not be \
downloaded and authenticated; not updating~%") downloaded and authenticated; not updating~%")