GNU bug report logs - #35456
[PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Sat, 27 Apr 2019 16:39:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35456 in the body.
You can then email your comments to 35456 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sat, 27 Apr 2019 16:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 27 Apr 2019 16:39:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
Date: Sat, 27 Apr 2019 18:25:00 +0200
Hello Guix!

Here’s a change that’s both trivial and anecdotal by its size and
complexity, and super important after 7 years typing ‘guix package -i’
when every other tool out there has an ‘install’ sub-command.  :-)

The main question is how we are going to present it when we introduce
people to Guix.  In the manual I listed the aliases and changed
several instances of ‘guix package -i’ to ‘guix install’.  To me,
‘guix package’ remains unavoidable, but having ‘guix install’ in
particular is important to help newcomers get started quickly.

Technically, the aliases are not dumb: you cannot do, say,
‘guix install -r foo’ to remove a package.  There’s little code
duplication beyond ‘show-help’ and the license header.

Thoughts?  Rejection?  Happiness?  :-)

Thanks,
Ludo’.

Ludovic Courtès (1):
  guix package: Add 'install', 'remove', and 'upgrade' aliases.

 Makefile.am                   |  4 ++
 doc/guix.texi                 | 39 ++++++++++-----
 guix/scripts/install.scm      | 81 +++++++++++++++++++++++++++++++
 guix/scripts/package.scm      | 11 ++++-
 guix/scripts/remove.scm       | 78 ++++++++++++++++++++++++++++++
 guix/scripts/upgrade.scm      | 90 +++++++++++++++++++++++++++++++++++
 po/guix/POTFILES.in           |  3 ++
 tests/guix-package-aliases.sh | 58 ++++++++++++++++++++++
 8 files changed, 352 insertions(+), 12 deletions(-)
 create mode 100644 guix/scripts/install.scm
 create mode 100644 guix/scripts/remove.scm
 create mode 100644 guix/scripts/upgrade.scm
 create mode 100644 tests/guix-package-aliases.sh

-- 
2.21.0





Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sat, 27 Apr 2019 16:50:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 35456 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH 1/1] guix package: Add 'install', 'remove',
 and 'upgrade' aliases.
Date: Sat, 27 Apr 2019 18:49:07 +0200
* guix/scripts/install.scm, guix/scripts/remove.scm,
guix/scripts/upgrade.scm, tests/guix-package-aliases.sh: New files.
* Makefile.am (MODULES, SH_TESTS): Add them.
* po/guix/POTFILES.in: Add them.
* guix/scripts/package.scm (guix-package): Split with...
(guix-package*): ... this.  New procedure.
* doc/guix.texi (Invoking guix package): Document them.
(Binary Installation, Application Setup, Package Management)
(Packages with Multiple Outputs, Package Modules)
(X.509 Certificates, Installing Debugging Files): Use 'guix install' in
simple examples.
---
 Makefile.am                   |  4 ++
 doc/guix.texi                 | 39 ++++++++++-----
 guix/scripts/install.scm      | 81 +++++++++++++++++++++++++++++++
 guix/scripts/package.scm      | 11 ++++-
 guix/scripts/remove.scm       | 78 ++++++++++++++++++++++++++++++
 guix/scripts/upgrade.scm      | 90 +++++++++++++++++++++++++++++++++++
 po/guix/POTFILES.in           |  3 ++
 tests/guix-package-aliases.sh | 58 ++++++++++++++++++++++
 8 files changed, 352 insertions(+), 12 deletions(-)
 create mode 100644 guix/scripts/install.scm
 create mode 100644 guix/scripts/remove.scm
 create mode 100644 guix/scripts/upgrade.scm
 create mode 100644 tests/guix-package-aliases.sh

diff --git a/Makefile.am b/Makefile.am
index f25900de0f..a1b97a2ca2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -223,6 +223,9 @@ MODULES =					\
   guix/scripts/archive.scm			\
   guix/scripts/import.scm			\
   guix/scripts/package.scm			\
