diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 10a6ec05f1..a1b73e6316 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -596,6 +596,12 @@ (define (latest-gnu-release package) This method does not rely on FTP access at all; instead, it browses the file list available from %GNU-FILE-LIST-URI over HTTP(S)." + (define archive-type + (package-archive-type package)) + + (define (better-tarball? tarball1 tarball2) + (string=? (file-extension tarball1) archive-type)) + (let-values (((server directory) (ftp-server/directory package)) ((name) @@ -626,7 +632,9 @@ (define (latest-gnu-release package) (string-append "mirror://gnu/" (string-drop file (string-length "/gnu/")))) - tarballs)) + ;; Sort so that the tarball with the same compression + ;; format as currently used in PACKAGE comes first. + (sort tarballs better-tarball?))) (signature-urls (map (cut string-append <> ".sig") urls))))) (() #f)))))