JJakub Kądziołka wrote on 3 Jan 2021 19:32
(address . firstname.lastname@example.org)
* guix/scripts/package.scm (warn-about-guix-in-profile): New procedure.
(process-actions): Call WARN-ABOUT-GUIX-IN-PROFILE before executing
- Is this the right place to put warn-about-guix-in-profile?
- The warning message seems to be hard-wrapped. Is this the right
- Do we want to make this configurable? Some other warnings are, but in
those cases it is the threshold that gets configured. In this case,
there is no threshold.
guix/scripts/package.scm | 11 +++++++++++
1 file changed, 11 insertions(+)
Toggle diff (38 lines)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 6faf2adb7a..bc42bd7d84 100644
@@ -9,6 +9,7 @@
;;; Copyright © 2019 Tobias Geerinckx-Rice <email@example.com>
;;; Copyright © 2020 Ricardo Wurmus <firstname.lastname@example.org>
;;; Copyright © 2020 Simon Tournier <email@example.com>
+;;; Copyright © 2021 Jakub Kądziołka <firstname.lastname@example.org>
;;; This file is part of GNU Guix.
@@ -863,6 +864,15 @@ processed, #f otherwise."
(switch-generation . ,switch-generation-action)
(delete-generations . ,delete-generations-action)))
+(define (warn-about-guix-in-profile manifest)
+ "Emit a warning if MANIFEST contains a 'guix' package."
+ (when (manifest-installed? manifest
+ (name "guix")))
+ (warning (G_ "Installing the 'guix' package in a user profile is not recommended,
+as it will conflict with the installation managed by 'guix pull'. Consider running
+'guix package -r guix'.\n"))))
(define (process-actions store opts)
"Process any install/remove/upgrade action from OPTS."
@@ -928,6 +938,7 @@ processed, #f otherwise."
+ (warn-about-guix-in-profile new)
(unless (manifest-transaction-null? trans)
;; When '--manifest' is used, display information about TRANS as if we