+  guix/scripts/install.scm			\
+  guix/scripts/remove.scm			\
+  guix/scripts/upgrade.scm			\
   guix/scripts/gc.scm				\
   guix/scripts/hash.scm				\
   guix/scripts/pack.scm				\
@@ -424,6 +427,7 @@ SH_TESTS =					\
   tests/guix-pack-localstatedir.sh		\
   tests/guix-pack-relocatable.sh		\
   tests/guix-package.sh				\
+  tests/guix-package-aliases.sh			\
   tests/guix-package-net.sh			\
   tests/guix-system.sh				\
   tests/guix-archive.sh				\
diff --git a/doc/guix.texi b/doc/guix.texi
index 238fe9741f..6e33dde5a0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -680,7 +680,7 @@ You can confirm that Guix is working by installing a sample package into
 the root profile:
 
 @example
-# guix package -i hello
+# guix install hello
 @end example
 
 The @code{guix} package must remain available in @code{root}'s profile,
@@ -1574,7 +1574,7 @@ available with Guix and then define the @code{GUIX_LOCPATH} environment
 variable:
 
 @example
-$ guix package -i glibc-locales
+$ guix install glibc-locales
 $ export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale
 @end example
 
@@ -1674,7 +1674,7 @@ Multiple Outputs}).  For instance, the following command installs fonts
 for Chinese languages:
 
 @example
-guix package -i font-adobe-source-han-sans:cn
+guix install font-adobe-source-han-sans:cn
 @end example
 
 @cindex @code{xterm}
@@ -2489,7 +2489,7 @@ emacs-guix, The Emacs-Guix Reference Manual}), after installing
 with it):
 
 @example
-guix package -i emacs-guix
+guix install emacs-guix
 @end example
 
 @menu
@@ -2607,6 +2607,7 @@ is:
 @example
 guix package @var{options}
 @end example
+
 @cindex transactions
 Primarily, @var{options} specifies the operations to be performed during
 the transaction.  Upon completion, a new profile is created, but
@@ -2620,6 +2621,22 @@ For example, to remove @code{lua} and install @code{guile} and
 guix package -r lua -i guile guile-cairo
 @end example
 
+@cindex aliases, for @command{guix package}
+For your convenience, we also provide the following aliases:
+
+@itemize
+@item
+@command{guix install} is an alias for @command{guix package -i},
+@item
+@command{guix remove} is an alias for @command{guix package -r},
+@item
+and @command{guix upgrade} is an alias for @command{guix package -u}.
+@end itemize
+
+These aliases are less expressive than @command{guix package} and provide
+fewer options, so in some cases you'll probably want to use @command{guix
+package} directly.
+
 @command{guix package} also supports a @dfn{declarative approach}
 whereby the user specifies the exact set of packages to be available and
 passes it @i{via} the @option{--manifest} option
@@ -3309,7 +3326,7 @@ like to discuss this project, join us on @email{guix-devel@@gnu.org}.
 
 Often, packages defined in Guix have a single @dfn{output}---i.e., the
 source package leads to exactly one directory in the store.  When running
-@command{guix package -i glibc}, one installs the default output of the
+@command{guix install glibc}, one installs the default output of the
 GNU libc package; the default output is called @code{out}, but its name
 can be omitted as shown in this command.  In this particular case, the
 default output of @code{glibc} contains all the C header files, shared
@@ -3325,14 +3342,14 @@ separate output, called @code{doc}.  To install the main GLib output,
 which contains everything but the documentation, one would run:
 
 @example
-guix package -i glib
+guix install glib
 @end example
 
 @cindex documentation
 The command to install its documentation is:
 
 @example
-guix package -i glib:doc
+guix install glib:doc
 @end example
 
 Some packages install programs with different ``dependency footprints''.
@@ -4983,7 +5000,7 @@ module exports a variable named @code{emacs}, which is bound to a
 
 The @code{(gnu packages @dots{})} module name space is
 automatically scanned for packages by the command-line tools.  For
