summaryrefslogtreecommitdiff
path: root/guix/scripts
AgeCommit message (Collapse)Author
2019-03-26environment: Create /etc/group in containers.Ludovic Courtès
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.
2019-03-26environment: Use (gnu build accounts) for /etc/passwd handling.Ludovic Courtès
* 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'.
2019-03-23graph: Factorize calls to 'fold-packages'.Ludovic Courtès
* guix/scripts/graph.scm (all-packages): New procedure. (%reverse-package-node-type, %reverse-bag-node-type): Use 'all-packages' instead of 'fold-packages'.
2019-03-23graph: Add the 'reverse-bag' graph.Ludovic Courtès
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.
2019-03-19pack: Create an empty /home directory for '-f squashfs'.Ludovic Courtès
Fixes <https://bugs.gnu.org/34914>. * guix/scripts/pack.scm (squashfs-image)[build]: Pass "-p /home d 555 0 0".
2019-03-19pack: Produce relative symlinks when using '-f squashfs'.Ludovic Courtès
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.
2019-03-18describe: Warn about 'GUIX_PACKAGE_PATH' in json and recutils format.Ludovic Courtès
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.
2019-03-17guix build: '--with-branch' strips slashes from the version string.Ludovic Courtès
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.
2019-03-17guix build: '--with-commit' makes recursive checkouts.Ludovic Courtès
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.
2019-03-17guix build: Transformation options match packages by spec.Ludovic Courtès
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.
2019-03-17guix build: Factorize 'package-git-url'.Ludovic Courtès
* guix/scripts/build.scm (package-git-url): New procedure. (evaluate-git-replacement-specs): Use it.
2019-03-17guix build: Add '--with-git-url'.Ludovic Courtès
* 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.
2019-03-17guix system: Fix success report of the bootloader installation.Ludovic Courtès
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.
2019-03-16guix: Match package names case-insensitively.Tobias Geerinckx-Rice
* guix/scripts/package.scm (options->upgrade-predicate, process-query): Use REGEXP/ICASE when matching package names.
2019-03-16bootloader: Use 'invoke/quiet' when running 'grub-install' and co.Ludovic Courtès
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.
2019-03-15pack: Construct inferior package names correctly.P.C. Shyamshankar
* guix/scripts/pack.scm (wrapped-package): now correctly constructs full names of inferior packages. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2019-03-15pack: "-RR" produces PRoot-enabled relocatable binaries.Ludovic Courtès
* 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.
2019-03-07pack: Add '--save-provenance'.Ludovic Courtès
* 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.
2019-03-07describe: Add 'package-provenance'.Ludovic Courtès
* guix/scripts/package.scm (package-provenance): Move to... * guix/describe.scm (package-provenance): ... here.
2019-03-04environment: Rename '--inherit' to '--preserve'.Ludovic Courtès
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.
2019-03-04environment: Remove deprecated -E/--exec option.Ludovic Courtès
* guix/scripts/environment.scm (%options): Remove "--exec", which was deprecated in commit 1de2fe95e017c42aacbaa34f5dab8d48249cc064 in 2015. * tests/guix-environment.sh: Remove use of '-E'.
2019-02-16environment: Add '--inherit'.Ludovic Courtès
* 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.
2019-02-13guix system: List old generations from newest to oldest.Ludovic Courtès
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'.
2019-02-13guix system: Add 'delete-generations'.Ludovic Courtès
* 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.
2019-02-12pull: Speed up the new/upgraded package computation.Ludovic Courtès
* guix/scripts/pull.scm (new/upgraded-packages): OLD no longer stores all the versions of each package. Remove 'vhash-fold*' call and reduce the number of 'version>?' calls when computing UPGRADED.
2019-02-12pull: Move profile comparison to 'new/upgraded-packages'.Ludovic Courtès
* guix/scripts/pull.scm (new/upgraded-packages): New procedure, with code formerly in 'display-new/upgraded-packages'. (display-new/upgraded-packages): Use it.
2019-02-12pull: Use 'fold-available-packages' for the current package list.Ludovic Courtès
* guix/scripts/pull.scm (display-profile-news): Use 'fold-available-packages' instead of 'fold-packages' to compute OLD. (profile-package-alist): Use 'inferior-available-packages'.
2019-02-11Avoid name clash with 'build' from (guix store) and (guix status).Ludovic Courtès
Since commit 976ef2d97887d16eab8d4eb9dad811786b04d690, (guix status) exports 'build', which clashes with 'build' from (guix store). * build-aux/run-system-tests.scm: Select 'with-status-verbosity' from (guix status). * guix/scripts/archive.scm: Likewise. * guix/scripts/build.scm: Likewise. * guix/scripts/copy.scm: Likewise. * guix/scripts/environment.scm: Likewise. * guix/scripts/pack.scm: Likewise. * guix/scripts/package.scm: Likewise. * guix/scripts/pull.scm: Likewise. * guix/scripts/system.scm: Likewise.
2019-02-11pack, vm: Fix incorrect use of 'package-transitive-propagated-inputs'.Ludovic Courtès
In practice the error was not triggered because 'package-transitive-propagated-inputs' currently returns the empty list for these two packages. * guix/scripts/pack.scm (gcrypt-sqlite3&co): Remove labels from the result. * gnu/system/vm.scm (gcrypt-sqlite3&co): Likewise.
2019-02-08git: Always use the system certificates by default.Ludovic Courtès
'guix pull' was always doing it, and now '--with-branch' & co. will do it as well. * guix/git.scm (honor-system-x509-certificates!): New procedure. (%certificates-initialized?): New variable. (with-libgit2): Add call to 'honor-system-x509-certificates!'. * guix/scripts/pull.scm (honor-x509-certificates): Call 'honor-system-x509-certificates!' and fall back to 'honor-lets-encrypt-certificates!'.
2019-02-08guix build: '--with-branch' & co. fetch submodules.Ludovic Courtès
* guix/scripts/build.scm (transform-package-source-branch)[replace]: Add 'recursive?' field to the new package.
2019-02-01guix package: '-A' no longer lists deprecated packages.Ludovic Courtès
Fixes a regression introduced in 0ea939fb796fdd4f0d46d3534b2ec6135e0f3dc7. * guix/scripts/package.scm (process-query) <'list-available>: Change #:superseded? to #:deprecated? since that's what 'fold-available-packages' passes.
2019-01-29pull: Default to verbosity level 1.Ludovic Courtès
* guix/scripts/pull.scm (%default-options): Change 'verbosity to 1.
2019-01-28pull: Don't trigger 'hash guix' hint needlessly.Ludovic Courtès
Previously if ~/.config/guix/current/bin was in $PATH, we'd still suggest to run 'hash guix' because we'd compare (which "guix") against /var/guix/profiles/per-user/…. * guix/scripts/pull.scm (build-and-install): Check whether (which "guix") matches PROFILE or its user-friendly variant.
2019-01-25weather: Add '--coverage'.Ludovic Courtès
* guix/scripts/weather.scm (show-help, %options): Add '--coverage'. (package-partition-boundary, package->output-mapping) (substitute-oracle, report-package-coverage-per-system) (report-package-coverage): New procedures. (guix-weather): Honor '--coverage'. * doc/guix.texi (Invoking guix weather): Document it.
2019-01-25refresh: Better account for private and generated packages.Ludovic Courtès
Until now, private and generated packages (e.g., those created by 'texlive-union') we missing from the list passed to 'node-back-edges', which would lead to inaccurate dependent counts. Previously we'd get: $ guix refresh -l texlive-fonts-cm Building the following 80 packages would ensure 116 dependent packages are rebuilt: … Now we have: $ Building the following 240 packages would ensure 597 dependent packages are rebuilt: … * guix/scripts/refresh.scm (list-dependents): Call 'package-closure'.
2019-01-25refresh: Fix format string that would lead '-l' to print incorrect numbers.Ludovic Courtès
The skip "~*" argument was misplaced, leading the number of dependents to be skipped (instead of the number of covering packages.) Thus, we'd get: $ guix refresh -l ocaml4.02-ppx-deriving@4.1 Building the following package would ensure 1 dependent packages are rebuilt: bap@1.3.0 instead of: Building the following package would ensure 26 dependent packages are rebuilt: bap@1.3.0 * guix/scripts/refresh.scm (list-dependents): Move "~*" in the right place, to skip (length covering) rather than (length dependents).
2019-01-25weather: Ignore deprecated packages but not hidden packages.Ludovic Courtès
* guix/scripts/weather.scm (all-packages): Pass #:select? to 'fold-packages'.
2019-01-22offload: 'status' reports the time difference.Ludovic Courtès
* guix/scripts/offload.scm (check-machine-status): Report the time difference for each MACHINE.
2019-01-21store: Rename '&nix-error' to '&store-error'.Ludovic Courtès
* guix/store.scm (&nix-error): Rename to... (&store-error): ... this, and adjust users. (&nix-connection-error): Rename to... (&store-connection-error): ... this, and adjust users. (&nix-protocol-error): Rename to... (&store-protocol-error): ... this, adjust users. (&nix-error, &nix-connection-error, &nix-protocol-error): Define these condition types and their getters as deprecrated aliases. * build-aux/run-system-tests.scm, guix/derivations.scm, guix/grafts.scm, guix/scripts/challenge.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/offload.scm, guix/serialization.scm, guix/ssh.scm, guix/tests.scm, guix/ui.scm, tests/derivations.scm, tests/gexp.scm, tests/guix-daemon.sh, tests/packages.scm, tests/store.scm, doc/guix.texi: Adjust to use the new names.
2019-01-20pull: Add missing import.Ludovic Courtès
Fixes <https://bugs.gnu.org/34136>. Reported by Pierre Neidhardt <mail@ambrevar.xyz>. Fixes wrong-type-arg crash of "guix pull -p /does-not-exist -l". * guix/scripts/pull.scm: Use (srfi srfi-34).
2019-01-20lint: check-source-unstable-tarball: Don't assume uri length.Efraim Flashner
* guix/scripts/lint.scm (check-source-unstable-tarball): Replace third with code to make sure there are enough elements to check.
2019-01-18pull: Suggest running 'hash guix' if needed.Ludovic Courtès
Fixes <https://bugs.gnu.org/33647>. Suggested by Diego Nicola Barbato <dnbarbato@posteo.de>. * guix/scripts/pull.scm (build-and-install): Before returning, display a hint if (which "guix") is not in PROFILE.
2019-01-17scripts: Fix typo.Ricardo Wurmus
* guix/scripts/download.scm (show-help): Fix typo.
2019-01-15guix package: '--list-available' can use data from the cache.Ludovic Courtès
* gnu/packages.scm (fold-available-packages): New procedure. * guix/scripts/package.scm (process-query): Use it instead of 'fold-packages'. * tests/packages.scm ("fold-available-packages with/without cache"): New test.
2019-01-15edit: Use 'specification->location' to read information from the cache.Ludovic Courtès
That way 'guix edit' doesn't need to load any package module. * gnu/packages.scm (find-package-locations, specification->location): New procedures. * guix/scripts/edit.scm (package->location-specification): Rename to... (location->location-specification): ... this. Expect a location object instead of a package. (guix-edit): Use 'specification->location' instead of 'specification->package'. * tests/packages.scm ("find-package-locations") ("find-package-locations with cache") ("specification->location"): New tests.
2019-01-15channels: Compute a package cache and use it.Ludovic Courtès
* gnu/packages.scm (cache-is-authoritative?, load-package-cache) (cache-lookup, generate-package-cache): New procedures. (%package-cache-file): New variable. (find-packages-by-name): Rename to... (find-packages-by-name/direct): ... this. (find-packages-by-name): Rewrite to use the package cache when 'cache-is-authoritative?' returns true. * tests/packages.scm ("find-packages-by-name + version, with cache") ("find-packages-by-name with cache"): New tests. * guix/channels.scm (package-cache-file): New procedure. (%channel-profile-hooks): New variable. (channel-instances->derivation): Use it in #:hooks. * guix/scripts/package.scm (build-and-use-profile): Add #:hooks and honor it. * guix/scripts/pull.scm (build-and-install): Pass #:hooks to UPDATE-PROFILE.
2019-01-15guix package: Avoid 'find-newest-available-packages'.Ludovic Courtès
* guix/scripts/package.scm (transaction-upgrade-entry): Use 'find-best-packages-by-name' instead of 'find-newest-available-packages'. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades") ("transaction-upgrade-entry, one upgrade") ("transaction-upgrade-entry, superseded package"): Adjust accordingly.
2019-01-15guix package: '--upgrade' preserves package order.Ludovic Courtès
Fixes <https://bugs.gnu.org/31142>. Reported by Chris Marusich <cmmarusich@gmail.com>. * guix/scripts/package.scm (options->installable)[upgraded]: Use 'fold' instead of 'fold-right'. This reverts eca16a3d1d9e6b2c064e0105c1015258bf2755f2. * tests/guix-package-net.sh: Add 'guix package u' test.
2019-01-14copy: Add '--verbosity'.Ludovic Courtès
This fixes a regression introduced in f1de676ea82c2bed9a435fce37ade0186296bfc9 since %DEFAULT-OPTIONS was missing the 'debug key that 'set-build-options-from-command-line' expects. * guix/scripts/copy.scm (show-help, %options): Add '--verbosity'. (%default-options): Rename 'verbosity' to 'debug'. Add 'print-build-trace?', 'print-extended-build-trace?', 'multiplexed-build-output?', and 'verbosity'. (guix-copy): Wrap body in 'with-status-verbosity'.