From 3fadea42548389141e84a8481d271ac7280de7bc Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 17 May 2025 13:06:32 +0900 Subject: [PATCH] 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 --- guix/gnu-maintenance.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 7f7fafd5696..dcb7f3b61a5 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -801,7 +801,9 @@ list available from %GNU-FILE-LIST-URI over HTTP(S)." (find (cut version-prefix? version <>) (force versions))) version - (first (force versions)))) + (match (force versions) + ((? null?) #f) + (lst (first lst))))) ;; Find tarballs matching this version. (tarballs (filter (lambda (file) (string=? version (tarball->version file)))