Commit Graph

596 Commits

Author SHA1 Message Date
Ricardo Wurmus d0bd632f89 import: Add Bioconductor importer and updater.
* guix/import/cran.scm (%bioconductor-updater,
latest-bioconductor-release, bioconductor-package?): New procedures.
(cran->guix-package): Support repositories other than CRAN.
(%bioconductor-url, %bioconductor-svn-url): New variables.
(description->package): Update signature to distinguish between packages
from different repositories.
(latest-release): Rename procedure ...
(latest-cran-release): ... to this.
(cran-package?): Do not assume all R packages are available on CRAN.
* tests/cran.scm: Update tests.
* guix/scripts/import/cran.scm: Add "--archive" option and default to
CRAN.
* guix/scripts/refresh.scm (%updaters): Add "%bioconductor-updater".
* doc/guix.texi: Document Bioconductor importer and updater.
2016-01-20 12:41:28 +01:00
Ludovic Courtès f495301902 guix build: Add '--keep-going'.
* guix/scripts/build.scm (show-build-options-help)
(%standard-build-options): Add --keep-going.
* guix/scripts/build.scm (set-build-options-from-command-line): Honor
it.
* doc/guix.texi (Invoking guix build): Document it.
2016-01-19 21:59:58 +01:00
Alex Kost b8300494c0 Move <boot-parameters> to (gnu system).
* guix/scripts/system.scm (previous-grub-entries)
  (display-system-generation): Use accessors instead of matching
  <boot-parameters>.
  (boot-parameters, boot-parameters?, boot-parameters-label)
  (boot-parameters-root-device, boot-parameters-kernel)
  (boot-parameters-kernel-arguments, read-boot-parameters): Move to...
* gnu/system.scm: ... here. Export them.
2016-01-16 13:02:21 +03:00
Ludovic Courtès f888c0b120 lint: cve: Catch host name lookup errors.
* guix/scripts/lint.scm (package-vulnerabilities): Catch
'getaddrinfo-error'.
2016-01-06 15:54:12 +01:00
Ludovic Courtès db5a94445f guix package: Allow multiple '--search' flags.
* guix/scripts/package.scm (find-packages-by-description): Change 'rx'
parameter to 'regexps'.
[matches-all?, matches-one?]: New procedures.
Use them.
(process-query): Collect regexps from all 'search' queries, and pass
them to 'find-packages-by-description'.
* tests/guix-package.sh: Add tests.
* doc/guix.texi (Invoking guix package): Document it.
2016-01-05 00:28:42 +01:00
Ludovic Courtès 51385362f7 graph: %BAG-WITH-ORIGINS-NODE-TYPE includes the origin's guile.
Before that it would include #f for most origins since that the default
value of 'origin-patch-guile'.

* guix/scripts/graph.scm (bag-node-edges): When 'origin-patch-guile'
returns #f, use (default-guile).
* tests/graph.scm ("bag DAG, including origins"): Check for an edge from
O to (default-guile).
2016-01-02 22:25:41 +01:00
Ludovic Courtès f88282af38 graph: %BAG-EMERGED-NODE-TYPE filters out origins.
Fixes <http://bugs.gnu.org/22280>.
Reported by Leo Famulari <leo@famulari.name>.

* guix/scripts/graph.scm (%bag-emerged-node-type)[edges]: Mimic
%BAG-NODE-TYPE.  This is a followup to 38b92da.
2016-01-02 22:25:41 +01:00
Ludovic Courtès 223d793903 guix build: Augment %PATCH-PATH when -L is passed.
Fixes <http://bugs.gnu.org/22259>.
Reported by Nikolay Merinov <nikolay.merinov@member.fsf.org>.

* guix/scripts/build.scm (%standard-build-options) <-L>: Augment
%PATCH-PATH.
* tests/guix-package.sh: Add test.
2015-12-30 18:15:54 +01:00
Leo Famulari 38fa30eb95 guix package: Fix typo in comment.
* guix/scripts/package.scm: Fix typo.
2015-12-25 23:36:42 -05:00
Ludovic Courtès c5b303c57f lint: The CPE name of GRUB is "grub2".
Reported by Leo Famulari.

