guix_mirror_bot pushed a commit to branch master
in repository guix.

commit e92be23837c8b0c7616aee8d8766f4d2d6a403dd
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Mon Sep 15 16:33:07 2025 +0900

    scripts: Honor --target-version in every situation.
    
    * guix/scripts/refresh.scm (options->update-specs): Always honor
    --target-version.
    * doc/guix.texi (Invoking guix refresh): Add an example showing how this can
    be useful.
    
    Change-Id: I55f98c88f4b583f65dd85a6d3573f9bc87a1dead
---
 doc/guix.texi            | 8 ++++++++
 guix/scripts/refresh.scm | 5 ++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index cad210d293..86b6aec2bb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -15237,6 +15237,14 @@ gnu/packages/qt.scm:2070:13: qtquickcontrols2 would be 
upgraded from 5.15.8 to 5
 @dots{}
 @end example
 
+@example
+$ guix refresh -s module:kde-plasma --target-version=6.3.6
+[@dots{}] plasma-systemmonitor would be upgraded from 6.3.4 to 6.3.6
+[@dots{}] plasma-workspace-wallpapers would be upgraded from 6.3.4 to 6.3.6
+[@dots{}] plasma-browser-integration would be upgraded from 6.3.4 to 6.3.6
+@dots{}
+@end example
+
 @cindex partial target version, guix refresh
 The @option{--target-version} option accepts partial version prefixes,
 which can be useful to update to the latest major or major-minor
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index a302960da3..65654863cc 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -306,7 +306,10 @@ update would trigger a complete rebuild."
                           (list (resolve-interface mod)))
                          (_ (all-modules (%package-module-path)
                                          #:warn
-                                         warn-about-load-error)))))
+                                         warn-about-load-error))))
+             (update-spec (if target-version
+                              (cut update-spec <> target-version #t)
+                              update-spec)))
          (map update-spec
               (fold-packages (lambda (package result)
                                (if (select? package)

Reply via email to