2013-02-20 17:46:38 -05:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2020-01-06 09:14:09 -05:00
|
|
|
|
;;; Copyright © 2013, 2014, 2015, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
2017-03-01 16:11:02 -05:00
|
|
|
|
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
|
2013-02-20 17:46:38 -05:00
|
|
|
|
;;;
|
|
|
|
|
;;; 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 pull)
|
2020-02-11 06:17:33 -05:00
|
|
|
|
#:use-module ((guix ui) #:hide (display-profile-content))
|
2019-09-15 11:57:10 -04:00
|
|
|
|
#:use-module (guix colors)
|
2015-10-26 17:17:25 -04:00
|
|
|
|
#:use-module (guix utils)
|
2019-02-11 17:05:36 -05:00
|
|
|
|
#:use-module ((guix status) #:select (with-status-verbosity))
|
2015-09-10 05:37:36 -04:00
|
|
|
|
#:use-module (guix scripts)
|
2013-02-20 17:46:38 -05:00
|
|
|
|
#:use-module (guix store)
|
|
|
|
|
#:use-module (guix config)
|
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix derivations)
|
2018-05-30 11:50:21 -04:00
|
|
|
|
#:use-module (guix profiles)
|
2014-09-18 12:42:39 -04:00
|
|
|
|
#:use-module (guix gexp)
|
2017-08-01 17:38:07 -04:00
|
|
|
|
#:use-module (guix grafts)
|
2018-07-10 10:06:32 -04:00
|
|
|
|
#:use-module (guix memoization)
|
2014-09-18 12:42:39 -04:00
|
|
|
|
#:use-module (guix monads)
|
2018-08-27 12:05:49 -04:00
|
|
|
|
#:use-module (guix channels)
|
2020-01-06 09:14:09 -05:00
|
|
|
|
#:autoload (guix inferior) (open-inferior
|
|
|
|
|
inferior-available-packages
|
|
|
|
|
close-inferior)
|
2017-05-09 09:45:04 -04:00
|
|
|
|
#:use-module (guix scripts build)
|
2020-02-11 06:17:33 -05:00
|
|
|
|
#:use-module (guix scripts describe)
|
2019-01-18 08:59:59 -05:00
|
|
|
|
#:autoload (guix build utils) (which)
|
2019-11-18 16:22:59 -05:00
|
|
|
|
#:use-module ((guix build syscalls)
|
|
|
|
|
#:select (with-file-lock/no-wait))
|
2018-08-27 17:05:27 -04:00
|
|
|
|
#:use-module (guix git)
|
|
|
|
|
#:use-module (git)
|
2018-07-13 10:59:15 -04:00
|
|
|
|
#:use-module (gnu packages)
|
2019-09-18 03:52:18 -04:00
|
|
|
|
#:use-module ((guix scripts package) #:select (build-and-use-profile
|
|
|
|
|
delete-matching-generations))
|
2019-01-18 08:59:59 -05:00
|
|
|
|
#:use-module ((gnu packages base) #:select (canonical-package))
|
gnu: Split (gnu packages base), adding (gnu packages commencement).
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0,
findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet,
binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0,
texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash,
cross-gcc-wrapper, static-bash-for-glibc, glibc-final,
gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++,
gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs,
guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final,
%boot5-inputs, %final-inputs, canonical-package, gcc-toolchain,
gcc-toolchain-4.8, gcc-toolchain-4.9): Move to...
* gnu/packages/commencement.scm: ... here. New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* build-aux/check-final-inputs-self-contained.scm: Adjust accordingly.
* gnu/packages/cross-base.scm: Likewise.
* gnu/packages/make-bootstrap.scm: Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/gnu.scm (standard-packages, gnu-build,
gnu-cross-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* guix/download.scm (url-fetch): Likewise.
* guix/gexp.scm (default-guile): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/monads.scm (run-with-store): Likewise.
* guix/packages.scm (default-guile): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths):
Likewise.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh: Likewise.
* gnu/services/base.scm: Use 'canonical-package' instead of xxx-final.
* gnu/services/xorg.scm: Likewise.
* gnu/system/vm.scm: Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-26 18:25:17 -04:00
|
|
|
|
#:use-module (gnu packages guile)
|
2013-02-20 17:46:38 -05:00
|
|
|
|
#:use-module ((gnu packages bootstrap)
|
|
|
|
|
#:select (%bootstrap-guile))
|
2017-03-01 16:11:02 -05:00
|
|
|
|
#:use-module ((gnu packages certs) #:select (le-certs))
|
2013-02-20 17:46:38 -05:00
|
|
|
|
#:use-module (srfi srfi-1)
|
2019-02-12 16:35:28 -05:00
|
|
|
|
#:use-module (srfi srfi-11)
|
2018-07-10 10:06:32 -04:00
|
|
|
|
#:use-module (srfi srfi-26)
|
2019-01-20 17:53:26 -05:00
|
|
|
|
#:use-module (srfi srfi-34)
|
2018-06-13 17:39:24 -04:00
|
|
|
|
#:use-module (srfi srfi-35)
|
2013-02-20 17:46:38 -05:00
|
|
|
|
#:use-module (srfi srfi-37)
|
2014-11-09 16:32:21 -05:00
|
|
|
|
#:use-module (ice-9 match)
|
2018-07-10 10:06:32 -04:00
|
|
|
|
#:use-module (ice-9 vlist)
|
2019-07-17 14:09:44 -04:00
|
|
|
|
#:use-module (ice-9 format)
|
2020-02-11 06:17:33 -05:00
|
|
|
|
#:re-export (display-profile-content
|
|
|
|
|
channel-commit-hyperlink)
|
|
|
|
|
#:export (channel-list
|
2019-11-15 15:11:58 -05:00
|
|
|
|
with-git-error-handling
|
2018-09-03 09:03:33 -04:00
|
|
|
|
guix-pull))
|
2013-02-20 17:46:38 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Command-line options.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define %default-options
|
|
|
|
|
;; Alist of default option values.
|
2018-08-27 12:05:49 -04:00
|
|
|
|
`((system . ,(%current-system))
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(substitutes? . #t)
|
2019-11-21 09:28:13 -05:00
|
|
|
|
(offload? . #t)
|
2017-01-18 17:21:29 -05:00
|
|
|
|
(print-build-trace? . #t)
|
|
|
|
|
(print-extended-build-trace? . #t)
|
2018-10-15 17:06:55 -04:00
|
|
|
|
(multiplexed-build-output? . #t)
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(graft? . #t)
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(debug . 0)
|
2019-01-27 12:16:25 -05:00
|
|
|
|
(verbosity . 1)))
|
2013-02-20 17:46:38 -05:00
|
|
|
|
|
|
|
|
|
(define (show-help)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "Usage: guix pull [OPTION]...
|
2013-02-20 17:46:38 -05:00
|
|
|
|
Download and deploy the latest version of Guix.\n"))
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(display (G_ "
|
|
|
|
|
-C, --channels=FILE deploy the channels defined in FILE"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2017-07-28 11:38:19 -04:00
|
|
|
|
--url=URL download from the Git repository at URL"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
--commit=COMMIT download the specified COMMIT"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
--branch=BRANCH download the tip of the specified BRANCH"))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
(display (G_ "
|
2019-04-21 15:26:06 -04:00
|
|
|
|
-N, --news display news compared to the previous generation"))
|
|
|
|
|
(display (G_ "
|
2018-06-13 17:39:24 -04:00
|
|
|
|
-l, --list-generations[=PATTERN]
|
|
|
|
|
list generations matching PATTERN"))
|
2019-09-18 03:52:18 -04:00
|
|
|
|
(display (G_ "
|
|
|
|
|
--roll-back roll back to the previous generation"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
-d, --delete-generations[=PATTERN]
|
|
|
|
|
delete generations matching PATTERN"))
|
|
|
|
|
(display (G_ "
|
|
|
|
|
-S, --switch-generation=PATTERN
|
|
|
|
|
switch to a generation matching PATTERN"))
|
2018-09-03 06:46:40 -04:00
|
|
|
|
(display (G_ "
|
|
|
|
|
-p, --profile=PROFILE use PROFILE instead of ~/.config/guix/current"))
|
2018-11-05 16:52:19 -05:00
|
|
|
|
(display (G_ "
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
-v, --verbosity=LEVEL use the given verbosity LEVEL"))
|
|
|
|
|
(display (G_ "
|
2019-01-08 12:17:22 -05:00
|
|
|
|
-s, --system=SYSTEM attempt to build for SYSTEM--e.g., \"i686-linux\""))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2013-02-20 17:46:38 -05:00
|
|
|
|
--bootstrap use the bootstrap Guile to build the new Guix"))
|
|
|
|
|
(newline)
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(show-build-options-help)
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2013-02-20 17:46:38 -05:00
|
|
|
|
-h, --help display this help and exit"))
|
ui: Rename '_' to 'G_'.
This avoids collisions with '_' when the latter is used as a 'match'
pattern for instance. See
<https://lists.gnu.org/archive/html/guix-devel/2017-04/msg00464.html>.
* guix/ui.scm: Rename '_' to 'G_'.
* po/guix/Makevars (XGETTEXT_OPTIONS): Adjust accordingly.
* build-aux/compile-all.scm (warnings): Remove 'format'.
* gnu/packages.scm,
gnu/services.scm,
gnu/services/shepherd.scm,
gnu/system.scm,
gnu/system/shadow.scm,
guix/gnupg.scm,
guix/http-client.scm,
guix/import/cpan.scm,
guix/import/elpa.scm,
guix/import/pypi.scm,
guix/nar.scm,
guix/scripts.scm,
guix/scripts/archive.scm,
guix/scripts/authenticate.scm,
guix/scripts/build.scm,
guix/scripts/challenge.scm,
guix/scripts/container.scm,
guix/scripts/container/exec.scm,
guix/scripts/copy.scm,
guix/scripts/download.scm,
guix/scripts/edit.scm,
guix/scripts/environment.scm,
guix/scripts/gc.scm,
guix/scripts/graph.scm,
guix/scripts/hash.scm,
guix/scripts/import.scm,
guix/scripts/import/cpan.scm,
guix/scripts/import/cran.scm,
guix/scripts/import/crate.scm,
guix/scripts/import/elpa.scm,
guix/scripts/import/gem.scm,
guix/scripts/import/gnu.scm,
guix/scripts/import/hackage.scm,
guix/scripts/import/nix.scm,
guix/scripts/import/pypi.scm,
guix/scripts/import/stackage.scm,
guix/scripts/lint.scm,
guix/scripts/offload.scm,
guix/scripts/pack.scm,
guix/scripts/package.scm,
guix/scripts/perform-download.scm,
guix/scripts/publish.scm,
guix/scripts/pull.scm,
guix/scripts/refresh.scm,
guix/scripts/size.scm,
guix/scripts/substitute.scm,
guix/scripts/system.scm,
guix/ssh.scm,
guix/upstream.scm: Use 'G_' instead of '_'. Most of this change was
obtained by running: "sed -i -e's/(_ "/(G_ "/g' `find -name \*.scm`".
2017-05-03 09:57:02 -04:00
|
|
|
|
(display (G_ "
|
2013-02-20 17:46:38 -05:00
|
|
|
|
-V, --version display version information and exit"))
|
|
|
|
|
(newline)
|
|
|
|
|
(show-bug-report-information))
|
|
|
|
|
|
|
|
|
|
(define %options
|
|
|
|
|
;; Specifications of the command-line options.
|
2019-11-15 15:30:37 -05:00
|
|
|
|
(cons* (option '(#\C "channels") #t #f
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'channel-file arg result)))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
(option '(#\l "list-generations") #f #t
|
|
|
|
|
(lambda (opt name arg result)
|
2019-07-10 13:58:30 -04:00
|
|
|
|
(cons `(query list-generations ,arg)
|
2018-06-13 17:39:24 -04:00
|
|
|
|
result)))
|
2019-09-18 03:52:18 -04:00
|
|
|
|
(option '("roll-back") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(cons '(generation roll-back)
|
|
|
|
|
result)))
|
|
|
|
|
(option '(#\S "switch-generation") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(cons `(generation switch ,arg)
|
|
|
|
|
result)))
|
|
|
|
|
(option '(#\d "delete-generations") #f #t
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(cons `(generation delete ,arg)
|
|
|
|
|
result)))
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(option '(#\N "news") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(cons '(query display-news) result)))
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(option '("url") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
2017-07-28 11:38:19 -04:00
|
|
|
|
(alist-cons 'repository-url arg
|
|
|
|
|
(alist-delete 'repository-url result))))
|
|
|
|
|
(option '("commit") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'ref `(commit . ,arg) result)))
|
|
|
|
|
(option '("branch") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
2019-01-14 11:20:28 -05:00
|
|
|
|
(alist-cons 'ref `(branch . ,arg) result)))
|
2018-09-03 06:46:40 -04:00
|
|
|
|
(option '(#\p "profile") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'profile (canonicalize-profile arg)
|
|
|
|
|
result)))
|
2018-12-27 05:54:55 -05:00
|
|
|
|
(option '(#\s "system") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'system arg
|
|
|
|
|
(alist-delete 'system result eq?))))
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(option '(#\n "dry-run") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
2020-03-25 10:05:15 -04:00
|
|
|
|
(alist-cons 'dry-run? #t result)))
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(option '(#\v "verbosity") #t #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(let ((level (string->number* arg)))
|
|
|
|
|
(alist-cons 'verbosity level
|
|
|
|
|
(alist-delete 'verbosity result)))))
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(option '("bootstrap") #f #f
|
|
|
|
|
(lambda (opt name arg result)
|
|
|
|
|
(alist-cons 'bootstrap? #t result)))
|
2013-02-20 17:46:38 -05:00
|
|
|
|
|
2017-05-09 09:45:04 -04:00
|
|
|
|
(option '(#\h "help") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-help)
|
|
|
|
|
(exit 0)))
|
|
|
|
|
(option '(#\V "version") #f #f
|
|
|
|
|
(lambda args
|
|
|
|
|
(show-version-and-exit "guix pull")))
|
|
|
|
|
|
|
|
|
|
%standard-build-options))
|
2013-02-20 17:46:38 -05:00
|
|
|
|
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(define* (display-profile-news profile #:key concise?
|
|
|
|
|
current-is-newer?)
|
|
|
|
|
"Display what's up in PROFILE--new packages, and all that. If
|
|
|
|
|
CURRENT-IS-NEWER? is true, assume that the current process represents the
|
2019-09-21 17:00:07 -04:00
|
|
|
|
newest generation of PROFILE. Return true when there's more info to display."
|
2018-07-13 10:59:15 -04:00
|
|
|
|
(match (memv (generation-number profile)
|
|
|
|
|
(reverse (profile-generations profile)))
|
|
|
|
|
((current previous _ ...)
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(let ((these (fold-available-packages
|
|
|
|
|
(lambda* (name version result
|
|
|
|
|
#:key supported? deprecated?
|
|
|
|
|
#:allow-other-keys)
|
|
|
|
|
(if (and supported? (not deprecated?))
|
|
|
|
|
(alist-cons name version result)
|
|
|
|
|
result))
|
|
|
|
|
'()))
|
|
|
|
|
(those (profile-package-alist
|
|
|
|
|
(generation-file-name profile
|
|
|
|
|
(if current-is-newer?
|
|
|
|
|
previous
|
|
|
|
|
current)))))
|
|
|
|
|
(let ((old (if current-is-newer? those these))
|
|
|
|
|
(new (if current-is-newer? these those)))
|
|
|
|
|
(display-new/upgraded-packages old new
|
|
|
|
|
#:concise? concise?
|
|
|
|
|
#:heading
|
|
|
|
|
(G_ "New in this revision:\n")))))
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(_ #f)))
|
2018-07-13 10:59:15 -04:00
|
|
|
|
|
2019-09-14 08:59:58 -04:00
|
|
|
|
(define (display-channel channel)
|
|
|
|
|
"Display information about CHANNEL."
|
|
|
|
|
(format (current-error-port)
|
|
|
|
|
;; TRANSLATORS: This describes a "channel"; the first placeholder is
|
|
|
|
|
;; the channel name (e.g., "guix") and the second placeholder is its
|
|
|
|
|
;; URL.
|
|
|
|
|
(G_ " ~a at ~a~%")
|
|
|
|
|
(channel-name channel)
|
|
|
|
|
(channel-url channel)))
|
|
|
|
|
|
|
|
|
|
(define (channel=? channel1 channel2)
|
|
|
|
|
"Return true if CHANNEL1 and CHANNEL2 are the same for all practical
|
|
|
|
|
purposes."
|
|
|
|
|
;; Assume that the URL matters less than the name.
|
|
|
|
|
(eq? (channel-name channel1) (channel-name channel2)))
|
|
|
|
|
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(define (display-news-entry-title entry language port)
|
|
|
|
|
"Display the title of ENTRY, a news entry, to PORT."
|
|
|
|
|
(define title
|
|
|
|
|
(channel-news-entry-title entry))
|
|
|
|
|
|
2019-11-01 07:21:26 -04:00
|
|
|
|
(let ((title (or (assoc-ref title language)
|
|
|
|
|
(assoc-ref title (%default-message-language))
|
|
|
|
|
"")))
|
|
|
|
|
(format port " ~a~%"
|
|
|
|
|
(highlight
|
|
|
|
|
(string-trim-right
|
|
|
|
|
(catch 'parser-error
|
|
|
|
|
(lambda ()
|
|
|
|
|
(texi->plain-text title))
|
|
|
|
|
|
|
|
|
|
;; When Texinfo markup is invalid, display it as-is.
|
|
|
|
|
(const title)))))))
|
2019-09-21 17:00:07 -04:00
|
|
|
|
|
2019-11-28 08:22:16 -05:00
|
|
|
|
(define (display-news-entry entry channel language port)
|
|
|
|
|
"Display ENTRY, a <channel-news-entry> from CHANNEL, in LANGUAGE, a language
|
|
|
|
|
code, to PORT."
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(define body
|
|
|
|
|
(channel-news-entry-body entry))
|
|
|
|
|
|
2019-11-28 08:22:16 -05:00
|
|
|
|
(define commit
|
|
|
|
|
(channel-news-entry-commit entry))
|
|
|
|
|
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(display-news-entry-title entry language port)
|
2019-09-25 04:48:50 -04:00
|
|
|
|
(format port (dim (G_ " commit ~a~%"))
|
2019-11-28 08:22:16 -05:00
|
|
|
|
(if (supports-hyperlinks?)
|
|
|
|
|
(channel-commit-hyperlink channel commit)
|
|
|
|
|
commit))
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(newline port)
|
2019-11-01 07:21:26 -04:00
|
|
|
|
(let ((body (or (assoc-ref body language)
|
|
|
|
|
(assoc-ref body (%default-message-language))
|
|
|
|
|
"")))
|
2020-03-20 07:44:43 -04:00
|
|
|
|
(format port "~a~%"
|
2019-11-01 07:21:26 -04:00
|
|
|
|
(indented-string
|
|
|
|
|
(parameterize ((%text-width (- (%text-width) 4)))
|
|
|
|
|
(string-trim-right
|
|
|
|
|
(catch 'parser-error
|
|
|
|
|
(lambda ()
|
|
|
|
|
(texi->plain-text body))
|
|
|
|
|
(lambda _
|
|
|
|
|
;; When Texinfo markup is invalid, display it as-is.
|
|
|
|
|
(fill-paragraph body (%text-width))))))
|
|
|
|
|
4))))
|
2019-09-15 11:57:10 -04:00
|
|
|
|
|
|
|
|
|
(define* (display-channel-specific-news new old
|
2019-09-21 17:00:07 -04:00
|
|
|
|
#:key (port (current-output-port))
|
|
|
|
|
concise?)
|
2019-09-15 11:57:10 -04:00
|
|
|
|
"Display channel news applicable the commits between OLD and NEW, where OLD
|
2019-09-21 17:00:07 -04:00
|
|
|
|
and NEW are <channel> records with a proper 'commit' field. When CONCISE? is
|
|
|
|
|
true, display nothing but the news titles. Return true if there are more news
|
|
|
|
|
to display."
|
2019-09-15 11:57:10 -04:00
|
|
|
|
(let ((channel new)
|
|
|
|
|
(old (channel-commit old))
|
|
|
|
|
(new (channel-commit new)))
|
|
|
|
|
(when (and old new)
|
|
|
|
|
(let ((language (current-message-language)))
|
|
|
|
|
(match (channel-news-for-commit channel new old)
|
|
|
|
|
(() ;no news is good news
|
2019-09-21 17:00:07 -04:00
|
|
|
|
#f)
|
2019-09-15 11:57:10 -04:00
|
|
|
|
((entries ...)
|
|
|
|
|
(newline port)
|
|
|
|
|
(format port (G_ "News for channel '~a'~%")
|
|
|
|
|
(channel-name channel))
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(for-each (if concise?
|
|
|
|
|
(cut display-news-entry-title <> language port)
|
2019-11-28 08:22:16 -05:00
|
|
|
|
(cut display-news-entry <> channel language port))
|
2019-09-21 17:00:07 -04:00
|
|
|
|
entries)
|
|
|
|
|
(newline port)
|
|
|
|
|
#t))))))
|
2019-09-15 11:57:10 -04:00
|
|
|
|
|
2019-09-15 17:55:19 -04:00
|
|
|
|
(define* (display-channel-news profile
|
|
|
|
|
#:optional
|
|
|
|
|
(previous
|
|
|
|
|
(and=> (relative-generation profile -1)
|
|
|
|
|
(cut generation-file-name profile <>))))
|
|
|
|
|
"Display news about the channels of PROFILE compared to PREVIOUS."
|
2019-09-14 08:59:58 -04:00
|
|
|
|
(when previous
|
|
|
|
|
(let ((old-channels (profile-channels previous))
|
|
|
|
|
(new-channels (profile-channels profile)))
|
|
|
|
|
(and (pair? old-channels) (pair? new-channels)
|
|
|
|
|
(begin
|
|
|
|
|
(match (lset-difference channel=? new-channels old-channels)
|
|
|
|
|
(()
|
|
|
|
|
#t)
|
|
|
|
|
(new
|
|
|
|
|
(let ((count (length new)))
|
|
|
|
|
(format (current-error-port)
|
2019-10-01 04:46:16 -04:00
|
|
|
|
(N_ " ~a new channel:~%"
|
2019-09-14 08:59:58 -04:00
|
|
|
|
" ~a new channels:~%" count)
|
|
|
|
|
count)
|
|
|
|
|
(for-each display-channel new))))
|
|
|
|
|
(match (lset-difference channel=? old-channels new-channels)
|
|
|
|
|
(()
|
|
|
|
|
#t)
|
|
|
|
|
(removed
|
|
|
|
|
(let ((count (length removed)))
|
|
|
|
|
(format (current-error-port)
|
2019-10-01 11:06:58 -04:00
|
|
|
|
(N_ " ~a channel removed:~%"
|
2019-09-14 08:59:58 -04:00
|
|
|
|
" ~a channels removed:~%" count)
|
|
|
|
|
count)
|
2019-09-15 11:57:10 -04:00
|
|
|
|
(for-each display-channel removed))))
|
|
|
|
|
|
|
|
|
|
;; Display channel-specific news for those channels that were
|
|
|
|
|
;; here before and are still around afterwards.
|
|
|
|
|
(for-each (match-lambda
|
|
|
|
|
((new old)
|
|
|
|
|
(display-channel-specific-news new old)))
|
|
|
|
|
(filter-map (lambda (new)
|
|
|
|
|
(define old
|
|
|
|
|
(find (cut channel=? new <>)
|
|
|
|
|
old-channels))
|
|
|
|
|
|
|
|
|
|
(and old (list new old)))
|
|
|
|
|
new-channels)))))))
|
2019-09-14 08:59:58 -04:00
|
|
|
|
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(define* (display-channel-news-headlines profile)
|
|
|
|
|
"Display the titles of news about the channels of PROFILE compared to its
|
|
|
|
|
previous generation. Return true if there are news to display."
|
|
|
|
|
(define previous
|
|
|
|
|
(and=> (relative-generation profile -1)
|
|
|
|
|
(cut generation-file-name profile <>)))
|
|
|
|
|
|
|
|
|
|
(when previous
|
|
|
|
|
(let ((old-channels (profile-channels previous))
|
|
|
|
|
(new-channels (profile-channels profile)))
|
|
|
|
|
;; Find the channels present in both PROFILE and PREVIOUS, and print
|
|
|
|
|
;; their news.
|
|
|
|
|
(and (pair? old-channels) (pair? new-channels)
|
|
|
|
|
(let ((channels (filter-map (lambda (new)
|
|
|
|
|
(define old
|
|
|
|
|
(find (cut channel=? new <>)
|
|
|
|
|
old-channels))
|
|
|
|
|
|
|
|
|
|
(and old (list new old)))
|
|
|
|
|
new-channels)))
|
|
|
|
|
(define more?
|
|
|
|
|
(map (match-lambda
|
|
|
|
|
((new old)
|
|
|
|
|
(display-channel-specific-news new old
|
|
|
|
|
#:concise? #t)))
|
|
|
|
|
channels))
|
|
|
|
|
|
|
|
|
|
(any ->bool more?))))))
|
|
|
|
|
|
2019-09-14 08:59:58 -04:00
|
|
|
|
(define (display-news profile)
|
|
|
|
|
;; Display profile news, with the understanding that this process represents
|
|
|
|
|
;; the newest generation.
|
|
|
|
|
(display-profile-news profile
|
|
|
|
|
#:current-is-newer? #t)
|
|
|
|
|
|
|
|
|
|
(display-channel-news profile))
|
|
|
|
|
|
2020-03-19 05:42:28 -04:00
|
|
|
|
(define* (build-and-install instances profile)
|
2018-11-05 16:52:19 -05:00
|
|
|
|
"Build the tool from SOURCE, and install it in PROFILE. When DRY-RUN? is
|
|
|
|
|
true, display what would be built without actually building it."
|
2018-05-30 11:50:21 -04:00
|
|
|
|
(define update-profile
|
|
|
|
|
(store-lift build-and-use-profile))
|
|
|
|
|
|
2019-05-09 11:31:44 -04:00
|
|
|
|
(define guix-command
|
|
|
|
|
;; The 'guix' command before we've built the new profile.
|
|
|
|
|
(which "guix"))
|
|
|
|
|
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(mlet %store-monad ((manifest (channel-instances->manifest instances)))
|
2018-07-13 10:59:15 -04:00
|
|
|
|
(mbegin %store-monad
|
2018-11-05 16:52:19 -05:00
|
|
|
|
(update-profile profile manifest
|
2020-03-19 05:42:28 -04:00
|
|
|
|
#:hooks %channel-profile-hooks)
|
|
|
|
|
|
|
|
|
|
(return
|
|
|
|
|
(let ((more? (list (display-profile-news profile #:concise? #t)
|
|
|
|
|
(display-channel-news-headlines profile))))
|
|
|
|
|
(newline)
|
|
|
|
|
(when (any ->bool more?)
|
|
|
|
|
(display-hint
|
|
|
|
|
(G_ "Run @command{guix pull --news} to read all the news.")))))
|
|
|
|
|
(if guix-command
|
|
|
|
|
(let ((new (map (cut string-append <> "/bin/guix")
|
|
|
|
|
(list (user-friendly-profile profile)
|
|
|
|
|
profile))))
|
|
|
|
|
;; Is the 'guix' command previously in $PATH the same as the new
|
|
|
|
|
;; one? If the answer is "no", then suggest 'hash guix'.
|
|
|
|
|
(unless (member guix-command new)
|
|
|
|
|
(display-hint (format #f (G_ "After setting @code{PATH}, run
|
2019-01-18 08:59:59 -05:00
|
|
|
|
@command{hash guix} to make sure your shell refers to @file{~a}.")
|
2020-03-19 05:42:28 -04:00
|
|
|
|
(first new))))
|
|
|
|
|
(return #f))
|
|
|
|
|
(return #f)))))
|
2014-09-18 12:42:39 -04:00
|
|
|
|
|
2017-07-28 11:38:19 -04:00
|
|
|
|
(define (honor-lets-encrypt-certificates! store)
|
|
|
|
|
"Tell Guile-Git to use the Let's Encrypt certificates."
|
|
|
|
|
(let* ((drv (package-derivation store le-certs))
|
|
|
|
|
(certs (string-append (derivation->output-path drv)
|
|
|
|
|
"/etc/ssl/certs")))
|
|
|
|
|
(build-derivations store (list drv))
|
2018-09-18 17:12:30 -04:00
|
|
|
|
(set-tls-certificate-locations! certs)))
|
2017-07-28 11:38:19 -04:00
|
|
|
|
|
2018-09-18 17:19:18 -04:00
|
|
|
|
(define (honor-x509-certificates store)
|
|
|
|
|
"Use the right X.509 certificates for Git checkouts over HTTPS."
|
2019-02-08 04:31:23 -05:00
|
|
|
|
(unless (honor-system-x509-certificates!)
|
|
|
|
|
(honor-lets-encrypt-certificates! store)))
|
2018-09-18 17:19:18 -04:00
|
|
|
|
|
2017-07-28 11:38:19 -04:00
|
|
|
|
(define (report-git-error error)
|
|
|
|
|
"Report the given Guile-Git error."
|
|
|
|
|
;; Prior to Guile-Git commit b6b2760c2fd6dfaa5c0fedb43eeaff06166b3134,
|
|
|
|
|
;; errors would be represented by integers.
|
|
|
|
|
(match error
|
|
|
|
|
((? integer? error) ;old Guile-Git
|
|
|
|
|
(leave (G_ "Git error ~a~%") error))
|
|
|
|
|
((? git-error? error) ;new Guile-Git
|
|
|
|
|
(leave (G_ "Git error: ~a~%") (git-error-message error)))))
|
|
|
|
|
|
|
|
|
|
(define-syntax-rule (with-git-error-handling body ...)
|
|
|
|
|
(catch 'git-error
|
|
|
|
|
(lambda ()
|
|
|
|
|
body ...)
|
|
|
|
|
(lambda (key err)
|
|
|
|
|
(report-git-error err))))
|
|
|
|
|
|
2018-10-09 05:51:44 -04:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Profile.
|
|
|
|
|
;;;
|
|
|
|
|
|
|
|
|
|
(define %current-profile
|
|
|
|
|
;; The "real" profile under /var/guix.
|
|
|
|
|
(string-append %profile-directory "/current-guix"))
|
|
|
|
|
|
|
|
|
|
(define %user-profile-directory
|
|
|
|
|
;; The user-friendly name of %CURRENT-PROFILE.
|
|
|
|
|
(string-append (config-directory #:ensure? #f) "/current"))
|
|
|
|
|
|
|
|
|
|
(define (migrate-generations profile directory)
|
2018-10-12 09:11:50 -04:00
|
|
|
|
"Migrate the generations of PROFILE to DIRECTORY."
|
2018-10-09 05:51:44 -04:00
|
|
|
|
(format (current-error-port)
|
|
|
|
|
(G_ "Migrating profile generations to '~a'...~%")
|
|
|
|
|
%profile-directory)
|
2018-10-12 10:43:18 -04:00
|
|
|
|
(let ((current (generation-number profile)))
|
2018-10-11 17:53:18 -04:00
|
|
|
|
(for-each (lambda (generation)
|
|
|
|
|
(let ((source (generation-file-name profile generation))
|
|
|
|
|
(target (string-append directory "/current-guix-"
|
|
|
|
|
(number->string generation)
|
|
|
|
|
"-link")))
|
2018-10-12 09:11:50 -04:00
|
|
|
|
;; Note: Don't use 'rename-file' as SOURCE and TARGET might
|
|
|
|
|
;; live on different file systems.
|
|
|
|
|
(symlink (readlink source) target)
|
|
|
|
|
(delete-file source)))
|
2018-10-11 17:53:18 -04:00
|
|
|
|
(profile-generations profile))
|
2018-10-12 10:43:18 -04:00
|
|
|
|
(symlink (string-append "current-guix-"
|
|
|
|
|
(number->string current) "-link")
|
|
|
|
|
(string-append directory "/current-guix"))))
|
2018-10-09 05:51:44 -04:00
|
|
|
|
|
|
|
|
|
(define (ensure-default-profile)
|
|
|
|
|
(ensure-profile-directory)
|
|
|
|
|
|
|
|
|
|
;; In 0.15.0+ we'd create ~/.config/guix/current-[0-9]*-link symlinks. Move
|
|
|
|
|
;; them to %PROFILE-DIRECTORY.
|
2019-09-18 16:59:13 -04:00
|
|
|
|
;;
|
|
|
|
|
;; XXX: Ubuntu's 'sudo' preserves $HOME by default, and thus the second
|
|
|
|
|
;; condition below is always false when one runs "sudo guix pull". As a
|
|
|
|
|
;; workaround, skip this code when $SUDO_USER is set. See
|
|
|
|
|
;; <https://bugs.gnu.org/36785>.
|
|
|
|
|
(unless (or (getenv "SUDO_USER")
|
|
|
|
|
(string=? %profile-directory
|
|
|
|
|
(dirname
|
|
|
|
|
(canonicalize-profile %user-profile-directory))))
|
2018-10-09 05:51:44 -04:00
|
|
|
|
(migrate-generations %user-profile-directory %profile-directory))
|
|
|
|
|
|
|
|
|
|
;; Make sure ~/.config/guix/current points to /var/guix/profiles/….
|
|
|
|
|
(let ((link %user-profile-directory))
|
|
|
|
|
(unless (equal? (false-if-exception (readlink link))
|
|
|
|
|
%current-profile)
|
|
|
|
|
(catch 'system-error
|
|
|
|
|
(lambda ()
|
|
|
|
|
(false-if-exception (delete-file link))
|
|
|
|
|
(symlink %current-profile link))
|
|
|
|
|
(lambda args
|
|
|
|
|
(leave (G_ "while creating symlink '~a': ~a~%")
|
|
|
|
|
link (strerror (system-error-errno args))))))))
|
|
|
|
|
|
2018-06-13 17:39:24 -04:00
|
|
|
|
|
|
|
|
|
;;;
|
|
|
|
|
;;; Queries.
|
|
|
|
|
;;;
|
|
|
|
|
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(define profile-package-alist
|
|
|
|
|
(mlambda (profile)
|
|
|
|
|
"Return a name/version alist representing the packages in PROFILE."
|
2019-02-12 16:09:07 -05:00
|
|
|
|
(let* ((inferior (open-inferior profile))
|
|
|
|
|
(packages (inferior-available-packages inferior)))
|
|
|
|
|
(close-inferior inferior)
|
|
|
|
|
packages)))
|
2018-07-10 10:06:32 -04:00
|
|
|
|
|
2019-02-12 16:35:28 -05:00
|
|
|
|
(define (new/upgraded-packages alist1 alist2)
|
|
|
|
|
"Compare ALIST1 and ALIST2, both of which are lists of package name/version
|
|
|
|
|
pairs, and return two values: the list of packages new in ALIST2, and the list
|
|
|
|
|
of packages upgraded in ALIST2."
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(let* ((old (fold (match-lambda*
|
|
|
|
|
(((name . version) table)
|
2019-02-12 16:51:23 -05:00
|
|
|
|
(match (vhash-assoc name table)
|
|
|
|
|
(#f
|
|
|
|
|
(vhash-cons name version table))
|
|
|
|
|
((_ . previous-version)
|
|
|
|
|
(if (version>? version previous-version)
|
|
|
|
|
(vhash-cons name version table)
|
|
|
|
|
table)))))
|
2018-07-10 10:06:32 -04:00
|
|
|
|
vlist-null
|
|
|
|
|
alist1))
|
|
|
|
|
(new (remove (match-lambda
|
|
|
|
|
((name . _)
|
|
|
|
|
(vhash-assoc name old)))
|
|
|
|
|
alist2))
|
|
|
|
|
(upgraded (filter-map (match-lambda
|
|
|
|
|
((name . new-version)
|
2019-02-12 16:51:23 -05:00
|
|
|
|
(match (vhash-assoc name old)
|
|
|
|
|
(#f #f)
|
|
|
|
|
((_ . old-version)
|
|
|
|
|
(and (version>? new-version old-version)
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(string-append name "@"
|
|
|
|
|
new-version))))))
|
|
|
|
|
alist2)))
|
2019-02-12 16:35:28 -05:00
|
|
|
|
(values new upgraded)))
|
|
|
|
|
|
2019-03-28 11:17:11 -04:00
|
|
|
|
(define* (ellipsis #:optional (port (current-output-port)))
|
|
|
|
|
"Return HORIZONTAL ELLIPSIS three dots if PORT's encoding cannot represent
|
|
|
|
|
it."
|
|
|
|
|
(match (port-encoding port)
|
|
|
|
|
("UTF-8" "…")
|
|
|
|
|
(_ "...")))
|
|
|
|
|
|
2019-02-12 16:35:28 -05:00
|
|
|
|
(define* (display-new/upgraded-packages alist1 alist2
|
2019-03-28 11:17:11 -04:00
|
|
|
|
#:key (heading "") concise?)
|
2019-02-12 16:35:28 -05:00
|
|
|
|
"Given the two package name/version alists ALIST1 and ALIST2, display the
|
|
|
|
|
list of new and upgraded packages going from ALIST1 to ALIST2. When ALIST1
|
2019-03-28 11:17:11 -04:00
|
|
|
|
and ALIST2 differ, display HEADING upfront. When CONCISE? is true, do not
|
2019-09-21 17:00:07 -04:00
|
|
|
|
display long package lists that would fill the user's screen.
|
|
|
|
|
|
|
|
|
|
Return true when there is more package info to display."
|
2019-03-28 10:55:47 -04:00
|
|
|
|
(define (pretty str column)
|
|
|
|
|
(indented-string (fill-paragraph str (- (%text-width) 4)
|
|
|
|
|
column)
|
2020-03-20 07:44:43 -04:00
|
|
|
|
4 #:initial-indent? #f))
|
2019-03-28 10:55:47 -04:00
|
|
|
|
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(define concise/max-item-count
|
|
|
|
|
;; Maximum number of items to display when CONCISE? is true.
|
|
|
|
|
12)
|
|
|
|
|
|
2019-03-28 11:17:11 -04:00
|
|
|
|
(define list->enumeration
|
|
|
|
|
(if concise?
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(lambda* (lst #:optional (max concise/max-item-count))
|
2019-03-28 11:17:11 -04:00
|
|
|
|
(if (> (length lst) max)
|
|
|
|
|
(string-append (string-join (take lst max) ", ")
|
|
|
|
|
", " (ellipsis))
|
|
|
|
|
(string-join lst ", ")))
|
|
|
|
|
(cut string-join <> ", ")))
|
|
|
|
|
|
2019-02-12 16:35:28 -05:00
|
|
|
|
(let-values (((new upgraded) (new/upgraded-packages alist1 alist2)))
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(define new-count (length new))
|
|
|
|
|
(define upgraded-count (length upgraded))
|
|
|
|
|
|
2018-07-13 10:59:15 -04:00
|
|
|
|
(unless (and (null? new) (null? upgraded))
|
|
|
|
|
(display heading))
|
|
|
|
|
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(match new-count
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(0 #t)
|
|
|
|
|
(count
|
|
|
|
|
(format #t (N_ " ~h new package: ~a~%"
|
|
|
|
|
" ~h new packages: ~a~%" count)
|
|
|
|
|
count
|
2019-03-28 11:17:11 -04:00
|
|
|
|
(pretty (list->enumeration (sort (map first new) string<?))
|
2019-03-28 10:55:47 -04:00
|
|
|
|
30))))
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(match upgraded-count
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(0 #t)
|
|
|
|
|
(count
|
|
|
|
|
(format #t (N_ " ~h package upgraded: ~a~%"
|
|
|
|
|
" ~h packages upgraded: ~a~%" count)
|
|
|
|
|
count
|
2019-03-28 11:17:11 -04:00
|
|
|
|
(pretty (list->enumeration (sort upgraded string<?))
|
2019-04-21 15:26:06 -04:00
|
|
|
|
35))))
|
|
|
|
|
|
2019-09-21 17:00:07 -04:00
|
|
|
|
(and concise?
|
|
|
|
|
(or (> new-count concise/max-item-count)
|
|
|
|
|
(> upgraded-count concise/max-item-count)))))
|
2018-07-10 10:06:32 -04:00
|
|
|
|
|
|
|
|
|
(define (display-profile-content-diff profile gen1 gen2)
|
|
|
|
|
"Display the changes in PROFILE GEN2 compared to generation GEN1."
|
|
|
|
|
(define (package-alist generation)
|
|
|
|
|
(profile-package-alist (generation-file-name profile generation)))
|
|
|
|
|
|
|
|
|
|
(display-profile-content profile gen2)
|
|
|
|
|
(display-new/upgraded-packages (package-alist gen1)
|
|
|
|
|
(package-alist gen2)))
|
|
|
|
|
|
2018-10-09 04:52:39 -04:00
|
|
|
|
(define (process-query opts profile)
|
|
|
|
|
"Process any query on PROFILE specified by OPTS."
|
2018-06-13 17:39:24 -04:00
|
|
|
|
(match (assoc-ref opts 'query)
|
|
|
|
|
(('list-generations pattern)
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(define (list-generations profile numbers)
|
|
|
|
|
(match numbers
|
|
|
|
|
((first rest ...)
|
|
|
|
|
(display-profile-content profile first)
|
|
|
|
|
(let loop ((numbers numbers))
|
|
|
|
|
(match numbers
|
|
|
|
|
((first second rest ...)
|
|
|
|
|
(display-profile-content-diff profile
|
|
|
|
|
first second)
|
2019-09-15 17:55:19 -04:00
|
|
|
|
(display-channel-news (generation-file-name profile second)
|
|
|
|
|
(generation-file-name profile first))
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(loop (cons second rest)))
|
|
|
|
|
((_) #t)
|
|
|
|
|
(() #t))))))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
|
|
|
|
|
(leave-on-EPIPE
|
|
|
|
|
(cond ((not (file-exists? profile)) ; XXX: race condition
|
|
|
|
|
(raise (condition (&profile-not-found-error
|
|
|
|
|
(profile profile)))))
|
2019-07-10 13:58:30 -04:00
|
|
|
|
((not pattern)
|
2018-07-10 10:06:32 -04:00
|
|
|
|
(list-generations profile (profile-generations profile)))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
((matching-generations pattern profile)
|
|
|
|
|
=>
|
|
|
|
|
(match-lambda
|
|
|
|
|
(()
|
|
|
|
|
(exit 1))
|
|
|
|
|
((numbers ...)
|
2019-04-21 15:26:06 -04:00
|
|
|
|
(list-generations profile numbers)))))))
|
|
|
|
|
(('display-news)
|
2019-09-14 08:59:58 -04:00
|
|
|
|
(display-news profile))))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
|
2019-09-18 03:52:18 -04:00
|
|
|
|
(define (process-generation-change opts profile)
|
|
|
|
|
"Process a request to change the current generation (roll-back, switch, delete)."
|
|
|
|
|
(unless (assoc-ref opts 'dry-run?)
|
|
|
|
|
(match (assoc-ref opts 'generation)
|
|
|
|
|
(('roll-back)
|
|
|
|
|
(with-store store
|
|
|
|
|
(roll-back* store profile)))
|
|
|
|
|
(('switch pattern)
|
|
|
|
|
(let ((number (relative-generation-spec->number profile pattern)))
|
|
|
|
|
(if number
|
|
|
|
|
(switch-to-generation* profile number)
|
|
|
|
|
(leave (G_ "cannot switch to generation '~a'~%") pattern))))
|
|
|
|
|
(('delete pattern)
|
|
|
|
|
(with-store store
|
|
|
|
|
(delete-matching-generations store profile pattern))))))
|
|
|
|
|
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(define (channel-list opts)
|
|
|
|
|
"Return the list of channels to use. If OPTS specify a channel file,
|
|
|
|
|
channels are read from there; otherwise, if ~/.config/guix/channels.scm
|
|
|
|
|
exists, read it; otherwise %DEFAULT-CHANNELS is used. Apply channel
|
|
|
|
|
transformations specified in OPTS (resulting from '--url', '--commit', or
|
|
|
|
|
'--branch'), if any."
|
|
|
|
|
(define file
|
|
|
|
|
(assoc-ref opts 'channel-file))
|
|
|
|
|
|
|
|
|
|
(define default-file
|
|
|
|
|
(string-append (config-directory) "/channels.scm"))
|
|
|
|
|
|
2019-10-22 12:05:51 -04:00
|
|
|
|
(define global-file
|
|
|
|
|
(string-append %sysconfdir "/guix/channels.scm"))
|
|
|
|
|
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(define (load-channels file)
|
|
|
|
|
(let ((result (load* file (make-user-module '((guix channels))))))
|
|
|
|
|
(if (and (list? result) (every channel? result))
|
|
|
|
|
result
|
|
|
|
|
(leave (G_ "'~a' did not return a list of channels~%") file))))
|
|
|
|
|
|
|
|
|
|
(define channels
|
|
|
|
|
(cond (file
|
|
|
|
|
(load-channels file))
|
|
|
|
|
((file-exists? default-file)
|
|
|
|
|
(load-channels default-file))
|
2019-10-22 12:05:51 -04:00
|
|
|
|
((file-exists? global-file)
|
|
|
|
|
(load-channels global-file))
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(else
|
|
|
|
|
%default-channels)))
|
|
|
|
|
|
|
|
|
|
(define (environment-variable)
|
|
|
|
|
(match (getenv "GUIX_PULL_URL")
|
|
|
|
|
(#f #f)
|
|
|
|
|
(url
|
|
|
|
|
(warning (G_ "The 'GUIX_PULL_URL' environment variable is deprecated.
|
|
|
|
|
Use '~/.config/guix/channels.scm' instead."))
|
|
|
|
|
url)))
|
|
|
|
|
|
|
|
|
|
(let ((ref (assoc-ref opts 'ref))
|
|
|
|
|
(url (or (assoc-ref opts 'repository-url)
|
|
|
|
|
(environment-variable))))
|
|
|
|
|
(if (or ref url)
|
2019-04-17 07:56:40 -04:00
|
|
|
|
(match (find guix-channel? channels)
|
|
|
|
|
((? channel? guix)
|
|
|
|
|
;; Apply '--url', '--commit', and '--branch' to the 'guix' channel.
|
|
|
|
|
(let ((url (or url (channel-url guix))))
|
|
|
|
|
(cons (match ref
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(('commit . commit)
|
2019-04-17 07:56:40 -04:00
|
|
|
|
(channel (inherit guix)
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(url url) (commit commit) (branch #f)))
|
|
|
|
|
(('branch . branch)
|
2019-04-17 07:56:40 -04:00
|
|
|
|
(channel (inherit guix)
|
2018-08-27 12:05:49 -04:00
|
|
|
|
(url url) (commit #f) (branch branch)))
|
|
|
|
|
(#f
|
2019-04-17 07:56:40 -04:00
|
|
|
|
(channel (inherit guix) (url url))))
|
|
|
|
|
(remove guix-channel? channels))))
|
|
|
|
|
(#f ;no 'guix' channel, failure will ensue
|
|
|
|
|
channels))
|
2018-08-27 12:05:49 -04:00
|
|
|
|
channels)))
|
|
|
|
|
|
2017-05-09 09:45:04 -04:00
|
|
|
|
|
2013-02-20 17:46:38 -05:00
|
|
|
|
(define (guix-pull . args)
|
2013-03-07 13:29:12 -05:00
|
|
|
|
(with-error-handling
|
2017-07-28 11:38:19 -04:00
|
|
|
|
(with-git-error-handling
|
2020-03-19 05:42:28 -04:00
|
|
|
|
(let* ((opts (parse-command-line args %options
|
|
|
|
|
(list %default-options)))
|
|
|
|
|
(substitutes? (assoc-ref opts 'substitutes?))
|
|
|
|
|
(dry-run? (assoc-ref opts 'dry-run?))
|
|
|
|
|
(channels (channel-list opts))
|
|
|
|
|
(profile (or (assoc-ref opts 'profile) %current-profile)))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
(cond ((assoc-ref opts 'query)
|
2018-10-09 04:52:39 -04:00
|
|
|
|
(process-query opts profile))
|
2019-09-18 03:52:18 -04:00
|
|
|
|
((assoc-ref opts 'generation)
|
|
|
|
|
(process-generation-change opts profile))
|
2018-06-13 17:39:24 -04:00
|
|
|
|
(else
|
|
|
|
|
(with-store store
|
guix build: Re-purpose '--verbosity' and add '--debug'.
The previous '--verbosity' option was misleading and rarely what users
were looking for. The new option provides a consistent way to choose
whether or not to display the build log.
* guix/scripts/build.scm (show-build-options-help): Remove "--verbosity"
and add "--debug".
(set-build-options-from-command-line): Use the 'debug key of OPTS for
#:verbosity.
(%standard-build-options): Change "verbosity" to "debug". Use
'string->number*' instead of 'string->number'.
(%default-options): Change 'verbosity to 'debug and add a 'verbosity
key.
(show-help): Add '--verbosity'.
(%options): Likewise, and change '--quiet' to set the 'verbosity key of
RESULT.
(guix-build): Use 'with-status-verbosity' instead of parameterizing
CURRENT-BUILD-OUTPUT-PORT, honor the 'verbosity key of OPTS, and remove
'quiet?'.
* guix/scripts/environment.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug'.
(guix-environment): Honor the 'verbosity key of OPTS.
* guix/scripts/pack.scm (%default-options): Add 'debug.
(%options, show-help): Add '--verbosity'.
(guix-pack): Honor the 'verbosity key of OPTS.
* guix/scripts/package.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'. Mark '--verbose' as
deprecated and change it to set 'verbosity.
(guix-package): Honor the 'verbosity key of OPTS and remove 'verbose?'.
* guix/scripts/pull.scm (%default-options): Add 'debug.
(show-help, %options): Add '--verbosity'.
(guix-pull): Honor the 'verbosity key of OPTS.
* guix/scripts/system.scm (show-help, %options): Add '--verbosity'.
(%default-options): Add 'debug.
(guix-system): Honor the 'verbosity key of OPTS.
* guix/scripts/archive.scm (%default-options): Add 'debug,
'print-build-trace?, 'print-extended-build-trace?, and
'multiplexed-build-output?.
(show-help, %options): Add '--verbosity'.
(export-from-store): Remove call to 'set-build-options-from-command-line'.
(guix-archive): Wrap body in 'with-status-verbosity'. Add call to
'set-build-options-from-command-line.
* doc/guix.texi (Common Build Options): Document '--verbosity' and
'--debug'.
(Additional Build Options): Adjust description of '--quiet'.
2019-01-09 08:17:19 -05:00
|
|
|
|
(with-status-verbosity (assoc-ref opts 'verbosity)
|
2018-12-27 05:54:55 -05:00
|
|
|
|
(parameterize ((%current-system (assoc-ref opts 'system))
|
2019-09-23 17:38:59 -04:00
|
|
|
|
(%graft? (assoc-ref opts 'graft?)))
|
2020-03-19 05:42:28 -04:00
|
|
|
|
(with-build-handler (build-notifier #:use-substitutes?
|
|
|
|
|
substitutes?
|
|
|
|
|
#:dry-run? dry-run?)
|
|
|
|
|
(set-build-options-from-command-line store opts)
|
|
|
|
|
(ensure-default-profile)
|
|
|
|
|
(honor-x509-certificates store)
|
|
|
|
|
|
|
|
|
|
(let ((instances (latest-channel-instances store channels)))
|
|
|
|
|
(format (current-error-port)
|
|
|
|
|
(N_ "Building from this channel:~%"
|
|
|
|
|
"Building from these channels:~%"
|
|
|
|
|
(length instances)))
|
|
|
|
|
(for-each (lambda (instance)
|
|
|
|
|
(let ((channel
|
|
|
|
|
(channel-instance-channel instance)))
|
|
|
|
|
(format (current-error-port)
|
|
|
|
|
" ~10a~a\t~a~%"
|
|
|
|
|
(channel-name channel)
|
|
|
|
|
(channel-url channel)
|
|
|
|
|
(string-take
|
|
|
|
|
(channel-instance-commit instance)
|
|
|
|
|
7))))
|
|
|
|
|
instances)
|
|
|
|
|
(parameterize ((%guile-for-build
|
|
|
|
|
(package-derivation
|
|
|
|
|
store
|
|
|
|
|
(if (assoc-ref opts 'bootstrap?)
|
|
|
|
|
%bootstrap-guile
|
2020-03-26 19:12:15 -04:00
|
|
|
|
(default-guile)))))
|
2020-03-19 05:42:28 -04:00
|
|
|
|
(with-profile-lock profile
|
|
|
|
|
(run-with-store store
|
|
|
|
|
(build-and-install instances profile)))))))))))))))
|
2014-11-09 16:32:21 -05:00
|
|
|
|
|
|
|
|
|
;;; pull.scm ends here
|