import: Guard against potential type error.

The import-gnu-release could crash with a "Wrong type (expecting pair): ()"
error, as seen when attempting to recursively refresh a package, e.g.:

  $ guix refresh -r xdg-desktop-portal-gnome

It would crash on attempting to refresh 'bash-static'.

* guix/gnu-maintenance.scm (import-gnu-release): Guard against a potentially
empty VERSIONS list.

Change-Id: Ib4edb4b721e6053b09ef144a1b16fe23b35649b0
This commit is contained in:
Maxim Cournoyer 2025-05-17 13:06:32 +09:00
parent 6465931bbc
commit 3fadea4254
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -801,7 +801,9 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)."
(find (cut version-prefix? version <>) (find (cut version-prefix? version <>)
(force versions))) (force versions)))
version version
(first (force versions)))) (match (force versions)
((? null?) #f)
(lst (first lst)))))
;; Find tarballs matching this version. ;; Find tarballs matching this version.
(tarballs (filter (lambda (file) (tarballs (filter (lambda (file)
(string=? version (tarball->version file))) (string=? version (tarball->version file)))