summaryrefslogtreecommitdiff
path: root/guix/scripts
AgeCommit message (Collapse)Author
2016-05-04services: herd: Move UI handling to 'guix system'.Ludovic Courtès
This makes (gnu services herd) independent of (guix ui). * gnu/services/herd.scm (&shepherd-error, &service-not-found-error) (&action-not-found-error, &action-exception-error) (&unknown-shepherd-error): New error condition types. (report-action-error): Remove. (raise-shepherd-error): New procedure. (display-message): Do not use 'info' and '_'. (invoke-action): Use 'raise-shepherd-error' instead of 'report-action-error'. Do not use 'warning'. (current-services): Do not use 'warning'. * guix/scripts/system.scm (with-shepherd-error-handling): New macro. (report-shepherd-error, call-with-service-upgrade-info): New procedures. (upgrade-shepherd-services): Use it.
2016-04-29guix system: Reduce size of image produced for 'vm' action.Ludovic Courtès
This reduces the size of the image produced by 'guix system vm' from 26 MiB to 9 MiB. * gnu/system/vm.scm (system-qemu-image/shared-store): (system-qemu-image/shared-store-script): Change the default value of #:disk-image-size to 30 MiB when not FULL-BOOT?. * guix/scripts/system.scm (system-derivation-for-action): Likewise for the 'vm' action.
2016-04-28lint: 'check-vulnerabilities' follows package replacements.Ludovic Courtès
* guix/scripts/lint.scm (check-vulnerabilities): Check the replacement of PACKAGE. * tests/lint.scm ("cve: patched vulnerability in replacement"): New test.
2016-04-27challenge: Use exit code 2 when discrepancies are found.Ludovic Courtès
Suggested by John Darrington <john@darrington.wattle.id.au>. * guix/scripts/challenge.scm (guix-challenge): Exit with 2 when MISSING is not empty. * doc/guix.texi (Invoking guix challenge): Document it.
2016-04-27lint: Report synopses/descriptions that are not strings.Ludovic Courtès
Suggested by John Darrington. * guix/scripts/lint.scm (check-description-style): Emit a warning when DESCRIPTION is not a string. (check-synopsis-style): Likewise. (check-gnu-synopsis+description): Likewise. * tests/lint.scm ("description: not a string", "synopsis: not a string"): New tests.
2016-04-25guix gc: Add '--free-space'.Ludovic Courtès
* guix/scripts/gc.scm (show-help, %options): Add '--free-space'. (guix-gc)[ensure-free-space]: New procedure. Handle '--free-space'.
2016-04-20substitute: Sanitize the client-provided column number.Ludovic Courtès
* guix/scripts/substitute.scm (client-terminal-columns): Sanitize the client's column number.
2016-04-20substitute: Install the client's locale.Ludovic Courtès
* guix/store.scm (set-build-options): Add #:locale parameter and honor it. * guix/scripts/substitute.scm (guix-substitute): Install the client's locale.
2016-04-20substitute: Internationalize signature and download messages.Ludovic Courtès
* guix/scripts/substitute.scm (assert-valid-narinfo): Use gettext for messages.
2016-04-20substitute: Better abbreviate substitute URL in progress report.Ludovic Courtès
Suggested by Danny Milosavljevic <dannym@scratchpost.org>. * guix/build/download.scm (nar-uri-abbreviation): New procedure. * guix/scripts/substitute.scm (process-substitution): Use it instead of 'store-path-abbreviation'.
2016-04-15substitute: Honor the number of columns of the client terminal.Ludovic Courtès
* guix/store.scm (set-build-options): Add #:terminal-columns parameter and honor it. * guix/scripts/substitute.scm (client-terminal-columns): New procedure. (guix-substitute): Use it to parameterize 'current-terminal-columns'.
2016-04-15guix download: Honor the number of columns of the terminal.Ludovic Courtès
* guix/scripts/download.scm (guix-download): Parameterize 'current-terminal-columns'.
2016-04-14lint: Emit an ANSI erase-in-line sequence.Danny Milosavljevic
* guix/scripts/lint.scm (run-checkers): Add '\x1b[K' to progress messages and after 'for-each'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-04-07environment: container: Work around read-only /etc/resolv.conf issue.David Thompson
* guix/scripts/environment.scm (launch-environment/container): Mount /etc/resolv.conf as a writable file.
2016-04-06challenge: Really exit with non-zero upon hash mismatch.Ludovic Courtès
Reported by John Darrington. * guix/scripts/challenge.scm (guix-challenge): Add an explicit 'exit' call when ISSUES is empty. * scripts/guix.in: Add comment about 'exit'. * doc/guix.texi (Invoking guix challenge): Mention the behavior and exit code.
2016-04-04emacs: Use 'build-and-use-profile' from (guix scripts package).Alex Kost
* guix/scripts/package.scm: Export 'build-and-use-profile'. * emacs/guix-main.scm (process-package-actions): Use it.
2016-03-30import: Add Hackage updater.Eric Bavier
* guix/import/hackage.scm (guix-package->hackage-name, hackage-package?) (latest-release): New procedures. (%hackage-updater): New variable. * guix/scripts/refresh.scm (%updaters): Add it. * doc/guix.texi (Invoking guix refresh): Mention it.
2016-03-30environment: Set a default value for PS1.David Thompson
* guix/scripts/environment.scm (launch-environment/container): Set PS1 during container initialization.
2016-03-28guix system: Warn against missing 'guix pull'.Ludovic Courtès
Suggested by Leo Famulari and others. * guix/scripts/system.scm (maybe-suggest-running-guix-pull): New procedure. (perform-action): Call it when ACTION is 'reconfigure.
2016-03-27environment: Properly handle SIGINT.David Thompson
Switching to execlp means that the process spawned in a container is PID 1, which obsoleted one of the 'guix environment --container' tests because the init process can't be killed in the usual manner. * guix/scripts/environment.scm (launch-environment/fork): New procedure. (launch-environment): Switch from system* to execlp. Add handler for SIGINT. (guix-environment): Use launch-environment/fork. * tests/guix-environment-container.sh: Replace abnormal exit test with one that works now that the spawned process is PID 1.
2016-03-26environment: container: Create dummy home directory and /etc/passwd.David Thompson
* guix/scripts/environment.scm (launch-environment/container): Change $HOME to the current user's home directory instead of /homeless-shelter. Create a dummy /etc/passwd with a single entry for the current user. * doc/guix.texi ("invoking guix environment"): Add a note about the dummy home directory and /etc/passwd.
2016-03-23guix build: '--with-source' correctly matches versioned file names.Ludovic Courtès
* guix/scripts/build.scm: Use the right 'package-name->name+version' procedure. Fixes a regression introduced in 1b846da8c372bee78851439fd9e72b2499115e5a. * tests/scripts-build.scm ("options->transformation, with-source, with version"): New test.
2016-03-23substitute: Gracefully handle TLS errors.Ludovic Courtès
* guix/scripts/substitute.scm (with-networking): Use 'match-lambda*' and add case for 'gnutls-error'.
2016-03-17substitute: Do not leak file descriptors for TLS connections.Ludovic Courtès
Partially fixes <http://bugs.gnu.org/20145>. * guix/scripts/substitute.scm (fetch, download-cache-info): (http-multiple-get, fetch-narinfos, progress-report-port): Use 'close-connection' instead of 'close-port'.
2016-03-17substitute: Cache transient HTTP errors for 10mn.Ludovic Courtès
* guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]: Cache transient errors for 10mn. (%narinfo-transient-error-ttl): New variable.
2016-03-17lint: Do not leak file descriptors for TLS connections.Ludovic Courtès
Partially fixes <http://bugs.gnu.org/20145>. * guix/scripts/lint.scm (probe-uri): Use 'close-connection' instead of 'close-port'.
2016-03-17substitute: Update progress for responses different from 200/404.Ludovic Courtès
* guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]: Add missing call to 'update-progress!'.
2016-03-16substitute: Honor client-provided empty URL list.Ludovic Courtès
Before that, 'guix build --substitute-urls=""' would lead to using the daemon's own URL list instead of the empty list. The 'or*' hack, which is to blame, had become unnecessary since commit fb4bf72be3fbc23bca35ba4b842b7e1517ef0e3a. Reported by Mark H Weaver <mhw@netris.org>. * guix/scripts/substitute.scm (or*): Remove. (%cache-urls): Use 'or' instead of 'or*'. * tests/store.scm ("substitute query, alternating URLs"): Add test with empty URL list. * doc/guix.texi (Common Build Options): Mention the empty string.
2016-03-16substitute: Honor the 'max-age' of 'Cache-Control' headers.Ludovic Courtès
This allows substitute servers to tell 'guix substitute' how long they can cache narinfo lookups. * guix/scripts/substitute.scm (cache-narinfo!): Add 'ttl' parameter. [cache-entry]: Honor it. (fetch-narinfos)[handle-narinfo-response]: Check the 'Cache-Control' header of RESPONSE and pass its 'max-age' value to 'cache-narinfo!'.
2016-03-16substitute: Make room for a 'ttl' field in cached entries.Ludovic Courtès
* guix/scripts/substitute.scm (cached-narinfo): Expect 'narinfo' sexp version 2 with a 'ttl' field. (cache-narinfo!)[cache-entry]: Produce 'narinfo' sexp version 2 with a 'ttl' field. (remove-expired-cached-narinfos)[expired?]: Read 'narinfo' sexp version 2.
2016-03-14substitute: Keep the initial connection alive.Ludovic Courtès
The connection used to fetch /nix-cache-info is now reused for the subsequent narinfo requests. * guix/scripts/substitute.scm (download-cache-info)[download]: Remove. [uri, read-cache-info]: New variables. Rewrite in terms of 'http-fetch' instead of 'fetch'. Return an open port in addition to a <cache-info>. * guix/scripts/substitute.scm (http-multiple-get): Add #:port parameter and honor it. (fetch-narinfos)[do-fetch]: Add 'port' parameter. Adjust to new 'download-cache-info' and 'do-fetch' signatures.
2016-03-14substitute: Remove dead code.Ludovic Courtès
This parameter became unused with the switch to HTTP pipelining in commit d3a652037ef879f9279bc056c43d15ba7afcbb25. * guix/scripts/substitute.scm (fetch): Remove #:quiet-404? and adjust accordingly.
2016-03-14size: Disable grafts.Ludovic Courtès
* guix/scripts/size.scm (guix-size): Parametrize '%graft?'.
2016-03-10substitute: Optimize HTTP pipelining over TLS.Ludovic Courtès
* guix/scripts/substitute.scm (http-multiple-get): Write the requests to a bytevector output port before sending them.
2016-03-10substitute: Add HTTPS support.Ludovic Courtès
Fixes <http://bugs.gnu.org/22937>. Reported by Chris Marusich <cmmarusich@gmail.com>. * guix/scripts/substitute.scm (fetch): Add 'https' alongside 'http'. Use 'open-connection-for-uri' instead of 'open-socket-for-uri'. Call 'setvbuf' only when PORT matches 'file-port?'. (http-multiple-get): Likewise. Change 'base-url' parameter to 'base-uri'. (fetch-narinfos)[do-fetch]: Add 'https' case alongside 'http'. Pass URI instead of URL to 'http-multiple-get'. * doc/guix.texi (Requirements): Move GnuTLS one level higher and mention HTTPS substitutes. (Substitutes): Mention HTTPS and recommend it. Explain why servers are not authenticated. Add "On Trusting Binaries" subsection.
2016-03-09substitute: Error out on unsupported URL schemes.Ludovic Courtès
Reported in <http://bugs.gnu.org/22937> by Chris Marusich <cmmarusich@gmail.com>. * guix/scripts/substitute.scm (fetch): Add 'else' case and call 'leave'.
2016-03-08guix build: Add '--quiet'.Ludovic Courtès
Fixes <http://bugs.gnu.org/19772>. Reported by Andrei Osipov <andrspv@gmail.com>. * guix/scripts/build.scm (show-help, %options): Add --quiet. (guix-build): Parameterize 'current-build-output-port' accordingly. * doc/guix.texi (Invoking guix build): Use it in example. (Additional Build Options): Document it.
2016-03-08guix system: Write the GC root on the target file system.Ludovic Courtès
Fixes <http://bugs.gnu.org/22802>. Reported by Jookia <166291@gmail.com>. * guix/scripts/system.scm (install-grub*): Prepend TARGET to GC-ROOT.
2016-03-05guix build: Set the build options early.Ludovic Courtès
This fixes a bug whereby, with grafts leading to builds very early, build options such as --substitute-urls would not be taken into account yet. Reported by Andreas Enge <andreas@enge.fr>. * guix/scripts/build.scm (guix-build): Move 'opts' to the beginning. Use 'with-store' instead of 'open-connection'. Call 'set-build-options-from-command-line' right after 'with-store'.
2016-03-04lint: cve: Gracefully handle HTTP errors.Ludovic Courtès
* guix/scripts/lint.scm (current-vulnerabilities*): New procedure. (package-vulnerabilities): Use it.
2016-03-03lint: derivation: Disable grafts, but check replacements.Ludovic Courtès
* guix/scripts/lint.scm (check-derivation): Pass #:graft? #f. When 'package-replacement' exists, compute its derivation.
2016-03-03guix build: -S returns the replacement's source.Ludovic Courtès
Reported by Mark H Weaver. * guix/scripts/build.scm (options->derivations): When SRC and GRAFT? are true, use the source of P's replacement. * tests/guix-build.sh: Add test.
2016-03-02utils: Use '@' for separating package names and version numbers.Mathieu Lirzin
This provides the ability to use numbers in package names. Fixes <http://bugs.gnu.org/19219>. * guix/utils.scm (package-name->name+version): New procedure. * gnu/packages.scm (%find-package): Add a FALLBACK? keyword argument. Use the previous method when no package is found. (specification->package+output, specification->package): Adapt documentation to new syntax. * doc/guix.texi (Invoking guix package, Invoking guix import): Likewise. * guix/ui.scm (package-specification->name+version+output): Likewise. * guix/scripts/import/hackage.scm (show-help): Likewise. * tests/guix-build.sh: Adapt to new syntax. * tests/guix-lint.sh: Likewise. * tests/guix-package.sh: Likewise. * tests/ui.scm ("package-specification->name+version+output"): Likewise. * tests/utils.scm ("package-name->name+version"): Likewise. * NEWS: Mention new syntax.
2016-03-02graph: Ignore 'GUIX_BUILD_OPTIONS'.Ludovic Courtès
Previously 'GUIX_BUILD_OPTIONS' would be honored, but 'guix graph' does not support the common build options. * guix/scripts/graph.scm (guix-graph): Use 'args-fold*' instead of 'parse-command-line'.
2016-03-02guix build: Move '--no-grafts' to the common build options.Ludovic Courtès
* guix/scripts/build.scm (%options): Move --no-grafts to... (%standard-build-options): ... here. (show-help, show-build-options-help): Adjust accordingly. * guix/scripts/archive.scm (%default-options): Add 'graft?'. (guix-archive): Parametrize '%graft?'. * guix/scripts/environment.scm (%default-options): Add 'graft?'. (guix-environment): Parametrize '%graft?'. * guix/scripts/package.scm (%default-options): Add 'graft?'. (guix-package): Parametrize '%graft?'. * guix/scripts/system.scm (%default-options): Add 'graft?'. (guix-system): Parametrize 'graft?'. * doc/guix.texi (Additional Build Options): Move --no-grafts to... (Common Build Options): ... here.
2016-03-02guix archive: Use 'with-store'.Ludovic Courtès
* guix/scripts/archive.scm (guix-archive): Use 'with-store' instead of an explicit 'open-connection'.
2016-03-01grafts: Graft recursively.Ludovic Courtès
Fixes <http://bugs.gnu.org/22139>. * guix/grafts.scm (graft-derivation): Rename to... (graft-derivation/shallow): ... this. (graft-origin-file-name, item->deriver, non-self-references) (cumulative-grafts, graft-derivation): New procedures * tests/grafts.scm ("graft-derivation, grafted item is a direct dependency"): Clarify title. Use 'grafted' instead of 'graft' to refer to the grafted derivation. ("graft-derivation, grafted item is an indirect dependency") ("graft-derivation, no dependencies on grafted output"): New tests. * guix/packages.scm (input-graft): Change to take a package instead of an input. (input-cross-graft): Likewise. (fold-bag-dependencies): New procedure. (bag-grafts): Rewrite in terms of 'fold-bag-dependencies'. * tests/packages.scm ("package-derivation, indirect grafts"): Comment out. * doc/guix.texi (Security Updates): Mention run-time dependencies and recursive grafting.
2016-02-26import: Add github-updater.Ben Woodcroft
* guix/import/github.scm: New file. * guix/scripts/refresh.scm (%updaters): Add %GITHUB-UPDATER. * doc/guix.texi (Invoking guix refresh): Mention it. * Makefile.am (MODULES): Add gnu/import/github.scm.
2016-02-26store: 'path-info-deriver' is #f when there is no deriver.Ludovic Courtès
* guix/store.scm (read-path-info): Use #f when we get the empty string for DERIVER. * guix/scripts/publish.scm (narinfo-string): Adjust accordingly. * tests/store.scm ("path-info-deriver"): New test.
2016-02-25Merge branch 'media-updates'Mark H Weaver