summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* build: Change default substitute server to "ci.guix.gnu.org".Ludovic Courtès2019-05-01
| | | | | | | | | | | * config-daemon.ac: Replace "ci.guix.info" with "ci.guix.gnu.org". * doc/guix.texi (SUBSTITUTE-SERVER): Likewise. * etc/substitutes/ci.guix.gnu.org.pub: New file. * Makefile.am (dist_pkgdata_DATA): Add it. * guix/scripts/build.scm (%default-log-urls): Update. * guix/scripts/substitute.scm (%default-substitute-urls): Likewise. * guix/store.scm (%default-substitute-urls): Likewise. * guix/self.scm (miscellaneous-files): Add "ci.guix.gnu.org".
* processes: Gracefully handle daemons without clients.Ludovic Courtès2019-04-29
| | | | | | | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/34716>. Reported by Mark H Weaver <mhw@netris.org>. The problem could be reproduced by running, on one hand: sh -c 'exec -a guix-daemon sleep 777' and on the other hand: guix processes If there is no process with PID 777, 'guix processes' would barf as it stumbles upon a <daemon-session> record whose client is #f. * guix/scripts/processes.scm (daemon-sessions)[child-process->session]: New procedure, with lambda formerly passed to 'map'. Handle #f returns from 'lookup-process'. Call 'child-process->session' within 'filter-map', not just 'map'.
* processes: 'process-open-files' ignores disappeared /proc/PID/fd entries.Ludovic Courtès2019-04-29
| | | | | | | | Previously, 'process-open-files' would throw ENOENT if an entry had vanished after the 'scandir' call and before the 'readlink' call. * guix/scripts/processes.scm (process-open-files): Catch ENOENT errors from 'readlink'.
* guix package: Add 'guix search' alias.Ludovic Courtès2019-04-29
| | | | | | | | | * guix/scripts/search.scm: New file. * Makefile.am (MODULES): Add it. * po/guix/POTFILES.in: Add it. * tests/guix-package-aliases.sh: Add test. * doc/guix.texi (Invoking guix package): Document it and use it in a couple of examples.
* guix package: Add 'install', 'remove', and 'upgrade' aliases.Ludovic Courtès2019-04-29
| | | | | | | | | | | | | | | | * 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. * etc/completion/bash/guix (_guix_complete): Handle "install", "remove", and "upgrade".
* describe: Provide a hint when origin detection fails.Ludovic Courtès2019-04-28
| | | | | * guix/scripts/describe.scm (display-checkout-info): Add call to 'display-hint' in the error case.
* guix system: Compute 'bootcfg' only for 'init' and 'reconfigure'.Ludovic Courtès2019-04-23
| | | | | | | | | | | | Previously, 'guix system vm' would start by computing the bootcfg derivation, which itself depended on an incorrect OS derivation (for the original OS instead of the one passed through 'virtualized-operating-system'.) That added overhead and would force the user's config file to define a root file system, for example, even though it makes no sense in the case of a VM. * guix/scripts/system.scm (perform-action)[bootcfg]: Limit to the 'init' and 'reconfigure' actions.
* pull: Create profile after the store connection has been opened.Ludovic Courtès2019-04-22
| | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/35341>. Reported by Florian Pelz <pelzflorian@pelzflorian.de>. Previously, we'd call 'ensure-default-profile' before the connection to the daemon has been opened. On the first connection, the daemon ensures that /var/guix/profiles/per-user is world-writable. Since we were calling 'ensure-default-profile' before that, /var/guix/profiles/per-user was typically non-writable (555 and root-owned), and thus 'guix pull' would error out. * guix/scripts/pull.scm (guix-pull): Call 'ensure-default-profile' within 'with-store'.
* pull: Add '--news'.Ludovic Courtès2019-04-22
| | | | | | | | | | | | | Suggested by Tobias Geerinckx-Rice <me@tobias.gr>. * guix/scripts/pull.scm (%options, show-help): Add '--news'. (display-profile-news): Add #:current-is-newer? and #:concise?. Honor them. (build-and-install): Pass #:concise? #t. (display-new/upgraded-packages)[concise/max-item-count]: New variable. Add call to 'display-hint'. (process-query): Add clause for 'display-news'. * doc/guix.texi (Invoking guix pull): Add '--news'.
* guix build: Accept multiple '-s' options.Ludovic Courtès2019-04-19
| | | | | | | | | | | * guix/scripts/build.scm (%default-options): Remove 'system'. (%options) <--system>: Keep previous occurrences of 'system in RESULT. (options->derivations)[system]: Remove. [systems, things-to-build]: New variables. [compute-derivation]: New procedure. Iterate on all of SYSTEMS to compute the derivations of THINGS-TO-BUILD. * tests/guix-build.sh: Add test for one and multiple '-s' flags. * doc/guix.texi (Additional Build Options): Document this behavior.
* lint: 'check-github-url' uses our own 'open-connection-for-uri'.Ludovic Courtès2019-04-18
| | | | | | | | | | | | | | | | Fixes <https://bugs.gnu.org/35053>. Reported by Efraim Flashner <efraim@flashner.co.il>. Previously 'check-github-url' would let Guile 2.2's (web client) module take care of opening the connection. Consequently, it wouldn't use the TLS priority strings that we use in (guix build download), 'open-connection-for-uri'. In particular, it would not disable TLSv1.3, which would trigger <https://bugs.gnu.org/34102> for github.com. * guix/scripts/lint.scm (check-github-url): Add #:timeout parameter. [follow-redirect]: Change parameter name to 'url' and pass it to 'string->uri'. Call 'guix:open-connection-for-uri' to open the connection and pass it to 'http-head' via #:port.
* pull: '--url', '--commit', and '--branch' apply to the 'guix' channel.Ludovic Courtès2019-04-17
| | | | | | | | Suggested by pkill9 <pkill9@runbox.com>. * guix/scripts/pull.scm (channel-list): Apply REF and URL to the 'guix' channel. * doc/guix.texi (Invoking guix pull): Adjust accordingly.
* guix build: Fix relative file name canonicalization for '--root'.Ludovic Courtès2019-04-15
| | | | | | | | | Fixes <https://bugs.gnu.org/35271>. Reported by rendaw <7e9wc56emjakcm@s.rendaw.me>. * guix/scripts/build.scm (register-root): When ROOT is a relative file name, append the basename of ROOT, not ROOT itself. * tests/guix-build.sh: Add test.
* guix gc: '-d' does not attempt to delete non-user-owned roots.Ludovic Courtès2019-04-11
| | | | | * guix/scripts/gc.scm (guix-gc)[delete-generations]: Limit to user-owned roots, unless we're running as root.
* guix gc: Add '--delete-generations'.Ludovic Courtès2019-04-10
| | | | | | | | | | * guix/scripts/gc.scm (show-help, %options): Add '--delete-generations'. Change '--delete' shorthand to '-D'. (delete-old-generations): New procedure. (guix-gc)[delete-generations]: New procedure. Call it when ACTION is 'collect-garbage' and OPTS contains 'delete-generations. * doc/guix.texi (Invoking guix gc): Document it.
* guix gc: Add '--list-roots'.Ludovic Courtès2019-04-10
| | | | | | | | * guix/scripts/gc.scm (show-help, %options): Add '--list-roots'. (guix-gc)[list-roots]: New procedure. Handle '--list-roots'. * tests/guix-gc.sh: Test it. * doc/guix.texi (Invoking guix gc): Document it.
* pull: Remove duplicate '--dry-run' description.Ludovic Courtès2019-04-10
| | | | | | | Reported by pkill9. * guix/scripts/pull.scm (show-help): Remove duplicate '--dry-run' description.
* guix package: Use absolute file names in search path recommendations.Ludovic Courtès2019-04-10
| | | | | | | Suggested by Chris Marusich. * guix/scripts/package.scm (absolutize): New procedure. (display-search-paths): Use it.
* size: Optimize dependency size computation.Ludovic Courtès2019-04-07
| | | | | | | | | | This reduces 'guix size' run time by ~4% here: items="$(guix build icecat inkscape emacs libreoffice)" guix size $items * guix/scripts/size.scm (store-profile): Define 'size-table' and use it to lookup the size of ITEM in 'dependency-size'.
* scripts: More commands default to verbosity level 1.Ludovic Courtès2019-04-04
| | | | | | | * guix/scripts/environment.scm (%default-options): Change 'verbosity' to 1. * guix/scripts/pack.scm (%default-options): Likewise. * guix/scripts/system.scm (guix-system): Likewise, except for the 'build' command.
* gexp: Remove workarounds for <https://bugs.gnu.org/15602>.Ludovic Courtès2019-04-04
| | | | | | | * gnu/services/base.scm (hydra-key-authorization)[aaa]: Remove. [default-acl]: Don't import it. * guix/scripts/pack.scm (store-database)[build]: Don't import (gnu build install).
* environment: '-C' creates namespaces where the user is not root.Ludovic Courtès2019-04-02
| | | | | | | | | * guix/scripts/environment.scm (launch-environment/container): Add UID and GID. Use them in PASSWD and GROUPS. Pass them as #:guest-uid and #:guest-gid to 'call-with-container'. * tests/guix-environment-container.sh: Test the inner UID. In '--user' test, replace hard-coded 0 with 1000. * doc/guix.texi (Invoking guix environment): Adjust accordingly.
* pull: Truncate the list of packages displayed on completion.Ludovic Courtès2019-03-28
| | | | | | | | | | | Previously, if you'd run 'guix pull' after a couple of weeks, it would fill your screen with package names, which is unhelpful. * guix/scripts/pull.scm (ellipsis): New procedure. (display-new/upgraded-packages): Add #:concise?. [list->enumeration]: New procedure. Use it instead of 'string-join'. (display-profile-news): Pass #:concise? #t.
* pull: Factorize pretty-printing for new/upgraded package lists.Ludovic Courtès2019-03-28
| | | | | | * guix/scripts/pull.scm (display-new/upgraded-packages)[pretty]: New procedure. Use it.
* refresh: Update the source code URL.Ludovic Courtès2019-03-27
| | | | | | | | | | | | | | Reported by Tobias Geerinckx-Rice <me@tobias.gr> in <https://bugs.gnu.org/35010>. * guix/upstream.scm (update-package-source): Take 'source' instead of 'version' as the second argument. [update-expression]: Change to take 'replacements', a list of replacement pairs. Compute OLD-URL and NEW-URL and replace the dirname of the OLD-URL with that of NEW-URL. * guix/scripts/refresh.scm (update-package): Adjust call to 'update-package-source' accordingly.
* upstream: 'package-update' returns the <upstream-source> object.Ludovic Courtès2019-03-27
| | | | | | | | | | | | Fixes a regression introduced in abd4d6b33dba4de228e90ad15a8efb456fcf7b6e, where CHANGES would no longer be a thunk. Reported by Ricardo Wurmus. * guix/upstream.scm (package-update/url-fetch): Return SOURCE as the third value instead of CHANGES. * guix/scripts/refresh.scm (update-package): Adjust accordingly.
* environment: Create /etc/group in containers.Ludovic Courtès2019-03-26
| | | | | | | | Reported by Pierre Neidhardt <mail@ambrevar.xyz>. * guix/scripts/environment.scm (launch-environment/container): Create GROUPS and call 'write-group'. * tests/guix-environment-container.sh: Test it.
* environment: Use (gnu build accounts) for /etc/passwd handling.Ludovic Courtès2019-03-26
| | | | | | | | | * guix/scripts/environment.scm (launch-environment/container): Remove call to 'mock-passwd'; instantiate a <password-entry> instead. Call 'write-passwd' to write the pasword database instead of using custom code. (mock-passwd): Remove. * tests/guix-environment-container.sh: Test 'getpwuid'.
* graph: Factorize calls to 'fold-packages'.Ludovic Courtès2019-03-23
| | | | | | * guix/scripts/graph.scm (all-packages): New procedure. (%reverse-package-node-type, %reverse-bag-node-type): Use 'all-packages' instead of 'fold-packages'.
* graph: Add the 'reverse-bag' graph.Ludovic Courtès2019-03-23
| | | | | | | | | Suggested by Julien Lepiller. * guix/scripts/graph.scm (%reverse-bag-node-type): New variable. (%node-types): Add it. * tests/graph.scm ("reverse bag DAG"): New test. * doc/guix.texi (Invoking guix graph): Document it.
* pack: Create an empty /home directory for '-f squashfs'.Ludovic Courtès2019-03-19
| | | | | | Fixes <https://bugs.gnu.org/34914>. * guix/scripts/pack.scm (squashfs-image)[build]: Pass "-p /home d 555 0 0".
* pack: Produce relative symlinks when using '-f squashfs'.Ludovic Courtès2019-03-19
| | | | | | | | | Fixes <https://bugs.gnu.org/34913>. * guix/scripts/pack.scm (squashfs-image)[build]: Use 'relative-file-name' when creating SYMLINKS. * guix/scripts/pack.scm (guix-pack): Pass #:relative-symlinks? #t when PACK-FORMAT is 'squashfs.
* describe: Warn about 'GUIX_PACKAGE_PATH' in json and recutils format.Ludovic Courtès2019-03-18
| | | | | | | | Fixes <https://bugs.gnu.org/34884>. Reported by Pierre Neidhardt <mail@ambrevar.xyz>. * guix/scripts/describe.scm (display-package-search-path): Add catch-all case for FMT.
* guix build: '--with-branch' strips slashes from the version string.Ludovic Courtès2019-03-17
| | | | | | | | | | | | | | | This fixes things like: guix build glibc \ --with-git-url=glibc=git://sourceware.org/git/glibc.git \ --with-branch=glibc=release/2.25/master whereby slashes would before go straight to the 'version' field, leading to an invalid store file name. * guix/scripts/build.scm (transform-package-source-branch)[replace]: Replace slashes with hyphens in BRANCH when building the version string.
* guix build: '--with-commit' makes recursive checkouts.Ludovic Courtès2019-03-17
| | | | | | | | | | This was an omission from commit 024a6bfba906742c136a47b4099f06880f1d3f15. * guix/scripts/build.scm (transform-package-source-commit): Add 'recursive?' field to SOURCE. * tests/scripts-build.scm ("options->transformation, with-branch") ("options->transformation, with-commit"): New tests.
* guix build: Transformation options match packages by spec.Ludovic Courtès2019-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to combine several transformations on a given package, in particular '--with-git-url' and '--with-branch'. Previously transformations would ignore each other since they would all take (specification->package SOURCE) as their replacement source, compare it by identity, which doesn't work if a previous transformation has already changed SOURCE. * guix/scripts/build.scm (evaluate-replacement-specs): Adjust to produce an alist as expected by 'package-input-rewriting/spec', with a package spec as the first element of each pair. (evaluate-git-replacement-specs): Likewise. (transform-package-inputs): Adjust accordingly and use 'package-input-rewriting/spec'. (transform-package-inputs/graft): Likewise. (transform-package-source-branch, transform-package-source-commit): Use 'package-input-rewriting/spec'. (transform-package-source-git-url): Likewise, and adjust the REPLACEMENTS alist accordingly. (options->transformation): Iterate over OPTS instead of over %TRANSFORMATIONS. Invoke transformations one by one. * tests/scripts-build.scm ("options->transformation, with-input"): Adjust test to compare packages by name rather than by identity. ("options->transformation, with-git-url + with-branch"): New test.
* guix build: Factorize 'package-git-url'.Ludovic Courtès2019-03-17
| | | | | * guix/scripts/build.scm (package-git-url): New procedure. (evaluate-git-replacement-specs): Use it.
* guix build: Add '--with-git-url'.Ludovic Courtès2019-03-17
| | | | | | | | | | | | * guix/scripts/build.scm (%not-equal): New variable. (evaluate-git-replacement-specs): Use it instead of local variable 'not-equal'. (transform-package-source-git-url): New procedure. (%transformations): Add 'with-git-url'. (%transformation-options, show-transformation-options-help): Add '--with-git-url'. * tests/scripts-build.scm ("options->transformation, with-git-url"): New test.
* guix system: Fix success report of the bootloader installation.Ludovic Courtès2019-03-17
| | | | | | | | | Fixes <https://bugs.gnu.org/34890>. Reported by Jack Hill <jackhill@jackhill.us>. Regression introduced in 21fcfe1ee969cc477dc41486ae4074e655d44274. * guix/scripts/system.scm (bootloader-installer-script): Ungexp DEVICE.
* guix: Match package names case-insensitively.Tobias Geerinckx-Rice2019-03-16
| | | | | * guix/scripts/package.scm (options->upgrade-predicate, process-query): Use REGEXP/ICASE when matching package names.
* bootloader: Use 'invoke/quiet' when running 'grub-install' and co.Ludovic Courtès2019-03-16
| | | | | | | | | | | This hides potentially confusing GRUB messages from the user, such as "Installing for i386-pc platform." * gnu/bootloader/extlinux.scm (install-extlinux): Use 'invoke/quiet' instead of 'system*' and 'error'. * gnu/bootloader/grub.scm (install-grub, install-grub-efi): Likewise. * guix/scripts/system.scm (bootloader-installer-script): Guard against 'message-condition?' and handle them properly.
* pack: Construct inferior package names correctly.P.C. Shyamshankar2019-03-15
| | | | | | | * guix/scripts/pack.scm (wrapped-package): now correctly constructs full names of inferior packages. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* pack: "-RR" produces PRoot-enabled relocatable binaries.Ludovic Courtès2019-03-15
| | | | | | | | | | | | | | | | * gnu/packages/aux-files/run-in-namespace.c (exec_with_proot): New function. (main): When 'clone' fails, call 'rm_rf'. [PROOT_PROGRAM]: When 'clone' fails, call 'exec_with_proot'. * guix/scripts/pack.scm (wrapped-package): Add #:proot?. [proot]: New procedure. [build]: Compile with -DPROOT_PROGRAM when PROOT? is true. * guix/scripts/pack.scm (%options): Set the 'relocatable?' value to 'proot when "-R" is passed several times. (guix-pack): Pass #:proot? to 'wrapped-package'. * tests/guix-pack-relocatable.sh: Use "-RR" on Intel systems that lack user namespace support. * doc/guix.texi (Invoking guix pack): Document -RR.
* pack: Add '--save-provenance'.Ludovic Courtès2019-03-07
| | | | | | * guix/scripts/pack.scm (show-help, %options): Add '--save-provenance'. (guix-pack)[manifest-from-args]: Honor it. * doc/guix.texi (Invoking guix pack): Document it.
* describe: Add 'package-provenance'.Ludovic Courtès2019-03-07
| | | | | * guix/scripts/package.scm (package-provenance): Move to... * guix/describe.scm (package-provenance): ... here.
* environment: Rename '--inherit' to '--preserve'.Ludovic Courtès2019-03-04
| | | | | | | | | Suggested by Eric Bavier and Ricardo Wurmus. * guix/scripts/environment.scm (show-help, %options): Emit a deprecation warning for "--inherit" and add -E/--preserve. * tests/guix-environment.sh: Adjust accordingly. * doc/guix.texi (Invoking guix environment): Update accordingly.
* environment: Remove deprecated -E/--exec option.Ludovic Courtès2019-03-04
| | | | | | * guix/scripts/environment.scm (%options): Remove "--exec", which was deprecated in commit 1de2fe95e017c42aacbaa34f5dab8d48249cc064 in 2015. * tests/guix-environment.sh: Remove use of '-E'.
* environment: Add '--inherit'.Ludovic Courtès2019-02-16
| | | | | | | | | | | | | * guix/scripts/environment.scm (purify-environment): Add 'white-list' parameter and honor it. (create-environment): Add #:white-list parameter and honor it. (launch-environment): Likewise. (launch-environment/fork): Likewise. (show-help, %options): Add '--inherit'. (guix-environment): Define 'white-list' and pass it to 'launch-environment/fork'. * tests/guix-environment.sh: Test '--inherit'. * doc/guix.texi (Invoking guix environment): Document it.
* guix system: List old generations from newest to oldest.Ludovic Courtès2019-02-13
| | | | | | | | | Previously 'guix system switch-generation' or 'delete-generations' would yield a GRUB menu where entries for old generations were in the wrong order (i.e., oldest first.) * guix/scripts/system.scm (reinstall-bootloader): Reverse the list returned by 'generation-numbers'.
* guix system: Add 'delete-generations'.Ludovic Courtès2019-02-13
| | | | | | | | * guix/scripts/package.scm (delete-matching-generations): Export. * guix/scripts/system.scm (show-help): Add 'delete-generations'. (process-command): Honor it. (guix-system): Support it. * doc/guix.texi (Invoking guix system): Document it.