* [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
@ 2019-04-27 16:25 Ludovic Courtès
2019-04-27 16:49 ` [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases Ludovic Courtès
2019-04-28 11:26 ` [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Jonathan Brielmaier
0 siblings, 2 replies; 11+ messages in thread
From: Ludovic Courtès @ 2019-04-27 16:25 UTC (permalink / raw)
To: 35456
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases.
2019-04-27 16:25 [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Ludovic Courtès
@ 2019-04-27 16:49 ` Ludovic Courtès
2019-04-27 21:31 ` Ricardo Wurmus
2019-04-28 11:26 ` [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Jonathan Brielmaier
1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-04-27 16:49 UTC (permalink / raw)
To: 35456
* 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@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@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@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@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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases.
2019-04-27 16:49 ` [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases Ludovic Courtès
@ 2019-04-27 21:31 ` Ricardo Wurmus
2019-04-27 22:06 ` Tobias Geerinckx-Rice
2019-04-28 10:52 ` Ludovic Courtès
0 siblings, 2 replies; 11+ messages in thread
From: Ricardo Wurmus @ 2019-04-27 21:31 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 35456
Ludovic Courtès <ludo@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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases.
2019-04-27 21:31 ` Ricardo Wurmus
@ 2019-04-27 22:06 ` Tobias Geerinckx-Rice
2019-04-28 10:52 ` Ludovic Courtès
1 sibling, 0 replies; 11+ messages in thread
From: Tobias Geerinckx-Rice @ 2019-04-27 22:06 UTC (permalink / raw)
To: Ludovic Courtès, 35456
[-- Attachment #1: Type: text/plain, Size: 320 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases.
2019-04-27 21:31 ` Ricardo Wurmus
2019-04-27 22:06 ` Tobias Geerinckx-Rice
@ 2019-04-28 10:52 ` Ludovic Courtès
2019-04-29 8:22 ` bug#35456: " Ludovic Courtès
1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-04-28 10:52 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: 35456
Hi!
Ricardo Wurmus <rekado@elephly.net> skribis:
> Ludovic Courtès <ludo@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’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
2019-04-27 16:25 [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Ludovic Courtès
2019-04-27 16:49 ` [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases Ludovic Courtès
@ 2019-04-28 11:26 ` Jonathan Brielmaier
2019-04-28 13:26 ` Ludovic Courtès
1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Brielmaier @ 2019-04-28 11:26 UTC (permalink / raw)
To: 35456
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
2019-04-28 11:26 ` [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Jonathan Brielmaier
@ 2019-04-28 13:26 ` Ludovic Courtès
2019-04-29 7:42 ` Jonathan Brielmaier
0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-04-28 13:26 UTC (permalink / raw)
To: Jonathan Brielmaier; +Cc: 35456
Hi Jonathan,
Jonathan Brielmaier <jonathan.brielmaier@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’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
2019-04-28 13:26 ` Ludovic Courtès
@ 2019-04-29 7:42 ` Jonathan Brielmaier
2019-04-29 13:31 ` zimoun
0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Brielmaier @ 2019-04-29 7:42 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: 35456
[-- Attachment #1: Type: text/plain, Size: 592 bytes --]
> 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' :)
[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1813 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* bug#35456: [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases.
2019-04-28 10:52 ` Ludovic Courtès
@ 2019-04-29 8:22 ` Ludovic Courtès
0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2019-04-29 8:22 UTC (permalink / raw)
To: Ricardo Wurmus, Jonathan Brielmaier; +Cc: 35456-done
Hello!
Ludovic Courtès <ludo@gnu.org> skribis:
> Ricardo Wurmus <rekado@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@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’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
2019-04-29 7:42 ` Jonathan Brielmaier
@ 2019-04-29 13:31 ` zimoun
2019-04-29 17:10 ` Ludovic Courtès
0 siblings, 1 reply; 11+ messages in thread
From: zimoun @ 2019-04-29 13:31 UTC (permalink / raw)
To: Jonathan Brielmaier; +Cc: 35456
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade'
2019-04-29 13:31 ` zimoun
@ 2019-04-29 17:10 ` Ludovic Courtès
0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2019-04-29 17:10 UTC (permalink / raw)
To: zimoun; +Cc: 35456
Hi,
zimoun <zimon.toutoune@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’.
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-04-29 17:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-27 16:25 [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Ludovic Courtès
2019-04-27 16:49 ` [bug#35456] [PATCH 1/1] guix package: Add 'install', 'remove', and 'upgrade' aliases Ludovic Courtès
2019-04-27 21:31 ` Ricardo Wurmus
2019-04-27 22:06 ` Tobias Geerinckx-Rice
2019-04-28 10:52 ` Ludovic Courtès
2019-04-29 8:22 ` bug#35456: " Ludovic Courtès
2019-04-28 11:26 ` [bug#35456] [PATCH 0/1] Add 'guix install', 'guix remove', and 'guix upgrade' Jonathan Brielmaier
2019-04-28 13:26 ` Ludovic Courtès
2019-04-29 7:42 ` Jonathan Brielmaier
2019-04-29 13:31 ` zimoun
2019-04-29 17:10 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.