Commit Graph

1849 Commits

Author SHA1 Message Date
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 e946f2ec92 gnu-maintenance: Generalize 'latest-ftp-release'.
* guix/gnu-maintenance.scm (latest-release): Rename to...
(latest-ftp-release): ... this.  Add #:server and #:directory
parameters.
(latest-release): New procedure.
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
Ludovic Courtès e3cc793e7c gnu-maintenance: Do not look for releases in "w32" sub-directories.
* guix/gnu-maintenance.scm (latest-release): Filter out "w32"
directories.
2015-12-07 23:32:01 +01:00
Ludovic Courtès 202440e07a gnu-maintenance: Add tests for 'release-file?'.
* tests/gnu-maintenance.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* guix/gnu-maintenance.scm (release-file?): Export.
2015-12-07 23:32:01 +01:00
Ludovic Courtès fa04a04f18 gnu-maintenance: Properly handle TeXmacs.
* guix/gnu-maintenance.scm (ftp-server/directory): Add comment.
(release-file?): Use 'string-ci=?' instead of 'equal?' when comparing
project names.
2015-12-07 23:32:01 +01:00
Ludovic Courtès f00dccf441 gnu-maintenance: Adjust tarball regexp for IceCat tarballs.
* guix/gnu-maintenance.scm (%tarball-rx): Tweak to match IceCat tarball
patterns.
2015-12-07 23:32:01 +01:00
Ludovic Courtès b6124f00b8 gnu-maintenance: Fix URLs returned by 'latest-release' for deep trees.
With this, (latest-release "gcc") returns an <upstream-source> with URL:

  ftp://ftp.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.gz

Previous it would omit "gcc-5.3.0/" from the URL.

Fixes a regression introduced in 0a7c5a0.

* guix/gnu-maintenance.scm (latest-release)[file->url, file->source]:
Add 'directory' parameter.  Update users.
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 2aacd9179c profiles: Silence GTK+ icon cache creation.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/profiles.scm (gtk-icon-themes)[build]: Pass --quiet to
'gtk-update-icon-cache'.
2015-12-04 23:12:02 +01:00
Ludovic Courtès 4bddf74ef2 profiles: Silence GTK+ icon theme union.
Suggested by Ricardo Wurmus <rekado@elephly.net>.

* guix/profiles.scm (gtk-icon-themes)[build]: Pass 'union-build' a
  #:log-port argument.
2015-12-04 23:12:02 +01:00
Ludovic Courtès 2734cbb895 store: 'build-things' now supports older daemon protocols.
This is a followup to d203d3d.

* guix/store.scm (build-things): Add 'build/old'.  Use it when STORE's
minor version is less than 15.
2015-12-04 11:34:18 +02:00
Ludovic Courtès 07e70f4846 store: Add mode parameter to 'build-paths'.
* guix/store.scm (%protocol-version): Set minor to 15.
(build-mode): New enumerate type.
(build-things): Add 'mode' parameter; pass it to the RPC.
* tests/store.scm ("build-things, check mode"): New check.
2015-12-03 19:09:53 +02:00
Ludovic Courtès d203d3d4cb store: Update to the new daemon protocol.
* guix/store.scm (%protocol-version): Set minor to 14.
(open-connection): Add 'cpu-affinity' parameter and honor it.
2015-12-03 19:09:53 +02:00
Ludovic Courtès 85dce718cb import: pypi: Updater silently ignores packages without source.
Reported by Andreas Enge <andreas@enge.fr>
at <https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00764.html>.

* guix/import/pypi.scm (&missing-source-error): New error type.
(latest-source-release): Raise it instead of using 'error'.
(pypi->guix-package): Guard against it and use 'leave' to report the
error.
(latest-release): Guard against it and return #f when caught.
2015-12-01 23:18:48 +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 a665996f58 gnu: python: Set SOURCE_DATE_EPOCH to 1 instead of 0.
* gnu/packages/python.scm (python-2)[arguments]: Set SOURCE_DATE_EPOCH
  to 1 to match what the daemon does.
* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): Likewise.
2015-11-29 22:59:28 +01:00
Ludovic Courtès dedc832070 gnu: python-2: Honor 'SOURCE_DATE_EPOCH'.
* gnu/packages/patches/python-2.7-source-date-epoch.patch: New file.
* gnu/packages/python.scm (python-2)[source]: Use it.
  [arguments]: Set SOURCE_DATE_EPOCH in 'patch-lib-shells' phase.
* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): New
  procedure.
  (%standard-phases): Add it.
* gnu-system.am (dist_patch_DATA): Add patch.
2015-11-29 22:59:28 +01: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 25d188ce12 http-client: 'http-fetch' converts strings to URIs.
* guix/http-client.scm (http-fetch): Use 'string->uri' if URI is a
string.  Fixes a regression introduced in 8a5063f.
2015-11-29 17:46:11 +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
Ludovic Courtès 0eef755130 Add (guix cve).
* guix/cve.scm, tests/cve-sample.xml, tests/cve.scm: New files.
* Makefile.am (MODULES): Add guix/cve.scm.
(SCM_TESTS): Add tests/cve.scm.
(EXTRA_DIST): Add tests/cve-sample.scm.
2015-11-26 22:35:01 +01:00
Ludovic Courtès 8a5063f777 http-client: 'http-fetch' and 'http-fetch/cached' support HTTPS.
* guix/http-client.scm (http-fetch): Use 'open-connection-for-uri', to
support HTTPS.
2015-11-26 21:07:25 +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
Federico Beffa 96018e21e7 import: hackage: Handle CRLF end of line style.
* guix/import/hackage.scm (hackage-fetch, hackage->guix-package): Use
  'canonical-newline-port'.
2015-11-26 18:17:23 +01:00
Federico Beffa c8be6f0d4a utils: Add 'canonical-newline-port'.
* guix/utils.scm (canonical-newline-port): New procedure.
* tests/utils.scm ("canonical-newline-port"): New test.
2015-11-26 18:17:23 +01:00
Federico Beffa 94abc84887 import: hackage: Make parsing of tests and fields more flexible.
* guix/import/cabal.scm (is-test): Allow spaces between keyword and
  parentheses.
  (is-id): Add argument 'port'.  Allow spaces between keyword and column.
  (lex-word): Adjust call to 'is-id'.
2015-11-26 18:17:23 +01:00
Federico Beffa 876fd23ab6 import: hackage: Make it resilient to missing final newline.
* guix/import/cabal.scm (peek-next-line-indent): Check for missing final
  newline.
2015-11-26 18:17:23 +01:00
Federico Beffa 9be54eb1b1 import: hackage: Imporve parsing of tests.
* guix/import/cabal.scm (lex-word): Add support for tests with no spaces.
  (impl): Rewrite.
2015-11-26 18:17:23 +01:00
Federico Beffa 7716f55c83 import: hackage: Add recognition of 'true' and 'false' symbols.
* guix/import/cabal.scm (is-true, is-false, lex-true, lex-false): New procedures.
  (lex-word): Use them.
  (make-cabal-parser): Add TRUE and FALSE tokens.
  (eval): Add entries for 'true and 'false symbols.
2015-11-26 18:17:22 +01:00
Ludovic Courtès 851b6f6283 gexp: Build text derivations locally.
* guix/gexp.scm (gexp->file): Pass #:substitutable? #f.
(text-file*): Likewise, and #:local-build? #t.
2015-11-25 11:59:54 +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 d6d33984df ftp-client: Fix off-by-one when trying addresses in 'ftp-open'.
* guix/ftp-client.scm (ftp-open): Change to use 'match' instead of
car/cdr, and fix off-by-one (was '(null? addresses)' instead of
'(null? (cdr addresses))'.)
2015-11-22 14:16:36 +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