diff options
author | ( <paren@disroot.org> | 2022-10-17 17:50:57 +0100 |
---|---|---|
committer | Guix Patches Tester <> | 2022-10-17 17:58:35 +0100 |
commit | 0a17061ce379bf36a2ec4346f356beef27624b23 (patch) | |
tree | ca5394b7c71fe6c763a831502d5eb6ccbb93d9d9 | |
parent | 094b357783ae92fc5652f8a8c61e0b96b342d09d (diff) | |
download | guix-patches-0a17061ce379bf36a2ec4346f356beef27624b23.tar guix-patches-0a17061ce379bf36a2ec4346f356beef27624b23.tar.gz |
scripts: package: Forbid installation of the guix package.issue-58583
* guix/scripts/package.scm (package->manifest-entry*): Fail if the
package to be installed is guix from the default channel.
-rw-r--r-- | guix/scripts/package.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 7ba2661bbb..9f023ea7b5 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com> ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz> ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org> +;;; Copyright © 2022 ( <paren@disroot.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -699,7 +700,14 @@ upgrading, #f otherwise." (define (package->manifest-entry* package output) "Like 'package->manifest-entry', but attach PACKAGE provenance meta-data to -the resulting manifest entry." +the resulting manifest entry, and report an error if PACKAGE is the 'guix' +package from the default channel." + (when (and (string=? (package-name package) "guix") + (string-prefix? "gnu/" (location-file + (package-location package)))) + (report-error (G_ "the 'guix' package should not be installed~%")) + (display-hint (G_ "use 'guix pull' to fetch the latest Guix revision")) + (exit 1)) (manifest-entry-with-provenance (package->manifest-entry package output))) |