Commit Graph

532 Commits (35b50a753563c03a57d98761d7ebff12efdd5c3d)

Author SHA1 Message Date
Ludovic Courtès fb4bf72be3 store: Use the daemon's substitute URLs by default.
Partly fixes <http://bugs.gnu.org/20217>.

* guix/store.scm (set-build-options): Change #:substitute-urls to
  default to #f.  Send the 'substitute-urls' pair only if
  SUBSTITUTE-URLS is true.
* guix/scripts/build.scm (set-build-options-from-command-line): Do not
  default to %DEFAULT-SUBSTITUTE-URLS for #:substitute-urls.
* guix/scripts/size.scm (%default-options): Remove 'substitute-urls'.
2015-10-28 15:31:44 +01:00
David Thompson 34a1783fc1 scripts: build: Add --file option.
* guix/scripts/build.scm (show-help): Add help text for --file option.
  (%options): Add --file option.
  (options/resolve-packages): Handle 'file' options.
* tests/guix-build.sh: Add tests.
* doc/guix.texi ("invoking guix build"): Add doc.
2015-10-28 08:40:16 -04:00
Ludovic Courtès 55b2fc1877 substitute: Honor all the specified server URLs.
* guix/scripts/substitute.scm (lookup-narinfos/diverse): New procedure.
  (lookup-narinfo): Use it.
  (process-query): Change #:cache-url to #:cache-urls.
  [valid?]: Remove 'narinfo?' check, which is no longer necessary.
  Use 'lookup-narinfos/diverse' instead of 'lookup-narinfos'.
  (process-substitution): Change #:cache-url to #:cache-urls.
  (%cache-url): Rename to...
  (%cache-urls): ... this.  Turn into a list.
  (guix-substitute): Remove 'getaddrinfo' test with early exit.  Adjust
  calls to 'process-query' and 'process-substitution'.
* tests/substitute.scm: Change '%cache-url' to '%cache-urls'.
2015-10-28 12:04:03 +01:00
Ludovic Courtès a89dde1ed8 substitute: 'lookup-narinfos' returns exactly a list of narinfos.
* guix/scripts/substitute.scm (lookup-narinfos): Filter out #f values
  from CACHED, such that the end result is exactly a list of narinfos,
  not interspersed with #f.
* guix/scripts/challenge.scm (discrepancies): Assume REMOTE is a list of
  narinfos.
2015-10-28 12:04:03 +01:00
Ludovic Courtès f151298fa0 substitute: 'http-multiple-get' follows 'fold' style.
* guix/scripts/substitute.scm (http-multiple-get): Add 'seed'
  parameter.  Call PROC in 'fold' style.
  (fetch-narinfos)[handle-narinfo-response]: Adjust accordingly.
  Update 'http-multiple-get' call accordingly.
2015-10-28 12:04:03 +01:00
Alex Kost 6ffa706b6d refresh: Add '--list-updaters' option.
* guix/scripts/refresh.scm (list-updaters-and-exit): New procedure.
  (%options, show-help): Add '--list-updaters' option.
* doc/guix.texi (Invoking guix refresh): Document it.
2015-10-27 21:54:57 +03:00
Ludovic Courtès 06d45f4566 profiles: Add generation manipulation procedures.
* guix/scripts/package.scm (delete-generations): Use
  'delete-generation*' instead of 'delete-generation'.
  (guix-package)[process-actions]: Use 'roll-back*' instead of
  'roll-back' and 'switch-to-generation*' instead of
  'switch-to-generation'.
  (link-to-empty-profile, switch-to-generation,
  switch-to-previous-generation, roll-back, delete-generation): Move
  to...
* guix/profiles.scm: ... here.  Adjust to not print messages and to
  return values that can be used by user interfaces.
* guix/ui.scm (display-generation-change, roll-back*,
  switch-to-generation*, delete-generation*): New procedures.
2015-10-27 00:01:20 +01:00
Ludovic Courtès 3bb168b099 utils: Add 'switch-symlinks', moved from (guix ui).
* guix/ui.scm (switch-symlinks): Move to...
* guix/utils.scm: ... here.  New procedure.
* guix/scripts/pull.scm: Use it.
2015-10-27 00:01:20 +01:00
Ludovic Courtès 65797bfffd guix system: Add the 'list-generations' command.
* guix/scripts/system.scm (display-system-generation, list-generations):
  New procedures.
  (process-action): Clarify docstring.
  (process-command): New procedure.
  (guix-system)[parse-sub-command]: Add 'list-generations'
  Call 'process-command' instead of 'process-action'.
