GNU bug report logs - #58583
[PATCH 0/1] scripts: package: Forbid installation of the guix package.

Previous Next

Package: guix-patches;

Reported by: "(" <paren <at> disroot.org>

Date: Mon, 17 Oct 2022 12:18:02 UTC

Severity: normal

Tags: moreinfo, patch

Full log


Message #11 received at 58583 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: 58583 <at> debbugs.gnu.org
Cc: "\(" <paren <at> disroot.org>
Subject: [PATCH v2] scripts: package: Forbid installation of the guix package.
Date: Mon, 17 Oct 2022 13:22:54 +0100
* guix/scripts/package.scm (package->manifest-entry*): Fail if the
  package to be installed is guix from the default channel.
---
 guix/scripts/package.scm | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 7ba2661bbb..d0feb2063a 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2018 Steve Sprang <scs <at> stevesprang.com>
 ;;; Copyright © 2022 Josselin Poiret <dev <at> jpoiret.xyz>
 ;;; Copyright © 2022 Antero Mejr <antero <at> mailbox.org>
+;;; Copyright © 2022 ( <paren <at> disroot.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -699,7 +700,15 @@ (define (store-item->manifest-entry item)
 
 (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"))
+    (newline (current-error-port))
+    (display-hint (G_ "use 'guix pull' to fetch the latest Guix revision"))
+    (exit 1))
   (manifest-entry-with-provenance
    (package->manifest-entry package output)))
 
-- 
2.38.0





This bug report was last modified 2 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.