summaryrefslogtreecommitdiff
path: root/guix/scripts/package.scm
AgeCommit message (Collapse)Author
2014-04-05guix package: Fix indentation of packages to remove.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Add space when showing packages to remove.
2014-04-02guix package: 'search-path-environment-variables' traverses module tree once.Ludovic Courtès
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]: Use 'find-best-packages-by-name' instead of 'find-packages-by-name'. On a profile with 140 packages, this reduces execution time of this procedure from 5.8 seconds to 2.9 seconds (50% improvement.)
2014-04-02guix package: Register non-default profiles as GC roots.Ludovic Courtès
* guix/scripts/package.scm (maybe-register-gc-root): New procedure. * tests/guix-package.sh (profile): Grep the output of "guix gc --list-live" in a couple of places.
2014-03-01guix package: Use the common build options from (guix scripts build).Ludovic Courtès
* guix/scripts/build.scm (%standard-build-options): Change option handlers to support multiple seeds. * guix/scripts/package.scm (show-help): Remove --dry-run, --fallback, --no-substitutes, and --max-silent-time. (%options): Likewise, and add %STANDARD-BUILD-OPTIONS. (%default-options): Add 'verbosity'. (guix-package): Call 'set-build-options-from-command-line' instead of 'set-build-options'.
2014-01-13guix package: Gracefully handle EPIPE on '--search'.Ludovic Courtès
* guix/scripts/package.scm (guix-package): Wrap body of 'search' in 'leave-on-EPIPE'.
2014-01-08config: '%state-directory' always honors $NIX_STATE_DIR.Ludovic Courtès
* guix/config.scm.in (%state-directory): Honor $NIX_STATE_DIR. * guix/scripts/package.scm (%profile-directory): Use %state-directory directly. * guix/store.scm (%default-socket-path, log-file): Likewise.
2014-01-04guix package: Gracefully deal with EPIPE on stdout for --list-*.Ludovic Courtès
* guix/scripts/package.scm (leave-on-EPIPE): New macro. (guix-package): Use it for 'list-installed', 'list-available', and '--list-generations'. * tests/guix-package.sh: Add test.
2013-12-22Add 'guix archive'.Ludovic Courtès
* guix/scripts/archive.scm, tests/guix-archive.sh: New files. * Makefile.am (MODULES): Add 'archive.scm'. (SH_TESTS): Add 'guix-archive.sh'. * doc/guix.texi (Invoking guix archive): New section. * guix/scripts/build.scm: Export 'derivation-from-expression'. * guix/scripts/package.scm: Export 'specification->package+output'.
2013-12-21Factorize package search between 'guix package' and 'guix build'.Ludovic Courtès
* guix/scripts/package.scm (newest-available-packages): Remove. (find-best-packages-by-name): Move to... * gnu/packages.scm (find-best-packages-by-name): ... here. (find-newest-available-packages): Memoize. * guix/scripts/build.scm (specification->package): New procedure, formerly called 'find-package' within 'guix-build'. (guix-build): Adjust accordingly.
2013-12-14guix package: allow multiple arguments after -i, -r, and -u.Mark H Weaver
* guix/scripts/package.scm (%options): Adapt option processors to accept and return a second seed value: 'arg-handler', which handles bare arguments (if not false). The install, remove, and upgrade option processors return an arg-handler that repeat the same operation. All other option processors return #f as the arg-handler. Make the arguments to install and remove optional. The upgrade option processor deletes (upgrade . #f) from the alist before adding a new entry. (guix-package): Procedures passed to 'args-fold*' accept the new seed value 'arg-handler'. The 'operand-proc' uses 'arg-handler' (if not false). * doc/guix.texi (Invoking guix package): Update docs. * tests/guix-package.sh: Add test.
2013-11-24guix package: Honor the current output when upgrading.Ludovic Courtès
* guix/scripts/package.scm (specification->package+output): Pass OUTPUT to 'package-specification->name+version+output'.
2013-11-01guix package: Show the output name of what's being removed.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Show the output name of packages being removed.
2013-11-01guix package: Fix indentation of "will be removed" messages.Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): Remove extra indentation from the removal sentences.
2013-11-01guix package: Allow removal of a specific package output.Ludovic Courtès
Fixes <http://bugs.gnu.org/15756>. * guix/profiles.scm (<manifest-pattern>): New record type. (remove-manifest-entry): Remove. (entry-predicate, manifest-matching-entries): New procedures. (manifest-remove): Accept a list of <manifest-pattern>. (manifest-installed?): Replace 'name' parameter by 'pattern', a <manifest-pattern>. * guix/scripts/package.scm (options->removable): Return a list of <manifest-pattern>. (guix-package)[process-action]: Use 'manifest-matching-entries' to compute the list of packages to remove. * tests/profiles.scm: New file. * Makefile.am (SCM_TESTS): Add it.
2013-11-01guix package: Separate '--remove' option processing.Ludovic Courtès
* guix/scripts/package.scm (options->removable): New procedure. (guix-package)[process-actions]: Use it. Rename 'remove*' to 'remove' and 'install*' to 'install'.
2013-11-01ui: Factorize package specification parsing.Ludovic Courtès
* guix/ui.scm (package-specification->name+version+output): New procedure. * guix/scripts/package.scm (specification->package+output): Use it. * tests/ui.scm ("package-specification->name+version+output"): New test.
2013-11-01Add (guix profiles).Ludovic Courtès
* guix/scripts/package.scm (show-what-to-remove/install): New procedure, moved from... (guix-package): ... here. (<manifest>, make-manifest, <manifest-entry>, profile-manifest, manifest->sexp, sexp->manifest, read-manifest, write-manifest, remove-manifest-entry, manifest-remove, manifest-installed?, manifest=?, profile-regexp, generation-numbers, previous-generation-number, profile-derivation, generation-number, generation-file-name, generation-time, lower-input): Move to... * guix/profiles.scm: ... here. New file. * Makefile.am (MODULES): Add it.
2013-10-30guix package: Factorize generation file name computation.Ludovic Courtès
* guix/scripts/package.scm (generation-file-name): New procedure. Change all occurrences of (format #f "~a-~a-link" profile number) to use it.
2013-10-30guix package: Specify inputs for each manifest entry.Ludovic Courtès
* guix/scripts/package.scm (<manifest-entry>): Add 'inputs' field. (manifest=?, lower-input): New procedure. (profile-derivation)[builder]: Add #:log-port argument to 'union-build'. [ensure-valid-input]: Remove. Add each entry's inputs to the input list. (options->installable): Return just the list of entries. [package->manifest-entry]: Set 'inputs' field. [canonicalize-deps]: Rename to... [deduplicate]: ... this. Remove input fiddling. (guix-package)[process-actions]: Use 'manifest=?' to compare the new and old manifests. Pass directly PROF-DRV to 'show-what-to-build'. Pass #:print-build-trace #f to 'set-build-options'.
2013-10-30guix package: Always use the term "profile", not "user environment".Ludovic Courtès
* guix/scripts/package.scm (%user-environment-directory): Rename to... (%user-profile-directory): ... this. Update users accordingly. (profile-derivation): Use the term "profile" instead of "user environment", and use "profile" as the derivation name.
2013-10-30guix package: Introduce <manifest> and <manifest-entry> types.Ludovic Courtès
* guix/scripts/package.scm (<manifest>, <manifest-entry>): New record types. (make-manifest, read-manifest, manifest->sexp, sexp->manifest, read-manifest, write-manifest, remove-manifest-entry, manifest-remove, manifest-installed?): New procedures. (profile-derivation): Take a manifest as the second parameter. Use 'manifest->sexp'. Expect <manifest-entry> objects instead of "tuples". Adjust callers accordingly. (search-path-environment-variables): Changes 'packages' parameter to 'entries'. Rename 'package-in-manifest->package' to 'manifest-entry->package'; expect <manifest-entry> objects. (display-search-paths): Rename 'packages' to 'entries'. (options->installable): Change 'installed' to 'manifest'. Have 'canonicalize-deps' return name/path tuples instead of raw packages. Rename 'package->tuple' to 'package->manifest-entry'. Use <manifest-entry> objects instead of tuples. (guix-package)[process-actions]: Likewise. Rename 'packages' to 'entries'. [process-query]: Use 'manifest-entries' instead of 'manifest-packages'.
2013-10-30guix package: Better separate option processing.Ludovic Courtès
* guix/scripts/package.scm (find-package): Rename to... (specification->package+output): ... this. Rename 'name' parmameter to 'spec'. Return a package and output name instead of a tuple. (options->installable): New procedure (guix-package)[process-actions]: Use it, and remove corresponding code.
2013-10-29guix package: Declutter the entry point.Ludovic Courtès
* guix/scripts/package.scm (newest-available-packages, find-best-packages-by-name, find-package, upgradeable?): New procedures, moved from... (guix-package): ... here.
2013-10-15guix package: '--search' matches against package names.Ludovic Courtès
* guix/scripts/package.scm (find-packages-by-description): Return packages whose name matches RX.
2013-09-27guix package: '--delete-generations' deletes generations older than specified.Ludovic Courtès
* guix/scripts/package.scm (matching-generations): Add 'duration-relation' keyword parameter. (guix-package)[process-action](delete-generations): Pass #:duration-relation >. * tests/guix-package.sh: Add test. * doc/guix.texi (Invoking guix package): Clarify the meaning of durations for '--list-durations' and '--delete-durations'.
2013-09-26guix package: Add '--delete-generations'.Nikita Karetnikov
* guix/scripts/package.scm (switch-to-previous-generation): New function. (roll-back): Use the new function instead of 'switch-link'. (show-help): Add '--delete-generations'. (%options): Likewise. (guix-package)[process-actions]: Add 'current-generation-number', 'display-and-delete', and 'delete-generation'. Add support for '--delete-generations', and reindent the code. * tests/guix-package.sh: Test '--delete-generations'. * doc/guix.texi (Invoking guix-package): Document '--delete-generations'.
2013-09-26guix package: Add 'link-to-empty-profile'.Nikita Karetnikov
* guix/scripts/package.scm (link-to-empty-profile): New function. (roll-back): Use it.
2013-09-26guix package: Exit with 0 when there is nothing to list.Nikita Karetnikov
* guix/scripts/package.scm (guix-package)[process-query]: Exit with 0 when there are no generations containing packages or no profiles.
2013-09-25guix package: Show which generation is the current one.Nikita Karetnikov
* guix/scripts/package.scm (guix-package)[process-query]: Show that a generation is the current one if the profile points to it. * tests/guix-package.sh: Test it.
2013-09-25guix package: Do not list the zeroth generation.Nikita Karetnikov
* guix/scripts/package.scm (guix-package)[process-query]: Change 'list-generation' to not list the zeroth generation. * tests/guix-package.sh: Test it. * doc/guix.texi (Invoking guix package): Document it, and use the right term when talking about generations.
2013-09-25guix package: Exit with 1 when a generation cannot be listed.Nikita Karetnikov
* guix/scripts/package.scm (guix-package)[process-query]: Exit with 1 when a generation does not exist or the profile points to the zeroth generation. * tests/guix-package.sh: Test the former case.
2013-09-23guix package: Show most recently installed packages last.Ludovic Courtès
Suggested by Andreas Enge <andreas@enge.fr>. * guix/scripts/package.scm (guix-package)[list-generations, list-installed]: Reverse the result of 'manifest-packages'. * doc/guix.texi (Invoking guix package): Document the order of packages for '--list-generations' and '--list-installed'.
2013-09-21guix package: Sort the list of generation numbers in '--list-generations'.Ludovic Courtès
* guix/scripts/package.scm (generation-numbers): Sort the result.
2013-09-21guix package: Internationalize "Generation" string.Ludovic Courtès
* guix/scripts/package.scm (guix-package): Internationalize generation listing.
2013-09-19guix package: Add '--list-generations'.Nikita Karetnikov
* guix/scripts/package.scm: Import (srfi srfi-19). (generation-time, matching-generations): New functions. (show-help): Add '--list-generations'. (%options): Likewise. (guix-package)[process-query]: Add support for '--list-generations'. * guix/ui.scm: Import (srfi srfi-19) and (ice-9 regex). (string->generations, string->duration): New functions. * tests/guix-package.sh: Test '--list-generations'. * tests/ui.scm: Import (srfi srfi-19). Test 'string->generations' and 'string->duration'. * doc/guix.texi (Invoking guix-package): Document '--list-generations'.
2013-09-18derivations: 'derivation' and related procedures return a single value.Ludovic Courtès
* guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly.
2013-09-13guix package: Rename generation-related procedures.Nikita Karetnikov
* guix/scripts/package.scm (profile-numbers): Rename to 'generation-numbers'. (previous-profile-number): Rename to 'previous-generation-number'. (profile-number): Rename to 'generation-number'. (roll-back): Rename 'previous-profile' to 'previous-generation'.
2013-07-15guix package: Allow separate install of several outputs of the same package.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[process-actions](same-package?): New procedure. Use it instead of `alist-delete' when filtering out duplicate packages from the profile.
2013-07-12guix package: Fix handling of `-e'.Ludovic Courtès
This fixes a bug whereby a command like guix package -e '(@@ (gnu packages base) gnu-make-boot0)' would only succeed when the outputs of that package are available, and otherwise fail with "/nix/store/... is not valid". * guix/scripts/package.scm (guix-package)[process-action](package->tuple): Leave P as is in the result. Move `package->tuple' call from INSTALL* to INSTALL.
2013-07-12guix package: Reuse FTP connections for subsequent `latest-release' calls.Ludovic Courtès
* guix/gnu-maintenance.scm (latest-release): Add `ftp-close' and `ftp-open' keyword parameters. * guix/scripts/package.scm (ftp-open*): New variable. (check-package-freshness): Call `latest-release' with `ftp-open*' and a no-op procedure.
2013-06-20package: Fix i18n of the number of packages message.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[process-actions]: Use `N_' for i18n of the number of packages message.
2013-06-19package: Display the number of installed packages upon completion.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[process-actions]: Display the number of packages in the profile upon completion.
2013-05-29build, package: Add `--fallback' option.Ludovic Courtès
* guix/scripts/build.scm (%options, show-help): Add `--fallback'. (guix-build): Call `set-build-options' with #:fallback?. * guix/scripts/package.scm (%options, show-help): Add `--fallback'. (guix-package): Call `set-build-options' with #:fallback?. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--fallback'.
2013-05-24package: Fix default profile ownership check when it's just been created.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check whether S is true before checking its owner. Fixes the case where we built %PROFILE-DIRECTORY just above.
2013-05-20Add `--max-silent-time' to `guix build' and `guix package'.Ludovic Courtès
* guix/scripts/build.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-build): Pass `max-silent-time' to `set-build-options'. * guix/scripts/package.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-package): Pass `max-silent-time' to `set-build-options'. * guix/ui.scm (string->number*): New procedure. * tests/derivations.scm ("build-expression->derivation and max-silent-time"): New test. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--max-silent-time'.
2013-05-16package: Make sure the profile directory is owned by the user.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check the owner of %PROFILE-DIRECTORY. Report an error when the owner is not the current user. Add `rtfm' procedure. * doc/guix.texi (Invoking guix package): Mention the ownership test.
2013-05-14package: Always clear the SIGINT handler.Ludovic Courtès
* guix/scripts/package.scm (call-with-sigint-handler): Wrap THUNK in `dynamic-wind' so that the SIGINT handler is always cleared.
2013-05-14ftp-client: Let callers handle `ftp-open' exceptions.Ludovic Courtès
* guix/ftp-client.scm (ftp-open): Let exceptions through. * guix/scripts/package.scm (waiting): Wrap EXP in a `dynamic-wind', so the line is always cleared.
2013-05-10package: Store the output path of packages installed with `-e'.Ludovic Courtès
* guix/scripts/package.scm (guix-package)[process-actions](package->tuple): Put the output path in the tuple, not the derivation path. * tests/guix-package.sh: Add test.
2013-05-10package: Make sure the dependencies get built along with the manifest.Ludovic Courtès
Before this, something like "guix package -i glibc" could fail because glibc lists linux-libre-headers as a propagated input (which would be added as a dependency in the manifest) but the linux-libre-headers output could be unavailable, leading to an error like this: path `/nix/store/4v2bk8sx5cm166gks3fi3q7d9zchibnk-linux-libre-headers-3.3.8' is not valid This patch adds such dependencies as inputs of the profile derivation. * guix/scripts/package.scm (profile-derivation): Accept package objects in the `deps' field of an element of PACKAGES. Convert them to their output path for BUILDER, and add them to the inputs of the `build-expression->derivation' call. (input->name+path): When INPUT doesn't contain a package object, return it as is. (guix-package)[process-actions](canonicalize-deps): Expect DEPS to contain package objects, and leave them as is.