* doc/guix.texi (Using the Configuration System): Mention generations,
  rollback, and 'list-generations'.
  (Invoking guix system): Document 'list-generations'.
2015-10-27 00:01:20 +01:00
Ludovic Courtès 5b516ef369 guix system: Factorize boot parameter parsing.
* guix/scripts/system.scm (<boot-parameters>): New record type.
  (read-boot-parameters): New procedure.
  (previous-grub-entries)[system->grub-entry]: Use it.
2015-10-27 00:01:20 +01:00
Ludovic Courtès ad18c7e64c ui: Add procedures to display a profile generation.
* guix/scripts/package.scm (guix-package)[process-query](list-generations):
  Move part of the body to 'delete-generation' and
  'display-profile-content'.
* guix/ui.scm (display-generation, display-profile-content): New
  procedures.
2015-10-27 00:01:20 +01:00
Ludovic Courtès d50cb56d9b utils: Add 'readlink*'.
* guix/scripts/package.scm (readlink*): Move to...
* guix/utils.scm (readlink*): ... here.  New procedure.
2015-10-27 00:01:20 +01:00
Ludovic Courtès deaab8e314 guix system: Extract action processing.
* guix/scripts/system.scm (process-action): New procedure.  Extracted
  from...
  (guix-system): ... here.  Use it.
2015-10-27 00:01:20 +01:00
Ludovic Courtès e49de93aa5 ui: Add 'matching-generations'.
* guix/scripts/package.scm (matching-generations): Move to...
* guix/ui.scm (matching-generations): ... here.
2015-10-27 00:01:20 +01:00
David Thompson f535dcbe19 scripts: environment: Add --container option.
* guix/scripts/system.scm (specification->file-system-mapping): Move from
  here...
* guix/ui.scm (specification->file-system-mapping): ... to here.
* guix/scripts/enviroment.scm (show-help): Show help for new options.
  (%options): Add --container --network, --expose, and --share options.
  (%network-configuration-files): New variable.
  (launch-environment, launch-environment/container, requisites*,
  inputs->requisites): New procedures.
  (guix-environment): Spawn new process in a container when requested.
* doc/guix.texi (Invoking guix environment): Document it.
* tests/guix-environment-container.sh: New file.
* Makefile.am (SH_TESTS): Add it.
2015-10-25 20:27:19 -04:00
Paul van der Walt 8e01e30077 import: hackage: Fix grammar.
Minor clarification regarding the test-dependencies command line option.