* guix/scripts/lint.scm (package-name->cpe-name): Add "grub".
2015-12-20 22:34:22 +01:00
Ludovic Courtès 20464dde13 guix build: Gracefully handle type errors in -e and -f.
* guix/scripts/build.scm (options->things-to-build)[validate-type]: New
procedure.
[ensure-list]: Use it.
2015-12-13 21:13:16 +01:00
Ludovic Courtès ee2a7e3fd2 guix build: Remove dead code.
* guix/scripts/build.scm (options->things-to-build): Remove unused
'match' clause.
2015-12-13 21:04:56 +01:00
Ludovic Courtès a8d65643fb guix build: Add '--check'.
* guix/derivations.scm (build-derivations): Add optional 'mode'
parameter.
* guix/scripts/build.scm (%default-options): Add 'build-mode'.
(show-help, %options): Add '--check'.
(guix-build): Honor 'build-mode' key of OPTS.  Pass it to
'show-what-to-build' and 'build-derivations'.
* doc/guix.texi (Invoking guix build): Document it.
(Substitutes): Mention it.
2015-12-09 14:29:41 +01:00
Ludovic Courtès 5b74fe065b guix build: Add '--rounds'.
* guix/scripts/build.scm (show-build-options-help)
(%standard-build-options): Add --rounds.
(set-build-options-from-command-line): Honor it.
* doc/guix.texi (Invoking guix build): Document it.
* doc/contributing.texi (Submitting Patches): Mention it.
2015-12-08 23:58:12 +01:00
Ludovic Courtès e80c0f85ba gnu-maintenance: Add GNOME updater.
* guix/gnu-maintenance.scm (ftp-server/directory)[quirks]: Remove glib.
(false-if-ftp-error): New macro.
(latest-release*): Use it.
(non-emacs-gnu-package?): Rename to...
(pure-gnu-package?): ... this.  Add call to 'gnome-package?'.
(%gnu-updater): Adjust accordingly.
(gnome-package?, latest-gnome-release): New procedures.
(%gnome-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add %GNOME-UPDATER.
* doc/guix.texi (Invoking guix refresh): Mention it.
2015-12-07 23:32:01 +01:00
Ludovic Courtès fba607b129 refresh: Bail out when asked for a nonexistent updater.
* guix/scripts/refresh.scm (lookup-updater): Call 'leave' when 'find'
returns #f.
2015-12-07 23:32:01 +01:00
Mathieu Lirzin cd08fe4259 edit: Don't assume that an emacs daemon is running.
* guix/scripts/edit.scm (%editor): Use Emacs as a default value.
2015-12-06 17:23:25 +01:00
Mathieu Lirzin b16dbd1311 edit: Allow command line arguments in $VISUAL and $EDITOR.
* guix/scripts/edit.scm (guix-edit): Fix the assumption that %editor is
a one word command.
2015-12-06 17:23:21 +01:00
Ludovic Courtès 64ec0e2912 guix build: Modularize transformation handling.
* guix/scripts/build.scm (options/resolve-packages): Remove.
(options->things-to-build, transform-package-source): New procedure.
(%transformations): New variable.
(options->transformation): New procedure.
(options->derivations): Rewrite to use 'options->things-to-build' and
'options->transformation'.
2015-12-01 00:02:54 +02:00
Ludovic Courtès 27b91d7851 guix package: Refactor 'options->installable'.
* guix/scripts/package.scm (options->upgrade-predicate)
(store-item->manifest-entry): New procedures.
* guix/scripts/package.scm (options->installable): Use them.  Remove the
'packages-to-upgrade' and 'packages-to-install' variables by getting rid
of a level of indirection.
2015-12-01 00:02:54 +02:00
Ludovic Courtès 6e37017506 guix package: Move 'process-actions' out of sight.
* guix/scripts/package.scm (process-actions): New procedure, moved
from...
(guix-package): ... here.  Adjust accordingly.
2015-12-01 00:02:54 +02:00
Ludovic Courtès 590558953b guix package: Formalize the list of actions.
* guix/scripts/package.scm (roll-back-action, switch-generation-action)
(delete-generations-action, manifest-action): New procedures.
(%actions): New variable.
* guix/scripts/package.scm (guix-package)[process-action]: Rewrite to
traverse %ACTIONS.
2015-12-01 00:02:54 +02:00
Ludovic Courtès d1ac5c0775 guix package: Move 'build-and-use-profile' out of sight.
* guix/scripts/package.scm (build-and-use-profile): New procedure.
Adapted and moved from...
(guix-package)[process-actions]: ... here.  Adjust call sites.
2015-12-01 00:02:54 +02:00
Ludovic Courtès 2cc10077f3 guix package: Move a couple of procedures out of sight.
* guix/scripts/package.scm (ensure-default-profile, process-query): New
procedures, moved from...
(guix-package): ... here.
2015-12-01 00:02:54 +02:00
Ludovic Courtès 0993f94267 guix package: Remove unnecessary use of (%store).
* guix/scripts/package.scm (delete-matching-generations): Use STORE
instead of (%store).
2015-12-01 00:02:54 +02:00
Ludovic Courtès 26059753ae refresh: Check updater availability at run time.
This is a followup to b68d2db, which added a check for updaters at
macro-expansion time.  The problem is that, when running 'guix pull',
Guile-JSON is found, so the PyPi updater (say) is added to %UPDATERS,
but then at run time Guile-JSON might be missing.

Reported by orbea on #guix.

* guix/scripts/refresh.scm (maybe-updater): Rewrite as 'syntax-rules'.
Produce code that checks conditions at run time.
(list-updaters): Update docstring.
2015-11-29 22:56:29 +01:00
Ludovic Courtès 841cb43c6b guix build: Factorize build log query.
* guix/scripts/build.scm (show-build-log): New procedure.
(guix-build): New variable 'items'.  Use it and 'show-build-log'.
2015-11-29 17:42:01 +01:00
Ludovic Courtès 471cdfdb19 environment: Set build options early on.
This fixes a bug whereby some options, such as #:substitute-urls, would
be passed to the daemon too late to have an effect.

* guix/scripts/environment.scm (build-inputs): Remove call to
'set-build-options-from-command-line*'.
(guix-environment): Add call to 'set-build-options-from-command-line' as
early as possible.
2015-11-28 21:53:51 +01:00
Ludovic Courtès 4e70fe4d0e lint: Do not report already-patched vulnerabilities.
* guix/scripts/lint.scm (patch-file-name): New procedure.
(check-vulnerabilities): Use it to filter out patched vulnerabilities.
* tests/lint.scm ("cve: one patched vulnerability"): New test.
2015-11-28 16:15:31 +01:00
Ludovic Courtès ae4427e3f3 substitute: Warn upon store prefix mismatches.
Suggested by Hynek Urban <hynek.urban@gmail.com>.

* guix/scripts/substitute.scm (fetch-narinfos): Move body to...
[do-fetch]: ... here.  New procedure.
Emit a warning when CACHE-INFO's prefix does not match.
2015-11-28 00:02:23 +01:00
Ludovic Courtès 5432734b00 lint: Add "cve" checker.
Fixes <http://bugs.gnu.org/21289>.

* guix/scripts/lint.scm (package-name->cpe-name, package-vulnerabilities)
(check-vulnerabilities): New procedures.
* guix/scripts/lint.scm (%checkers): Add "cve" checker.
* tests/lint.scm ("cve", "cve: one vulnerability"): New tests.
* doc/guix.texi (Invoking guix lint): Mention it.
2015-11-26 23:04:19 +01:00
Federico Beffa d8c66da7c1 import: hackage: Assume current 'ghc' package version.
* guix/scripts/import/hackage.scm (%default-options): Do it.
  (ghc-default-version): New variable.
2015-11-26 18:17:23 +01:00
Ludovic Courtès cc3de1da41 guix package: Reduce startup time by ~50%.
As measured with:

  time sh -c 'for i in `seq 1 10` ; do guix package --search-paths ; done'

On my machine, when running:

  strace -o ,,s guix package --search-paths

the number returned by:

  grep -E '^(open|l?stat).*\.go' ,,s | wc -l

drops from 1610 to 837.

* guix/scripts/package.scm: Remove two unnecessary #:use-module forms.
Autoload (gnu packages ...) modules.
2015-11-24 18:19:25 +01:00
Ludovic Courtès 38b92daa81 graph: Add '%bag-with-origins-node-type'.
* guix/scripts/graph.scm (bag-node-edges): Remove 'filter' call.  Add
case for 'origin'.
(%bag-node-type)[edges]: Add filtering here.
(%bag-with-origins-node-type): New variable.
(%node-types): Add it.
* tests/graph.scm ("bag DAG, including origins"): New test.
* tests/guix-graph.sh: Add 'bag-with-origins'.
* doc/guix.texi (Invoking guix graph): Document it.
2015-11-23 23:34:15 +01:00
Ludovic Courtès 2d7fc7daf1 refresh: Add '--expression'.
* guix/scripts/refresh.scm (%options, show-help): Add --expression.
(guix-refresh): Honor it.
* doc/guix.texi (Invoking guix refresh): Document it.
2015-11-23 17:48:35 +01:00
Ludovic Courtès 86cdfc451b guix download: Fail when more than one URL is passed.
* guix/scripts/download.scm (guix-download)[parse-option]: Call 'leave'
when passed an extra argument.
* tests/guix-download.sh: Add test.
2015-11-23 17:48:35 +01:00
Ludovic Courtès 71ae18ee52 guix download: Gracefully handle missing arguments.
Fixes <http://bugs.gnu.org/21991>.
Reported by Jan Synáček <jan.synacek@gmail.com>.

* guix/scripts/download.scm (guix-download): Call 'leave' when OPTS does
not contain an 'argument' key.
2015-11-23 17:48:35 +01:00
Ludovic Courtès 862d2479f6 ftp-client: Default port for 'ftp-open' is now "ftp".
* guix/ftp-client.scm (ftp-open): Change default #:port to "ftp".
* guix/scripts/lint.scm (probe-uri): Remove 'port' parameter to
'ftp-open'.
2015-11-22 14:35:28 +01:00
Ludovic Courtès 82e64fc14e environment: Correctly handle abnormal exits.
Fixes <http://bugs.gnu.org/21958>.

* guix/scripts/environment.scm (status->exit-code): New procedure.
(exit/status, primitive-exit/status): Use it.
* tests/guix-environment-container.sh: Add test.
2015-11-21 22:26:13 +01:00
Ludovic Courtès a51cbecb44 refresh: Rewrite '--list-dependent' in terms of (guix graph).
* guix/scripts/refresh.scm (all-packages, list-dependents): New
procedures.
(guix-refresh): Use it.
2015-11-21 16:27:34 +01:00
Ludovic Courtès 8fb583714f Add (guix graph).
* guix/scripts/graph.scm (<node-type>, <graph-backend>, emit-prologue)
(emit-epilogue, emit-node, emit-edge, %graphviz-backend, export-graph):
Move to...
* guix/graph.scm: ... here.  New file.
* guix/scripts/system.scm, tests/graph.scm: Use it.
* Makefile.am (MODULES): Add it.
2015-11-21 16:26:43 +01:00
Ludovic Courtès bd7e1ffae6 lint: Have connections time out after 3 seconds.
* guix/scripts/lint.scm (probe-uri): Add #:timeout parameter.  Pass it
  to 'open-connection-for-uri' and 'ftp-open'.
  (validate-uri): Pass #:timeout 3 to 'probe-uri'.
2015-11-12 23:47:01 +01:00
Ludovic Courtès 3a96d7c3dd guix gc: Error out when extra arguments are passed.
Fixes <http://bugs.gnu.org/21817>.
Reported by Petter Berntsen <petter@mykolab.ch>.

* guix/scripts/gc.scm (guix-gc)[assert-no-extra-arguments]: New
  procedure.
  Use it for actions 'collect-garbage', 'optimize', and 'verify'.
* tests/guix-gc.sh: Add tests.
2015-11-11 23:29:20 +01:00
Ludovic Courtès 6237b9fa39 edit: Honor $VISUAL.
Suggested by Andreas Enge <andreas@enge.fr>.

* guix/scripts/edit.scm (%editor): Honor 'VISUAL' before 'EDITOR'.
  (show-help): Adjust accordingly.
* doc/guix.texi (Invoking guix edit): Likewise.
2015-11-11 23:29:20 +01:00
Ludovic Courtès 14649b8cdb refresh: Avoid non-literal format string.
Reported by Mathieu Lirzin <mthl@gnu.org>.

* guix/scripts/refresh.scm (guix-refresh): Rewrite 'list-dependent?'
  report to avoid nested 'N_' calls.
2015-11-11 22:10:21 +01:00
Ludovic Courtès fc2d233964 guix package: '--search-paths' can report combined search paths.
Partly fixes <http://bugs.gnu.org/20255>.

* guix/scripts/package.scm (search-path-environment-variables): Change
  'profile' to 'profiles'; expect it to be a list.
  (display-search-paths): Likewise.
  (%default-options): Remove 'profile' entry.
  (%options) <--profile>: Keep previous values associated with 'profile'
  in RESULT.
  (guix-package)[process-actions, process-query]: Handle the possible
  lack of 'profile' pair in OPTS.
2015-11-11 00:37:50 +01:00
Ludovic Courtès b68d2dbf08 refresh: Discard PyPI updater when Guile-JSON is missing.
Reported by Sleep_Walker and Mathieu Lirzin <mthl@gnu.org>.

* guix/scripts/refresh.scm (maybe-updater, list-updaters): New macros.
  (%updaters): Use 'list-updaters' instead of 'list'.  Make
  %PYPI-UPDATER conditional.
2015-11-08 22:21:19 +01:00
Ludovic Courtès 650f1615de edit: Improve error reporting when $EDITOR is not found.
Reported by Benno Evers <benno@bmevers.de>
at <https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00125.html>.

* guix/scripts/edit.scm (guix-edit): Wrap 'execl' call in 'catch'.
  Provide more meaningful error message.
2015-11-05 12:04:26 +01:00
Ludovic Courtès 67c920fa5d edit: Lift helper procedure.
* guix/scripts/edit.scm (package->location-specification): New
  procedure, with code formerly...
  (guix-edit): ... here.  Use it.
2015-11-05 12:01:26 +01:00
Ludovic Courtès 5453de3dd8 import: hackage: Fix invalid use of 'leave'.
Reported by Paul van der Walt <paul@denknerd.org>
in <http://bugs.gnu.org/21829>.

* guix/scripts/import/hackage.scm (guix-import-hackage): Add missing
  argument in call to 'leave'.
2015-11-04 23:54:12 +01:00