summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* challenge: Disable grafting.Ludovic Courtès2016-07-14
| | | | * guix/scripts/challenge.scm (guix-challenge): Set %GRAFT? to #f.
* substitute: Gracefully handle trailing slashes in URLs.Ludovic Courtès2016-07-14
| | | | | | | | | | | | Previously, using something like "--substitute-urls=http://example.org///" would lead to a 'cache-narinfo!' call with #f as its second argument. It would also do the wrong thing for URLs with a non-empty initial path component, such as "http://example.org/foo/bar". * guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]: Add call to 'basename' for PATH.
* lint: 'validate-uri' reports suspiciously small 200 responses.Ludovic Courtès2016-07-13
| | | | | | | | | | | | * guix/scripts/lint.scm (validate-uri): Upon 200 http-response, check the 'response-content-length' and emit a warning when it is <= 1000. * tests/lint.scm (call-with-http-server): Add 'data' parameter. (with-http-server): Likewise. (%long-string): New variable. ("home-page: 200"): Pass %LONG-STRING to 'with-http-server'. ("home-page: 404", "source: 200", "source: 404"): Likewise. ("home-page: 200 but short length"): New test. ("source: 200 but short length"): New test.
* gexp: Remove more uses of #:modules.Ludovic Courtès2016-07-12
| | | | | | | | * guix/scripts/system.scm (switch-to-system): Adjust comment. * tests/gexp.scm ("gexp->derivation #:references-graphs"): Use 'with-imported-modules' instead of #:modules. * tests/grafts.scm ("graft-derivation, preserve empty directories"): Likewise.
* substitute: Use ~/.cache when invoked by an unprivileged user.Ludovic Courtès2016-06-22
| | | | | | | | This is a followup to ea0c6e0507a6997f12a4f29d0445b51cf53bd81e. * guix/scripts/substitute.scm (%narinfo-cache-directory): Use 'cache-directory' when (getuid) returns non-zero. (cache-narinfo!): Remove 'catch'.
* publish: Add '--ttl'.Ludovic Courtès2016-06-09
| | | | | | | | * guix/scripts/publish.scm (show-help, %options): Add --ttl. (render-narinfo): Add #:ttl and honor it. (make-request-handler): Add #:narinfo-ttl and honor it. (run-publish-server): Likewise. (guix-publish): Honor --ttl, pass it to 'run-publish-server'.
* publish: Encore URIs that appear in narinfos.Ludovic Courtès2016-06-08
| | | | | | | | | | Fixes <http://bugs.gnu.org/21888>. Reported by iyzsong@member.fsf.org (宋文武). * guix/scripts/publish.scm (narinfo-string): Use 'encode-and-join-uri-path' instead of 'string-append' to compute URL. * tests/publish.scm ("/*.narinfo with properly encoded '+' sign"): ("/nar/ with properly encoded '+' sign"): New tests.
* offload: Use (guix build syscalls).Ludovic Courtès2016-05-31
| | | | | | This is a followup to 4e0ea3eb288c2143b44bf324c64047762c72d3b3. * guix/scripts/offload.scm: Use (guix build syscalls).
* guix package: Inherit the transformed version number.Ludovic Courtès2016-05-27
| | | | | | | | | | | Previously, 'guix package -i emacs --with-source=./emacs-42.tar.gz' would fail to use "42" as the version number in the manifest entry. Reported by piyo on #guix. * guix/scripts/package.scm (process-actions)[transform-entry]: Inherit the version number from the result of TRANSFORM when it's a package. * tests/guix-package.sh: Test it.
* substitute: Internationalize the "Downloading" message.Ludovic Courtès2016-05-26
| | | | | * guix/scripts/substitute.scm (process-substitution): I18n "Downloading" message.
* size: Pass 'requisites' a list of items.Ludovic Courtès2016-05-24
| | | | | | | | * guix/scripts/size.scm (substitutable-requisites): Change 'item' to 'items' and adjust. (requisites*): Likewise. (mappend-map): Remove. (store-profile): Adjust accordingly.
* store: 'requisites' now takes a list of store items.Ludovic Courtès2016-05-24
| | | | | | | | | | | * guix/store.scm (fold-path): Change 'path' to 'paths' and adjust body accordingly. (requisites): Likewise. * guix/scripts/environment.scm (inputs->requisites): Adjust user accordingly. * guix/scripts/size.scm (requisites*): Likewise. * guix/scripts/gc.scm (guix-gc): Likewise. * tests/store.scm ("requisites"): Likewise.
* size: Accept several arguments.Ludovic Courtès2016-05-24
| | | | | | * guix/scripts/size.scm (display-profile): Display WHOLE at then end. (guix-size): Accept several FILES. * doc/guix.texi (Invoking guix size): Add example with several items.
* size: 'store-profile' takes a list of store items.Ludovic Courtès2016-05-24
| | | | | | | * guix/scripts/size.scm (mappend-map): New procedure. (store-profile): Change 'item' to 'items' and adjust code accordingly. (guix-size): Update caller. * tests/size.scm ("store-profile"): Likewise.
* refresh: Make 'list-dependents' a monadic procedure.Ludovic Courtès2016-05-24
| | | | | | * guix/scripts/refresh.scm (list-dependents): Remove use of 'with-store' and 'run-with-store'. (guix-refresh): Wrap body in with-store/run-with-store.
* substitute: Gracefully handle invalid store file names.Ludovic Courtès2016-05-21
| | | | | | | | | | | Before, something like: echo have /gnu/foo | ./test-env guix substitute --query would lead to an ugly backtrace. * guix/scripts/substitute.scm (narinfo-cache-file): Call 'leave' when 'store-hash-part' returns #f.
* graph: Allow store file names for 'derivation' and 'references' graphs.Ludovic Courtès2016-05-21
| | | | | | | | | | | | | | * guix/scripts/graph.scm (%derivation-node-type)[convert]: Add 'derivation-path?' and catch-all clauses. (%reference-node-type)[convert]: Add 'store-path?' and catch-all clauses. (assert-package, nodes-from-package): New procedures. (%package-node-type, %bag-node-type,%bag-with-origins-node-type) (%bag-emerged-node-type): Add 'convert' field (guix-graph): Rename 'packages' to 'items' and allow 'store-path?' arguments. * guix/graph.scm (<node-type>)[convert]: Adjust comment. * doc/guix.texi (Invoking guix graph): Document it.
* graph: Use absolute file name canonicalization.Ludovic Courtès2016-05-21
| | | | * guix/scripts/graph.scm (guix-graph): Wrap in 'with-fluids'.
* lint: Honor 'cpe-name' and 'cpe-version' package properties.Ludovic Courtès2016-05-17
| | | | | | | | | | * guix/scripts/lint.scm (package-name->cpe-name): Remove. (package-vulnerabilities): Honor 'cpe-name' and 'cpe-version' properties. * gnu/packages/grub.scm (grub)[properties]: New field. * gnu/packages/gnuzilla.scm (icecat)[properties]: Add 'cpe-name' and 'cpe-version'. * doc/guix.texi (Invoking guix lint): Mention 'cpe-name'.
* import: Gracefully report import failures.Ludovic Courtès2016-05-17
| | | | | | | | | | | | Previously, something like 'guix import gnu which' would spit out a backtrace if, say, the 'which' tarball could not be authenticated. * guix/upstream.scm (download-tarball): Mention failure modes in docstring. * guix/import/gnu.scm (gnu-package->sexp): Return #f when 'download-tarball' returns #f. * guix/scripts/import.scm (guix-import): Call 'leave' when IMPORTER does not return a (package ...) sexp.
* import: Exit with non-zero when an unknown importer is asked.Ludovic Courtès2016-05-17
| | | | | * guix/scripts/import.scm (guix-import): Use 'leave' instead of 'format' when IMPORTER is unknown.
* guix build: Catch 'getaddrinfo-error' for '--log-file'.Ludovic Courtès2016-05-14
| | | | | * guix/scripts/build.scm (log-url)[valid-url?]: Catch 'getaddrinfo-error'.
* guix build: Do not show what to build when '-d' is used.Ludovic Courtès2016-05-14
| | | | | * guix/scripts/build.scm (guix-build): Don't call 'show-what-to-build' when OPTS contains 'derivations-only?'.
* utils: Move combinators to (guix combinators).Ludovic Courtès2016-05-04
| | | | | | | | | | | | | | | | | | | * guix/utils.scm (compile-time-value, memoize, fold2) (fold-tree, fold-tree-leaves): Move to... * guix/combinators: ... here. New file. * tests/utils.scm ("fold2, 1 list", "fold2, 2 lists") (fold-tree tests): Move to... * tests/combinators.scm: ... here. New file. * Makefile.am (MODULES, SCM_TESTS): Add them. * gnu/packages.scm, gnu/packages/bootstrap.scm, gnu/services/herd.scm, guix/build-system/gnu.scm, guix/build-system/python.scm, guix/derivations.scm, guix/gnu-maintenance.scm, guix/import/elpa.scm, guix/scripts/archive.scm, guix/scripts/build.scm, guix/scripts/graph.scm, guix/scripts/lint.scm, guix/scripts/size.scm, guix/scripts/substitute.scm, guix/serialization.scm, guix/store.scm, guix/ui.scm: Adjust imports accordingly.
* environment: Use 'break' instead of 'split'.Ludovic Courtès2016-05-04
| | | | | * guix/scripts/environment.scm (parse-args): Use 'break' instead of 'split'.
* services: herd: Move UI handling to 'guix system'.Ludovic Courtès2016-05-04
| | | | | | | | | | | | | | | | | | 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.
* guix system: Reduce size of image produced for 'vm' action.Ludovic Courtès2016-04-29
| | | | | | | | | | | 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.
* lint: 'check-vulnerabilities' follows package replacements.Ludovic Courtès2016-04-28
| | | | | | * guix/scripts/lint.scm (check-vulnerabilities): Check the replacement of PACKAGE. * tests/lint.scm ("cve: patched vulnerability in replacement"): New test.
* challenge: Use exit code 2 when discrepancies are found.Ludovic Courtès2016-04-27
| | | | | | | | 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.
* lint: Report synopses/descriptions that are not strings.Ludovic Courtès2016-04-27
| | | | | | | | | | | 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.
* guix gc: Add '--free-space'.Ludovic Courtès2016-04-25
| | | | | | * guix/scripts/gc.scm (show-help, %options): Add '--free-space'. (guix-gc)[ensure-free-space]: New procedure. Handle '--free-space'.
* substitute: Sanitize the client-provided column number.Ludovic Courtès2016-04-20
| | | | | * guix/scripts/substitute.scm (client-terminal-columns): Sanitize the client's column number.
* substitute: Install the client's locale.Ludovic Courtès2016-04-20
| | | | | | | * guix/store.scm (set-build-options): Add #:locale parameter and honor it. * guix/scripts/substitute.scm (guix-substitute): Install the client's locale.
* substitute: Internationalize signature and download messages.Ludovic Courtès2016-04-20
| | | | | * guix/scripts/substitute.scm (assert-valid-narinfo): Use gettext for messages.
* substitute: Better abbreviate substitute URL in progress report.Ludovic Courtès2016-04-20
| | | | | | | | 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'.
* substitute: Honor the number of columns of the client terminal.Ludovic Courtès2016-04-15
| | | | | | | * 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'.
* guix download: Honor the number of columns of the terminal.Ludovic Courtès2016-04-15
| | | | | * guix/scripts/download.scm (guix-download): Parameterize 'current-terminal-columns'.
* lint: Emit an ANSI erase-in-line sequence.Danny Milosavljevic2016-04-14
| | | | | | | * 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>
* environment: container: Work around read-only /etc/resolv.conf issue.David Thompson2016-04-07
| | | | | * guix/scripts/environment.scm (launch-environment/container): Mount /etc/resolv.conf as a writable file.
* challenge: Really exit with non-zero upon hash mismatch.Ludovic Courtès2016-04-06
| | | | | | | | | | 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.
* emacs: Use 'build-and-use-profile' from (guix scripts package).Alex Kost2016-04-04
| | | | | * guix/scripts/package.scm: Export 'build-and-use-profile'. * emacs/guix-main.scm (process-package-actions): Use it.
* import: Add Hackage updater.Eric Bavier2016-03-30
| | | | | | | | * 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.
* environment: Set a default value for PS1.David Thompson2016-03-30
| | | | | * guix/scripts/environment.scm (launch-environment/container): Set PS1 during container initialization.
* guix system: Warn against missing 'guix pull'.Ludovic Courtès2016-03-28
| | | | | | | | 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.
* environment: Properly handle SIGINT.David Thompson2016-03-27
| | | | | | | | | | | | | 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.
* environment: container: Create dummy home directory and /etc/passwd.David Thompson2016-03-26
| | | | | | | | | * 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.
* guix build: '--with-source' correctly matches versioned file names.Ludovic Courtès2016-03-23
| | | | | | | | * 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.
* substitute: Gracefully handle TLS errors.Ludovic Courtès2016-03-23
| | | | | * guix/scripts/substitute.scm (with-networking): Use 'match-lambda*' and add case for 'gnutls-error'.
* substitute: Do not leak file descriptors for TLS connections.Ludovic Courtès2016-03-17
| | | | | | | | 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'.
* substitute: Cache transient HTTP errors for 10mn.Ludovic Courtès2016-03-17
| | | | | | * guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]: Cache transient errors for 10mn. (%narinfo-transient-error-ttl): New variable.