* guix/scripts/import/hackage.scm (show-help): Minor grammatical fix.
2015-10-23 09:10:52 +02:00
Ludovic Courtès d882c235d9 import: cran: Add updater.
* guix/import/cran.scm (downloads->url, nodes->text): New procedures.
  (cran-sxml->sexp): Use them.  Remove equivalent local code.
  (latest-release, cran-package?): New procedures.
  (%cran-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add %CRAN-UPDATER.
* doc/guix.texi (Invoking guix refresh): Mention CRAN.
2015-10-21 14:44:41 +02:00
Ludovic Courtès 577e750580 refresh: Remove exception catch-all.
* guix/scripts/refresh.scm (update-package): Remove 'catch #t'.
2015-10-21 14:44:41 +02:00
Ludovic Courtès bcb571cba4 refresh: Add '--type' option.
* guix/scripts/refresh.scm (%options, show-help): Add --type.
  (lookup-updater): New procedure.
  (update-package): Add 'updaters' parameter and honor it.
  (guix-refresh)[options->updaters]: New procedure.
  Use it, and honor --type.
2015-10-21 14:44:41 +02:00
Ludovic Courtès a7aac93625 import: elpa: Add updater.
* guix/import/elpa.scm (latest-release, package-from-gnu.org?): New
  procedures.
  (%elpa-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add %ELPA-UPDATER.
2015-10-21 14:44:38 +02:00
Ludovic Courtès 0a7c5a09fe gnu-maintenance: Generalize, leading to (guix upstream).
* guix/gnu-maintenance.scm (<gnu-release>): Remove.
  (coalesce-releases): Move to upstream.scm.  Rename to
  'coalesce-sources'; adjust callers.
  (releases, latest-release): Return <upstream-source> objects instead
  of <gnu-release> objects.
  (latest-release*, non-emacs-gnu-package?): New procedures.
  (gnu-release-archive-types): Remove.
  (%gnu-updater): New variable.
  (package-update-path, download-tarball, package-update,
  update-package-source): Move to...
* guix/upstream.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* po/guix/POTFILES.in: Replace gnu-maintenance.scm with upstream.scm.
* guix/scripts/refresh.scm (%updaters): New variable.
  (update-package): Adjust to new 'package-update' interface.
  (guix-refresh): Adjust to new 'package-update-path'.  Remove
  'false-if-exception' around it.
2015-10-21 14:43:34 +02:00
Ludovic Courtès d23c20f1d0 Add 'guix challenge'.
* guix/scripts/challenge.scm, tests/challenge.scm: New files.
* Makefile.am (MODULES): Add the former.
  (SCM_TESTS): Add the latter.
* doc.am (SUBCOMMANDS): Add 'challenge'.
* doc/guix.texi (Substitutes): Add xref to 'guix challenge'.
  (Invoking guix challenge): New node.
* doc/contributing.texi (Submitting Patches): Add note about using 'guix
  challenge'.
* po/guix/POTFILES.in: Add guix/scripts/challenge.scm.
2015-10-20 00:57:36 +02:00
Ludovic Courtès ea0c6e0507 substitute: Expose narinfo access.
* guix/scripts/substitute.scm: Export <narinfo> accessors.
  (narinfo-hash->sha256): New procedure.
  (cache-narinfo!): Ignore EACCES exceptions.
2015-10-19 23:12:34 +02:00
Ludovic Courtès c6f8e9dd64 guix archive: Add '--extract'.
* guix/scripts/archive.scm (show-help, %options): Add --extract.
  (guix-archive): Honor it.
* tests/guix-archive.sh: Test it.
* doc/guix.texi (Invoking guix archive): Document it.
2015-10-19 10:10:47 +02:00
Ludovic Courtès 6f305ea5fd guix system: Add 'dmd-graph' command.
* guix/scripts/system.scm (dmd-service-node-label,
  dmd-service-node-type, export-dmd-graph): New procedures.
  (show-help): Add 'dmd-graph'.
  (guix-system)[parse-sub-command]: Likewise.
  Honor it.
* doc/guix.texi (Invoking guix system): Document it.
  (dmd Services): Add an illustration and explanation.
* doc/images/dmd-graph.dot: New file.
* doc.am (DOT_FILES): Add it.
2015-10-14 21:39:06 +02:00
Ludovic Courtès d6c3267a32 guix system: Add 'extension-graph' command.
* guix/scripts/system.scm (service-node-label, service-node-type,
  export-extension-graph): New procedures.
  (guix-system)[parse-sub-command]: Add 'extension-graph'.
  Honor it.
  (show-help): Add 'extension-graph'.
* doc/guix.texi (Invoking guix system): Document it.
  (Service Composition): Add cross-reference.
2015-10-14 21:39:05 +02:00
Ludovic Courtès a64cd7b65f graph: 'export-graph' takes a #:reverse-edges? parameter.
* guix/scripts/graph.scm (export-graph): Add #:reverse-edges? parameter
  and honor it.
2015-10-14 21:39:05 +02:00
Ludovic Courtès f3f427c2e9 guix system: Add '--derivation'.
* guix/scripts/system.scm (perform-action): Add #:derivations-only?
  parameter and honor it.
  (show-help, %options): Add '--derivation'.
  (guix-system): Pass #:derivations-only? to 'perform-action'.
* tests/guix-system.sh: Test it.
* doc/guix.texi (Invoking guix system): Document it.
2015-10-10 22:46:15 +02:00
David Thompson 1de2fe95e0 scripts: environment: Use system* instead of system.
This allows for direct program invokation without needing a shell to act
as a command interpreter.

* guix/scripts/environment.scm (%default-shell): New variable.
  (show-help): Adjust description.  Remove '--exec' reference.
  (%default-options): Use '%default-shell'.
  (%options): Adjust '--exec' to run command via the default shell.
  (parse-args): New procedure.
  (guix-environment): Use 'parse-args'.  Use 'system*' instead of
  'system'.
* tests/guix-environment.sh: Add test for '--' command invokation.
* doc/guix.texi ("Invoking guix environment"): Use new syntax.  Remove
  '--exec' documentation.
2015-10-09 12:17:01 -04:00
Alex Kost e04741f160 lint: Export 'run-checkers'.
* guix/scripts/lint.scm (run-checkers): Export.  Make 'checkers'
  argument optional.
2015-10-09 16:17:45 +03:00
Ludovic Courtès cf4e7083ed publish: Fix file descriptor leak.
A client closing the connection while reading from a /nar URL would
leave an open file descriptor in the server.  This patch fixes it.

* guix/scripts/publish.scm (swallow-EPIPE): New macro.
  (http-write): Use it around 'write-file' call.
2015-10-06 23:51:04 +02:00
Ludovic Courtès 30d9aa5422 guix gc: Add '--list-failures' and '--clear-failures'.
Suggested by Mark H Weaver <mhw@netris.org>.

* guix/scripts/gc.scm (show-help, %options): Add --list-failures and
  --clear-failures.
  (guix-gc): Honor them.
* doc/guix.texi (Invoking guix gc): Document them.
  (Invoking guix-daemon): Mention them.
2015-09-28 22:54:04 +02:00
Mathieu Lirzin cd8b7cfb3f lint: Fix 'check-texinfo-markup'.
Fixes a regression introduced in 5d8d8f3.

* guix/scripts/lint.scm (check-description-style): When no exception is
  thrown in 'check-texinfo-markup', return the rendered description.
2015-09-28 00:23:12 +02:00
Mathieu Lirzin 5d8d8f3b0a lint: Improve 'check-texinfo-markup'.
* guix/scripts/lint.scm (check-description-style): Set 'field' parameter
  when emitting a warning in 'check-texinfo-markup'.  Catch any error
  that may occur in during the 'texi->plain-text' conversion.  This is a
  followup to commit 2748ee3.
2015-09-26 15:10:13 +02:00
Ludovic Courtès 5ef9d7deea offload: Use gzip instead of xz for compression on the master.
* guix/scripts/offload.scm (send-files): Use gzip --fast instead of xz.
2015-09-25 22:35:35 +02:00
Mathieu Lirzin 23464bfd99 lint: Accept '`' character.
* guix/scripts/lint.scm (properly-starts-sentence?): Match Texinfo
  highlighting commands as a sentence start.
2015-09-24 22:55:59 +02:00
Mathieu Lirzin 2748ee3bcf lint: Check non-translated package descriptions.
* guix/ui.scm (texi->plain-text): Export.
* guix/scripts/lint.scm (check-description-style): Use it instead of
  'package-description-string'.
2015-09-24 22:46:20 +02:00
Alex Kost 430505eba3 scripts: Add 'build-package'.
* guix/scripts/system.scm (maybe-build): Move to ...
* guix/scripts.scm: ...here.
  (build-package): New procedure.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-09-22 22:05:10 +03:00
Ludovic Courtès e0566f12f8 lint: Report lonely parentheses.
* guix/scripts/lint.scm (%hanging-paren-rx): New variable.
  (report-lone-parentheses): New procedure.
  (%formatting-reporters): Use it.
* tests/lint.scm ("formatting: lonely parentheses"): New test.
2015-09-18 21:54:04 +02:00
Alex Kost fa394eb99c ui: Add 'show-derivation-outputs'.
* guix/scripts/build.scm (guix-build): Extract code from here and move to...
* guix/ui.scm (show-derivation-outputs): ... here.  New procedure.
2015-09-18 21:42:06 +03:00
Alex Kost 88981dd3e2 Add (guix scripts).
* guix/ui.scm: Add missing copyright lines.
  (args-fold*, environment-build-options, %default-argument-handler,
  parse-command-line): Move to ...
* guix/scripts.scm: ...here.  New file.
* guix/scripts/archive.scm: Use it.
* guix/scripts/build.scm: Likewise.
* guix/scripts/download.scm: Likewise.
* guix/scripts/edit.scm: Likewise.
* guix/scripts/environment.scm: Likewise.
* guix/scripts/gc.scm: Likewise.
* guix/scripts/graph.scm: Likewise.
* guix/scripts/hash.scm: Likewise.
* guix/scripts/import/cpan.scm: Likewise.
* guix/scripts/import/cran.scm: Likewise.
* guix/scripts/import/elpa.scm: Likewise.
* guix/scripts/import/gem.scm: Likewise.
* guix/scripts/import/gnu.scm: Likewise.
* guix/scripts/import/hackage.scm: Likewise.
* guix/scripts/import/nix.scm: Likewise.
* guix/scripts/import/pypi.scm: Likewise.
* guix/scripts/lint.scm: Likewise.
* guix/scripts/package.scm: Likewise.
* guix/scripts/publish.scm: Likewise.
* guix/scripts/pull.scm: Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/scripts/size.scm: Likewise.
* guix/scripts/system.scm: Likewise.
* tests/ui.scm (with-environment-variable, "parse-command-line",
  "parse-command-line and --no options"): Move to ...
* tests/scripts.scm: ...here.  New file.
* Makefile.am (MODULES): Add guix/scripts.scm.
  (SCM_TESTS): Add tests/scripts.scm.
* po/guix/POTFILES.in: Add guix/scripts.scm.
2015-09-18 21:42:06 +03:00
Steve Sprang a8be7b9a7a substitute: Improve readability of download progress report.
* guix/build/download.scm
  (string-pad-middle, store-url-abbreviation, store-path-abbreviation):
  New procedures.
  (progress-proc): Add #:abbreviation parameter and use it.  Generate a
  better indeterminate progress string.
* guix/scripts/substitute.scm (assert-valid-narinfo): Add newlines to output.
  (process-substitution): Use byte-count->string and store-path-abbreviation.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-09-16 23:50:12 +02:00
Mathieu Lirzin 3500e659f1 lint: Add 'check-texinfo-markup' checker.
* guix/script/lint.scm (check-description-style): Check for invalid
  Texinfo markup.
* tests/lint.scm: Test it.
2015-09-15 19:01:23 +02:00
Eric Bavier 50f5c46d06 guix: lint: Check for meaningful origin file names.
* guix/scripts/lint.scm (check-source-file-name): New procedure.
  (%checkers): Add 'source-file-name' checker.
* tests/lint.scm ("source-file-name", "source-file-name: v prefix")
  ("source-file-name: valid", "source-file-name: bad checkout")
  ("source-file-name: good checkout"): New tests.
* doc/guix.texi (Invoking guix lint): Mention file name check.
2015-09-14 18:03:33 -05:00
Eric Bavier 3b4d01035f guix: packages: Add origin-actual-file-name.
* guix/scripts/graph.scm (uri->file-name, node-full-name): Move origin file
  name logic to...
* guix/packages.scm (origin-actual-file-name): ...here.
* tests/packages.scm ("origin-actual-file-name")
  ("origin-actual-file-name, file-name"): New tests.
2015-09-14 18:02:37 -05:00
Ludovic Courtès d89e0990f5 guix system: Gracefully handle incomplete commands.
Fixes <http://bugs.gnu.org/21451>.
Reported by Steve Sprang <steve.sprang@gmail.com>.

* guix/scripts/system.scm (guix-system)[option-arguments]: Error out
  when ACTION is #f.
2015-09-15 00:04:27 +02:00
Ludovic Courtès 3f208ad758 guix build: '--log-file' can return URLs.
* guix/scripts/build.scm (%default-log-urls): New variable.
  (log-url): New procedure.
  (guix-build): Use it.
* doc/guix.texi (Invoking guix build): Document it.
2015-09-10 23:14:16 +02:00
Ludovic Courtès ef30b974c9 pull: Update to the new cgit snapshot URL.
* guix/scripts/pull.scm (%snapshot-url): Update to the new URL.
2015-09-10 08:49:36 +02:00
Ludovic Courtès 52b9efe337 lint: Add 'license' checker.
* guix/scripts/lint.scm (check-license): New procedure.
  (%checkers): Add 'license' checker.
* tests/lint.scm ("license: invalid license"): New test.
2015-09-06 12:36:15 +02:00
Ludovic Courtès 9d2f48df02 publish: Gracefully handle the lack of a deriver.
* guix/scripts/publish.scm (narinfo-string): Catch 'system-error' around
  'load-derivation' call; return BASE-INFO upon ENOENT.  This allows us
  to return the narinfo even if DERIVER is missing.  Before that, the
  exception would be uncaught, leading to 500 Internal Error on the
  client side.
2015-09-04 00:13:05 +02:00