[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/174: refresh: Sort update specs by package location.
From: |
guix-commits |
Subject: |
01/174: refresh: Sort update specs by package location. |
Date: |
Wed, 12 Jul 2023 08:30:37 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit b43841c124d15eaecc41b3928f08a26dbd5c653a
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Jul 10 20:37:55 2023 +0200
refresh: Sort update specs by package location.
Fixes <https://issues.guix.gnu.org/64358>.
* guix/scripts/refresh.scm (guix-refresh): Sort update specs by location
from
bottom to top before updating packages.
---
guix/scripts/refresh.scm | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 9676271542..f5cb18af22 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -6,7 +6,7 @@
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2019, 2023 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
@@ -589,16 +589,27 @@ all are dependent packages: ~{~a~^ ~}~%")
(or (assoc-ref opts 'keyring)
(string-append (config-directory)
"/upstream/trustedkeys.kbx"))))
- (for-each
- (lambda (update)
- (update-package store
- (update-spec-package update)
- (update-spec-version update)
- updaters
- #:key-server (%openpgp-key-server)
- #:key-download key-download
- #:warn? warn?))
- update-specs)
+ (let* ((spec-line
+ (compose location->string
+ package-location
+ update-spec-package))
+ ;; Sort the specs so that we update packages from the
+ ;; bottom of the file to the top. This way we can be
+ ;; sure that the package locations are always correct
+ ;; and never shifted due to previous edits.
+ (sorted-update-specs
+ (sort update-specs
+ (lambda (a b) (string> (spec-line a) (spec-line
b))))))
+ (for-each
+ (lambda (update)
+ (update-package store
+ (update-spec-package update)
+ (update-spec-version update)
+ updaters
+ #:key-server (%openpgp-key-server)
+ #:key-download key-download
+ #:warn? warn?))
+ sorted-update-specs))
(return #t)))
(else
(for-each (cut check-for-package-update <> updaters
- branch master updated (4a027d2b0e -> f2f27c4952), guix-commits, 2023/07/12
- 05/174: gnu: r-plotly: Update to 4.10.2., guix-commits, 2023/07/12
- 02/174: gnu: r-bslib: Update to 0.5.0., guix-commits, 2023/07/12
- 01/174: refresh: Sort update specs by package location.,
guix-commits <=
- 08/174: gnu: r-lme4: Update to 1.1-34., guix-commits, 2023/07/12
- 10/174: gnu: r-gprofiler2: Update to 0.2.2., guix-commits, 2023/07/12
- 09/174: gnu: r-v8: Update to 4.3.2., guix-commits, 2023/07/12
- 12/174: gnu: r-gmp: Update to 0.7-2., guix-commits, 2023/07/12
- 04/174: gnu: r-opencpu: Update to 2.2.10., guix-commits, 2023/07/12
- 14/174: gnu: r-leidenalg: Update to 1.1.0., guix-commits, 2023/07/12
- 03/174: gnu: r-rgl: Update to 1.2.1., guix-commits, 2023/07/12
- 06/174: import/cran: Add one more package name transformation., guix-commits, 2023/07/12
- 07/174: gnu: r-digest: Update to 0.6.33., guix-commits, 2023/07/12
- 11/174: gnu: r-haven: Update to 2.5.3., guix-commits, 2023/07/12