-instance, when running @code{guix package -i emacs}, all the @code{(gnu
+instance, when running @code{guix install emacs}, all the @code{(gnu
 packages @dots{})} modules are scanned until one that exports a package
 object whose name is @code{emacs} is found.  This package search
 facility is implemented in the @code{(gnu packages)} module.
@@ -23631,7 +23648,7 @@ pointed to by the @code{GIT_SSL_CAINFO} environment variable.  Thus, you
 would typically run something like:
 
 @example
-$ guix package -i nss-certs
+$ guix install nss-certs
 $ export SSL_CERT_DIR="$HOME/.guix-profile/etc/ssl/certs"
 $ export SSL_CERT_FILE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
 $ export GIT_SSL_CAINFO="$SSL_CERT_FILE"
@@ -23642,7 +23659,7 @@ variable to point to a certificate bundle, so you would have to run
 something like this:
 
 @example
-$ guix package -i nss-certs
+$ guix install nss-certs
 $ export CURL_CA_BUNDLE="$HOME/.guix-profile/etc/ssl/certs/ca-certificates.crt"
 @end example
 
@@ -25424,7 +25441,7 @@ installs the debugging information for the GNU C Library and for GNU
 Guile:
 
 @example
-guix package -i glibc:debug guile:debug
+guix install glibc:debug guile:debug
 @end example
 
 GDB must then be told to look for debug files in the user's profile, by
diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
new file mode 100644
index 0000000000..611ed1f712
--- /dev/null
+++ b/guix/scripts/install.scm
@@ -0,0 +1,81 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Ludovic Courtès <ludo <at> gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts install)
+  #:use-module (guix ui)
+  #:use-module (guix scripts package)
+  #:use-module (guix scripts build)
+  #:use-module (guix scripts)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:export (guix-install))
+
+(define (show-help)
+  (display (G_ "Usage: guix install [OPTION] PACKAGES...
+Install the given PACKAGES.
+This is an alias for 'guix package -i'.\n"))
+  (display (G_ "
+  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
+  (display (G_ "
+      --bootstrap        use the bootstrap Guile to build the profile"))
+  (display (G_ "
+  -v, --verbosity=LEVEL  use the given verbosity LEVEL"))
+  (newline)
+  (show-build-options-help)
+  (newline)
+  (show-transformation-options-help)
+  (newline)
+  (display (G_ "
+  -h, --help             display this help and exit"))
+  (display (G_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define %options
+  ;; Specification of the command-line options.
+  (cons* (option '(#\h "help") #f #f
+                 (lambda args
+                   (show-help)
+                   (exit 0)))
+         (option '(#\V "version") #f #f
+                 (lambda args
+                   (show-version-and-exit "guix install")))
+
+         ;; Preserve some of the 'guix package' options.
+         (append (filter (lambda (option)
+                           (any (cut member <> (option-names option))
+                                '("profile" "dry-run" "verbosity" "bootstrap")))
+                         %package-options)
+
+                 %transformation-options
+                 %standard-build-options)))
+
+(define (guix-install . args)
+  (define (handle-argument arg result arg-handler)
+    ;; Treat all non-option arguments as package specs.
+    (values (alist-cons 'install arg result)
+            arg-handler))
+
+  (define opts
+    (parse-command-line args %options
+                        (list %package-default-options #f)
+                        #:argument-handler handle-argument))
+
+  (guix-package* opts))
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 564236988e..aa27984ea2 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -58,7 +58,11 @@
             delete-generations
             delete-matching-generations
             display-search-paths
-            guix-package))
+            guix-package
+
+            (%options . %package-options)
+            (%default-options . %package-default-options)
+            guix-package*))
 
 (define %store
   (make-parameter #f))
@@ -899,6 +903,11 @@ processed, #f otherwise."
     (parse-command-line args %options (list %default-options #f)
                         #:argument-handler handle-argument))
 
+  (guix-package* opts))
+
+(define (guix-package* opts)
+  "Run the 'guix package' command on OPTS, an alist resulting for command-line
+option processing with 'parse-command-line'."
   (with-error-handling
     (or (process-query opts)
         (parameterize ((%store  (open-connection))
diff --git a/guix/scripts/remove.scm b/guix/scripts/remove.scm
new file mode 100644
index 0000000000..9204740d65
--- /dev/null
+++ b/guix/scripts/remove.scm
@@ -0,0 +1,78 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Ludovic Courtès <ludo <at> gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts remove)
+  #:use-module (guix ui)
+  #:use-module (guix scripts package)
+  #:use-module (guix scripts build)
+  #:use-module (guix scripts)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:export (guix-remove))
+
+(define (show-help)
+  (display (G_ "Usage: guix remove [OPTION] PACKAGES...
+Remove the given PACKAGES.
+This is an alias for 'guix package -r'.\n"))
+  (display (G_ "
+  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
+  (display (G_ "
+      --bootstrap        use the bootstrap Guile to build the profile"))
+  (display (G_ "
+  -v, --verbosity=LEVEL  use the given verbosity LEVEL"))
+  (newline)
+  (show-build-options-help)
+  (newline)
+  (display (G_ "
+  -h, --help             display this help and exit"))
+  (display (G_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define %options
+  ;; Specification of the command-line options.
+  (cons* (option '(#\h "help") #f #f
+                 (lambda args
+                   (show-help)
+                   (exit 0)))
+         (option '(#\V "version") #f #f
+                 (lambda args
+                   (show-version-and-exit "guix remove")))
+
+         ;; Preserve some of the 'guix package' options.
+         (append (filter (lambda (option)
+                           (any (cut member <> (option-names option))
+                                '("profile" "dry-run" "verbosity" "bootstrap")))
+                         %package-options)
+
+                 %standard-build-options)))
+
+(define (guix-remove . args)
+  (define (handle-argument arg result arg-handler)
+    ;; Treat all non-option arguments as package specs.
+    (values (alist-cons 'remove arg result)
+            arg-handler))
+
+  (define opts
+    (parse-command-line args %options
+                        (list %package-default-options #f)
+                        #:argument-handler handle-argument))
+
+  (guix-package* opts))
diff --git a/guix/scripts/upgrade.scm b/guix/scripts/upgrade.scm
new file mode 100644
index 0000000000..bf3b8a0710
--- /dev/null
+++ b/guix/scripts/upgrade.scm
@@ -0,0 +1,90 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Ludovic Courtès <ludo <at> gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix scripts upgrade)
+  #:use-module (guix ui)
+  #:use-module (guix scripts package)
+  #:use-module (guix scripts build)
+  #:use-module (guix scripts)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:use-module (srfi srfi-37)
+  #:use-module (ice-9 match)
+  #:export (guix-upgrade))
+
+(define (show-help)
+  (display (G_ "Usage: guix upgrade [OPTION] [REGEXP]
+Upgrade packages that match REGEXP.
+This is an alias for 'guix package -u'.\n"))
+  (display (G_ "
+  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
+  (display (G_ "
+      --bootstrap        use the bootstrap Guile to build the profile"))
+  (display (G_ "
+  -v, --verbosity=LEVEL  use the given verbosity LEVEL"))
+  (newline)
+  (show-build-options-help)
+  (newline)
+  (show-transformation-options-help)
+  (newline)
+  (display (G_ "
+  -h, --help             display this help and exit"))
+  (display (G_ "
+  -V, --version          display version information and exit"))
+  (newline)
+  (show-bug-report-information))
+
+(define %options
+  ;; Specification of the command-line options.
+  (cons* (option '(#\h "help") #f #f
+                 (lambda args
+                   (show-help)
+                   (exit 0)))
+         (option '(#\V "version") #f #f
+                 (lambda args
+                   (show-version-and-exit "guix upgrade")))
+
+         ;; Preserve some of the 'guix package' options.
+         (append (filter (lambda (option)
+                           (any (cut member <> (option-names option))
+                                '("profile" "dry-run" "verbosity" "bootstrap")))
+                         %package-options)
+
+                 %transformation-options
+                 %standard-build-options)))
+
+(define (guix-upgrade . args)
+  (define (handle-argument arg result arg-handler)
+    ;; Accept at most one non-option argument, and treat it as an upgrade
+    ;; regexp.
+    (match (assq-ref result 'upgrade)
+      (#f
+       (values (alist-cons 'upgrade arg
+                           (alist-delete 'upgrade result))
+               arg-handler))
+      (_
+       (leave (G_ "~A: extraneous argument~%") arg))))
+
+  (define opts
+    (parse-command-line args %options
+                        (list `((upgrade . #f)
+                                ,@%package-default-options)
+                              #f)
+                        #:argument-handler handle-argument))
+
+  (guix-package* opts))
diff --git a/po/guix/POTFILES.in b/po/guix/POTFILES.in
index a2c89db981..91de60efc7 100644
--- a/po/guix/POTFILES.in
+++ b/po/guix/POTFILES.in
@@ -41,6 +41,9 @@ guix/scripts/build.scm
 guix/discovery.scm
 guix/scripts/download.scm
 guix/scripts/package.scm
+guix/scripts/install.scm
+guix/scripts/remove.scm
+guix/scripts/upgrade.scm
 guix/scripts/gc.scm
 guix/scripts/hash.scm
 guix/scripts/import.scm
diff --git a/tests/guix-package-aliases.sh b/tests/guix-package-aliases.sh
new file mode 100644
index 0000000000..64ed2fbb67
--- /dev/null
+++ b/tests/guix-package-aliases.sh
@@ -0,0 +1,58 @@
+# GNU Guix --- Functional package management for GNU
+# Copyright © 2019 Ludovic Courtès <ludo <at> gnu.org>
+#
+# This file is part of GNU Guix.
+#
+# GNU Guix is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or (at
+# your option) any later version.
+#
+# GNU Guix is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+#
+# Test the `guix package' aliases.
+#
+
+guix install --version
+
+readlink_base ()
+{
+    basename `readlink "$1"`
+}
+
+profile="t-profile-$$"
+rm -f "$profile"
+
+trap 'rm -f "$profile" "$profile-"[0-9]*' EXIT
+
+guix install --bootstrap guile-bootstrap -p "$profile"
+test -x "$profile/bin/guile"
+
+# Make sure '-r' isn't passed as-is to 'guix package'.
+if guix install -r guile-bootstrap -p "$profile" --bootstrap
+then false; else true; fi
+test -x "$profile/bin/guile"
+
+guix upgrade --version
+guix upgrade -n
+guix upgrade gui.e -n
+if guix upgrade foo bar -n;
+then false; else true; fi
+
+guix remove --version
+guix remove --bootstrap guile-bootstrap -p "$profile"
+! test -x "$profile/bin/guile"
+test `guix package -p "$profile" -I | wc -l` -eq 0
+
+if guix remove -p "$profile" this-is-not-installed --bootstrap
+then false; else true; fi
+
+if guix remove -i guile-bootstrap -p "$profile" --bootstrap
+then false; else true; fi
-- 
2.21.0





Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sat, 27 Apr 2019 21:32:01 GMT) Full text and rfc822 format available.

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

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 35456 <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove',
 and 'upgrade' aliases.
Date: Sat, 27 Apr 2019 23:31:07 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:

> * guix/scripts/install.scm, guix/scripts/remove.scm,
> guix/scripts/upgrade.scm, tests/guix-package-aliases.sh: New files.
> * Makefile.am (MODULES, SH_TESTS): Add them.
> * po/guix/POTFILES.in: Add them.
> * guix/scripts/package.scm (guix-package): Split with...
> (guix-package*): ... this.  New procedure.
> * doc/guix.texi (Invoking guix package): Document them.
> (Binary Installation, Application Setup, Package Management)
> (Packages with Multiple Outputs, Package Modules)
> (X.509 Certificates, Installing Debugging Files): Use 'guix install' in
> simple examples.

I like it!

> diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
> new file mode 100644
> index 0000000000..611ed1f712
> --- /dev/null
> +++ b/guix/scripts/install.scm
[…]
> +(define (show-help)
> +  (display (G_ "Usage: guix install [OPTION] PACKAGES...
> +Install the given PACKAGES.
> +This is an alias for 'guix package -i'.\n"))
> +  (display (G_ "
> +  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
> +  (display (G_ "
> +      --bootstrap        use the bootstrap Guile to build the profile"))

I have to admit that I never use “--bootstrap”.  You already removed
many advanced options of “guix package” from this alias.  Would it make
sense to also remove this one?

(I don’t feel strongly about this.)

> diff --git a/guix/scripts/remove.scm b/guix/scripts/remove.scm
> new file mode 100644
> index 0000000000..9204740d65
> --- /dev/null
> +++ b/guix/scripts/remove.scm
[…]
> +(define (show-help)
> +  (display (G_ "Usage: guix remove [OPTION] PACKAGES...
> +Remove the given PACKAGES.
> +This is an alias for 'guix package -r'.\n"))
> +  (display (G_ "
> +  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
> +  (display (G_ "
> +      --bootstrap        use the bootstrap Guile to build the profile"))

Same here….

> diff --git a/guix/scripts/upgrade.scm b/guix/scripts/upgrade.scm
> new file mode 100644
> index 0000000000..bf3b8a0710
> --- /dev/null
> +++ b/guix/scripts/upgrade.scm
[…]
> +(define (show-help)
> +  (display (G_ "Usage: guix upgrade [OPTION] [REGEXP]
> +Upgrade packages that match REGEXP.
> +This is an alias for 'guix package -u'.\n"))
> +  (display (G_ "
> +  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
> +  (display (G_ "
> +      --bootstrap        use the bootstrap Guile to build the profile"))

…and here.

Aside from that it looks good to me.  I expect this to be a very welcome
change for my colleagues who often typed “guix install” only to correct
it to “guix package -i” after an error.

--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sat, 27 Apr 2019 22:07:02 GMT) Full text and rfc822 format available.

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

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Ludovic Courtès <ludo <at> gnu.org>, 35456 <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove',
 and 'upgrade' aliases.
Date: Sun, 28 Apr 2019 00:06:42 +0200
[Message part 1 (text/plain, inline)]
Ludo', Ricardo,

Ricardo Wurmus wrote:
> I have to admit that I never use “--bootstrap”.  You already 
> removed
> many advanced options of “guix package” from this alias.  Would 
> it make
> sense to also remove this one?

+1

> (I don’t feel strongly about this.)

+6

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sun, 28 Apr 2019 10:53:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 35456 <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove',
 and 'upgrade' aliases.
Date: Sun, 28 Apr 2019 12:52:19 +0200
Hi!

Ricardo Wurmus <rekado <at> elephly.net> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> * guix/scripts/install.scm, guix/scripts/remove.scm,
>> guix/scripts/upgrade.scm, tests/guix-package-aliases.sh: New files.
>> * Makefile.am (MODULES, SH_TESTS): Add them.
>> * po/guix/POTFILES.in: Add them.
>> * guix/scripts/package.scm (guix-package): Split with...
>> (guix-package*): ... this.  New procedure.
>> * doc/guix.texi (Invoking guix package): Document them.
>> (Binary Installation, Application Setup, Package Management)
>> (Packages with Multiple Outputs, Package Modules)
>> (X.509 Certificates, Installing Debugging Files): Use 'guix install' in
>> simple examples.
>
> I like it!

Cool!

>> diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
>> new file mode 100644
>> index 0000000000..611ed1f712
>> --- /dev/null
>> +++ b/guix/scripts/install.scm
> […]
>> +(define (show-help)
>> +  (display (G_ "Usage: guix install [OPTION] PACKAGES...
>> +Install the given PACKAGES.
>> +This is an alias for 'guix package -i'.\n"))
>> +  (display (G_ "
>> +  -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
>> +  (display (G_ "
>> +      --bootstrap        use the bootstrap Guile to build the profile"))
>
> I have to admit that I never use “--bootstrap”.  You already removed
> many advanced options of “guix package” from this alias.  Would it make
> sense to also remove this one?

It’s used only for tests in fact, where we don’t want to rebuild the
world just to run profile hooks.  Perhaps we could simply remove it from
the ‘--help’ output, WDYT?

> Aside from that it looks good to me.  I expect this to be a very welcome
> change for my colleagues who often typed “guix install” only to correct
> it to “guix package -i” after an error.

Heheh, I guess they’re not the only ones.  :-)

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sun, 28 Apr 2019 11:28:02 GMT) Full text and rfc822 format available.

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

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: guix-patches <at> gnu.org
Subject: Re: [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and
 'guix upgrade'
Date: Sun, 28 Apr 2019 13:26:42 +0200
On 4/27/19 6:25 PM, Ludovic Courtès wrote:
> Thoughts?  Rejection?  Happiness?  :-)

I think we shouldn't do this for the 1.0 release. We should take some
time here. One reason is that it's quite some work to get this
documented and then translated...

The idea of offering new commands for often used ones, is very good.
Personally I would also like to have 'guix search' and 'guix show', as I
use them quite often :)

What I like about the guix command line interface, is the consistency
and logic. Especially if I compare it with some random (open)SUSE tool
like zypper, which has a almost 50 subcommands ("zypper SUBCOMMAND").
That's something we shouldn't imitate.

I feel that grouping commands in subcommands and subsubcommands like
with 'guix system' is a good idea. At the moment I see there some room
for improvement.

We have a lot of developer commands directly under 'guix', like
download, link etc. But the most "end-user" commands are under 'guix
package' or 'guix system'...

For 'guix system' it could make sense to move 'guix system
{container,vm-image,disk,docker-image}' to something like 'guix create'.

Just my five cents :)
Jonathan































Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Sun, 28 Apr 2019 13:27:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Cc: 35456 <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove',
 and 'guix upgrade'
Date: Sun, 28 Apr 2019 15:26:41 +0200
Hi Jonathan,

Jonathan Brielmaier <jonathan.brielmaier <at> web.de> skribis:

> On 4/27/19 6:25 PM, Ludovic Courtès wrote:
>> Thoughts?  Rejection?  Happiness?  :-)
>
> I think we shouldn't do this for the 1.0 release. We should take some
> time here. One reason is that it's quite some work to get this
> documented and then translated...

The patch provides documentation that boils down to ~10 lines since
these are just aliases.  (Also, I think it’s reasonable to say we took
our time: it had been in ‘1.0.org’ since July 2018 and we’ve been
discussing it for years before that.  :-))

> The idea of offering new commands for often used ones, is very good.
> Personally I would also like to have 'guix search' and 'guix show', as I
> use them quite often :)

Yeah, why not.

> What I like about the guix command line interface, is the consistency
> and logic. Especially if I compare it with some random (open)SUSE tool
> like zypper, which has a almost 50 subcommands ("zypper SUBCOMMAND").
> That's something we shouldn't imitate.
>
> I feel that grouping commands in subcommands and subsubcommands like
> with 'guix system' is a good idea. At the moment I see there some room
> for improvement.
>
> We have a lot of developer commands directly under 'guix', like
> download, link etc. But the most "end-user" commands are under 'guix
> package' or 'guix system'...
>
> For 'guix system' it could make sense to move 'guix system
> {container,vm-image,disk,docker-image}' to something like 'guix create'.

I agree the CLI structure could be improved in several areas.  In fact,
there have been radical proposals in the past to overhaul the whole CLI.

I think “guix install” & co. require special attention though: people
have come to expect install/remove/upgrade sub-commands from their
package manager and these are the first commands they’ll run.  It costs
us very little in terms of maintenance, but it certainly helps newcomers
get started.

Does that make sense?

Thanks for your feedback!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Mon, 29 Apr 2019 07:43:01 GMT) Full text and rfc822 format available.

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

From: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 35456 <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and
 'guix upgrade'
Date: Mon, 29 Apr 2019 09:42:02 +0200
[Message part 1 (text/plain, inline)]
> I agree the CLI structure could be improved in several areas.  In fact,
> there have been radical proposals in the past to overhaul the whole CLI.
> 
> I think “guix install” & co. require special attention though: people
> have come to expect install/remove/upgrade sub-commands from their
> package manager and these are the first commands they’ll run.  It costs
> us very little in terms of maintenance, but it certainly helps newcomers
> get started.
> 
> Does that make sense?

If you are so confident, go ahead and make me happy by adding at least
'guix search' :)
[pEpkey.asc (application/pgp-keys, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Mon, 29 Apr 2019 08:23:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Mon, 29 Apr 2019 08:23:03 GMT) Full text and rfc822 format available.

Message #31 received at 35456-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Ricardo Wurmus <rekado <at> elephly.net>,
 Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Cc: 35456-done <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove',
 and 'upgrade' aliases.
Date: Mon, 29 Apr 2019 10:22:42 +0200
Hello!

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Ricardo Wurmus <rekado <at> elephly.net> skribis:

[...]

>> I have to admit that I never use “--bootstrap”.  You already removed
>> many advanced options of “guix package” from this alias.  Would it make
>> sense to also remove this one?
>
> It’s used only for tests in fact, where we don’t want to rebuild the
> world just to run profile hooks.  Perhaps we could simply remove it from
> the ‘--help’ output, WDYT?

I did that and removed it altogether from ‘guix upgrade’ since there are
no tests using it.

I also updated the Bash completion.

Jonathan Brielmaier <jonathan.brielmaier <at> web.de> skribis:

> If you are so confident, go ahead and make me happy by adding at least
> 'guix search' :)

Heheh thanks.  :-)

It also occurred to me that ‘guix search’ would be logical as well,
since that’s, again, one of the first commands one runs.  I’ll send a
patch for that and then I’ll stop here, I promise!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Mon, 29 Apr 2019 15:06:03 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 35456 <at> debbugs.gnu.org
Subject: Re: [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and
 'guix upgrade'
Date: Mon, 29 Apr 2019 15:31:44 +0200
Dear,

What about user-defined aliases ?
Instead of scattered hard-coded aliases.
Something using a .guixconfig file mimicking .gitconfig.

The default command would be the one we already use.
Predefined aliases such that `guix install` or `guix search` etc.
should live in .guix-profile/etc/guixconfig.
And maybe predefined apt flavor or yum flavour.

I mean something like:

~/.guixconfig

(alias 'ins (package --install))
(flavour 'apt)


~/.guix-profile/etc/guixalias-apt

(alias 'install blabla
         'search blabla
         'show blabla)

~/.guix-profile/etc/guixalias-yum

(alias 'install blabla
         'search blabla
         'info blabla)


I do not know if it makes senses.


All the best,
simon




Information forwarded to guix-patches <at> gnu.org:
bug#35456; Package guix-patches. (Mon, 29 Apr 2019 17:11:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: 35456 <at> debbugs.gnu.org, Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
Subject: Re: [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove',
 and 'guix upgrade'
Date: Mon, 29 Apr 2019 19:10:31 +0200
Hi,

zimoun <zimon.toutoune <at> gmail.com> skribis:

> What about user-defined aliases ?

I agree it’d be useful, it’s a perfectly valid wishlist item IMO!

I think that install/remove/upgrade/search need to be available by
default though, as discussed earlier.

Thanks for your feedback,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 28 May 2019 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 333 days ago.

Previous Next


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