summaryrefslogtreecommitdiff
path: root/guix/scripts
AgeCommit message (Collapse)Author
2017-12-03scripts: Default to Guile 2.2 as the guile-for-build.Ludovic Courtès
* guix/scripts/environment.scm (guix-environment): '%guile-for-build' now defaults to GUILE-2.2 instead of GUILE-2.0. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/pull.scm (guix-pull): Likewise.
2017-12-01Do not set '%fresh-auto-compile'.Ludovic Courtès
* guix/scripts/offload.scm (build-machines): Comment out '(set! %fresh-auto-compile #t)' since with Guile 2.2.3 it could lead to an actual rebuild of everything that gets loaded from there on. See <https://bugs.gnu.org/29226>. * guix/ui.scm (load*): Likewise.
2017-12-01guix system: 'init' displays a progress bar while copying.Ludovic Courtès
Until now it would print the name of each store item being copied, which was verbose and unhelpful. * guix/scripts/system.scm (copy-closure): Use 'progress-reporter/bar' and 'call-with-progress-reporter'. (guix-system): Parameterize 'current-terminal-columns'.
2017-12-01guix system: Simplify closure copy.Ludovic Courtès
* guix/scripts/system.scm (copy-item): Add 'references' argument and remove 'references*' call. Turn into a non-monadic procedure. (copy-closure): Remove initial call to 'references*'. Only pass ITEM to 'topologically-sorted*' since that's equivalent. Compute the list of references corresponding to TO-COPY and pass it to 'copy-item'.
2017-12-01weather: Use (guix progress) for progress report.Ludovic Courtès
* guix/progress.scm (start-progress-reporter!, stop-progress-reporter!) (progress-reporter-report!): New procedures. * guix/scripts/weather.scm (call-with-progress-reporter): New procedure. (package-outputs)[update-progress!]: Remove. Use 'call-with-progress-reporter' instead. (guix-weather): Parameterize 'current-terminal-columns'.
2017-11-28lint: Adjust file-name length test for out-of-tree file names.Ludovic Courtès
* guix/scripts/lint.scm (check-patch-file-names): Adjust file-name-length calculation.
2017-11-28lint: 'patch-file-names' checks for file name length.Ludovic Courtès
Reported at <https://bugs.gnu.org/27943> by Danny Milosavljevic <dannym@scratchpost.org>. * guix/scripts/lint.scm (%distro-directory): New variable. (check-patch-file-names): Add check for the file name length. * tests/lint.scm ("patches: file name too long"): New test.
2017-11-21Revert "Add (guix self) and use it when pulling."Ludovic Courtès
This reverts commit 5f93d97005897c2d859f0be1bdff34c88467ec61. 'guix pull' would fail because (guix self) needs 'scheme-files' from (guix discovery), which was not exported until now.
2017-11-21Add (guix self) and use it when pulling.Ludovic Courtès
This mitigates <https://bugs.gnu.org/27284>. * guix/self.scm: New file. * Makefile.am (MODULES): Add it. * build-aux/build-self.scm (libgcrypt, zlib, gzip, bzip2, xz) (false-if-wrong-guile, package-for-current-guile, guile-json) (guile-ssh, guile-git, guile-bytestructures): Remove. (build): Rewrite to simply delegate to 'compiled-guix'. * gnu/packages.scm (%distro-root-directory): Rewrite to try different directories. * guix/discovery.scm (guix): Export 'scheme-files'. * guix/scripts/pull.scm (build-and-install): Split into... (install-latest): ... this. New procedure. And... (build-and-install): ... this, which now takes a monadic value argument. (indirect-root-added): Remove. (guix-pull): Call 'add-indirect-root'. Call 'build-from-source' and pass the result to 'build-and-install'.
2017-11-21pull: Trim import list.Ludovic Courtès
* guix/scripts/pull.scm: Remove useless imports.
2017-11-07refresh: Account for hidden packages.Ludovic Courtès
Suggested by Marius Bakke <mbakke@fastmail.com> in <https://bugs.gnu.org/29177>. * guix/scripts/refresh.scm (all-packages): Pass #:select? to 'fold-packages'.
2017-10-28graph: Remove mention of Graphviz from the summary line.Ludovic Courtès
* guix/scripts/graph.scm (show-help): Remove mention of Graphviz from the summary line.
2017-10-28lint: 'refresh' gracefully handles lack of networking access.Ludovic Courtès
* guix/scripts/lint.scm (check-for-updates): Wrap 'package-latest-release*' call in 'with-networking-fail-safe'.
2017-10-28lint: Extract network-related exception handling.Ludovic Courtès
* guix/scripts/lint.scm (call-with-networking-fail-safe): New procedure. (with-networking-fail-safe): New macro. (current-vulnerabilities*): Rewrite in terms of 'with-networking-fail-safe'.
2017-10-28scripts: Factorize option parsing sans 'GUIX_BUILD_OPTIONS'.Ludovic Courtès
* guix/scripts.scm (parse-command-line): Add #:build-options? parameter and honor it. * guix/scripts/challenge.scm (guix-challenge): Use 'parse-command-line' with #:build-options? #f instead of 'args-fold*'. * guix/scripts/gc.scm (guix-gc): Likewise. * guix/scripts/graph.scm (guix-graph): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/lint.scm (guix-lint): Likewise. * guix/scripts/refresh.scm (guix-refresh): Likewise. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise.
2017-10-27scripts: Use 'args-fold*' for command that do not honor build flags.Ludovic Courtès
Fixes <https://bugs.gnu.org/28984>. Reported by Eric Bavier. * guix/scripts/challenge.scm (guix-challenge): Use 'args-fold*' instead of 'parse-command-line'. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise.
2017-10-25challenge: Display an overall summary.Ludovic Courtès
* guix/scripts/challenge.scm (summarize-report-list): New procedure. (guix-challenge): Use it. * doc/guix.texi (Invoking guix challenge): Adjust command output in example.
2017-10-25substitute: Don't send more than 1000 requests in a row.Ludovic Courtès
Fixes <https://bugs.gnu.org/28731>. Reported by Jan Nieuwenhuizen <janneke@gnu.org>. * guix/scripts/substitute.scm (at-most): New procedure. (http-multiple-get): Use it to send at most 1000 requests at once.
2017-10-25guix package: '--list-available' does not show superseded packages.Ludovic Courtès
* guix/scripts/package.scm (process-query) <'list-available>: Filter out P if it matches 'package-superseded'.
2017-10-19Add (guix progress).Ludovic Courtès
Among other things, this removes (guix utils), (guix ui), (guix config), etc. from the closure of (guix build download), as was the case since 798648515b77507c242752457b4dc17c155bad6e. * guix/utils.scm (<progress-reporter>, call-with-progress-reporter): Move to... * guix/progress.scm: ... here. New file. * Makefile.am (MODULES): Add it. * guix/build/download.scm (current-terminal-columns) (nearest-exact-integer, duration->seconds, seconds->string) (byte-count->string, progress-bar, string-pad-middle) (rate-limited, progress-reporter/file, dump-port*) (time-monotonic): Move to progress.scm. * guix/scripts/download.scm: Adjust accordingly. * guix/scripts/substitute.scm: Likewise.
2017-10-17guix: substitute: Report the last progress in the child process.宋文武
Fixes <https://bugs.gnu.org/28756>. * guix/utils.scm (filtered-port): Close the 'input' port for the current process, and close it upon exit in the child process. * guix/scripts/substitute.scm (progress-substitution): Display "\n\n" after the reporter has finished.
2017-10-12lint: 'home-page' checker reports permanent redirects.Ludovic Courtès
* guix/scripts/lint.scm (probe-uri): Add special case for HTTP 301. (validate-uri): Likewise. * tests/lint.scm ("home-page: 301, invalid") ("home-page: 301 -> 200", "home-page: 301 -> 404") ("source: 301 -> 200", "source: 301 -> 404"): New tests.
2017-10-12offload: Reduce the number of calls to 'machine-load'.Ludovic Courtès
Previously we would call 'machine-load' once per machine, which was very costly when there were many machines. Now we arrange to call it only once on average (when all the machines have the same 'speed' value). * guix/scripts/offload.scm (random-seed, shuffle): New procedures. (choose-build-machine)[machines+slots+loads]: Rename to... [machines+slots]: ... this. Remove load from the tuples therein. [undecorate]: Adjust accordingly. [machine-less-loaded-or-faster?]: Remove. [machine-faster?]: New procedure. Sort MACHINES+SLOTS according to 'machine-faster?'. Call 'machine-load?' as the last thing.
2017-10-12substitute: Close the progress port after substitute finished.宋文武
Fixes <https://bugs.gnu.org/28756>. * guix/scripts/substitute.scm (progress-substitution): Call '(close-port progress)'.
2017-10-09lint: Remove extra newline.Ludovic Courtès
* guix/scripts/lint.scm (check-for-updates): Remove trailing "~%".
2017-10-09guix: lint: Add checker for new upstream versions.Efraim Flashner
* guix/scripts/lint.scm (check-for-updates): New procedure. (%checkers): Add it. * guix/scripts/refresh.scm (importer-modules, %updaters): Move from here ... * guix/upstream.scm: ... to here.
2017-10-07pull: Add GUIX_PULL_URL environment variable.Oleg Pykhalov
* guix/scripts/pull.scm (%repository-url): Add GUIX_PULL_URL environment variable. * doc/guix.texi (Invoking guix pull): Mention GUIX_PULL_URL. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-10-07guix package: '--upgrade' no longer reverses package order.Ludovic Courtès
Reported by Oleg Pykhalov <go.wigust@gmail.com> at <https://lists.gnu.org/archive/html/help-guix/2017-10/msg00000.html>. * guix/scripts/package.scm (options->installable)[upgraded]: Use 'fold-right' instead of 'fold'.
2017-10-05publish: Cache uncompressed nars as well.Ludovic Courtès
Fixes <https://bugs.gnu.org/28664>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/scripts/publish.scm (bake-narinfo+nar): When COMPRESSION is 'none, write NAR instead of doing nothing. (make-request-handler): Use 'render-nar/cached' for /nar URLs with no compression. * tests/publish.scm ("with cache", "with cache, uncompressed"): Adjust expected result accordingly.
2017-10-05guix system: Error out when passed a wrong file system UUID/label.Ludovic Courtès
* guix/scripts/system.scm (check-file-system-availability): New procedure. (perform-action): Use it.
2017-09-28guix: Revert accidentally committed changes.Ricardo Wurmus
This is a follow-up to commit fb1db385476bc4548d3eadea93b5dd6a346839f2. * guix/scripts/build.scm (lazy-util): Remove procedure. (options->things-to-build): Remove special case for files with ".json" extension.
2017-09-28import: Add JSON importer.Ricardo Wurmus
* doc/guix.texi (Invoking guix import): Document it. * guix/scripts/import/json.scm: New file. * Makefile.am (MODULES): Add it. * guix/scripts/import.scm (importers): Add json importer.
2017-09-20download: Don't report the progress too fast.宋文武
* guix/utils.scm (<progress-reporter>): New record type. (call-with-progress-reporter): New procedure. * guix/build/download.scm (dump-port*, rate-limited, progress-reporter/file): New procedures. (ftp-fetch, http-fetch): Use 'dump-port*'. (progress-proc): Remove procedure. * guix/scripts/substitute.scm (progress-report-port): Rewrite in terms of <progress-reporter>. (process-substitution): Adjust accordingly.
2017-09-18substitute: Close the download port after substitution finished.宋文武
* guix/scripts/substitute.scm (progress-substitution): Call 'close-port' after 'restore-file'.
2017-09-16guix system: Add 'search' command.Ludovic Courtès
* guix/scripts/system.scm (resolve-subcommand): New procedure. (process-command): Handle 'search'. (guix-system): Likewise. (show-help): Augment. * guix/scripts/system/search.scm: New file. * po/guix/POTFILES.in: Add it. * Makefile.am (MODULES): Add it. * guix/ui.scm (%text-width): Export. * doc/guix.texi (Invoking guix system): Document it. (Service Types and Services): Mention 'guix system search'. * tests/guix-system.sh: Test it.
2017-09-16ui: Generalize relevance computation.Ludovic Courtès
* guix/ui.scm (relevance, package-relevance): New procedures. (%package-metrics): New variable. * guix/scripts/package.scm (find-packages-by-description)[score] [package-score]: Remove. Use 'package-relevance' instead.
2017-09-14guix download: Honor mirrors when using '-o'.Ludovic Courtès
Previously "guix download -o x mirror://gnu/…" would fail. * guix/scripts/download.scm (download-to-file): Pass #:mirrors to 'url-fetch'.
2017-09-12guix system: Pretty-print device UUIDs.Ludovic Courtès
* guix/scripts/system.scm (display-system-generation): Check if ROOT-DEVICE is a UUID and pretty-print it if it is.
2017-09-11substitute: Download from unauthorized sources that provide the right content.Ludovic Courtès
This allows substitutes to be downloaded from unauthorized servers, as long as they advertise the same hash and references as one of the authorized servers. * guix/scripts/substitute.scm (assert-valid-narinfo): Remove. (valid-narinfo?): Add #:verbose?. Handle each case of 'signature-case'. (equivalent-narinfo?): New procedure. (lookup-narinfos/diverse): Add 'authorized?' parameter and honor it. [select-hit]: New procedure. (lookup-narinfo): Add 'authorized?' parameter and pass it. (process-query): Adjust callers accordingly. (process-substitution): Remove call to 'assert-valid-narinfo'. Check whether 'lookup-narinfo' returns true and call 'leave' if not. * tests/substitute.scm (%main-substitute-directory) (%alternate-substitute-directory): New variables. (call-with-narinfo): Make 'narinfo-directory' a parameter. Call 'mkdir-p' to create it. Change unwind handler to check whether CACHE-DIRECTORY exists before deleting it. (with-narinfo*): New macro. ("substitute, no signature") ("substitute, invalid hash") ("substitute, unauthorized key"): Change expected error message to "no valid substitute". ("substitute, unauthorized narinfo comes first") ("substitute, unsigned narinfo comes first") ("substitute, first narinfo is unsigned and has wrong hash") ("substitute, first narinfo is unsigned and has wrong refs") ("substitute, unsigned narinfo comes first") ("substitute, two invalid narinfos"): New tests. * doc/guix.texi (Substitutes): Explain the new behavior.
2017-09-11substitute: Make substitute URLs a SRFI-39 parameter.Ludovic Courtès
* guix/scripts/substitute.scm (%cache-urls): Rename to... (%default-substitute-urls): ... this. (substitute-urls): New variable. (guix-substitute): Use it instead of %CACHE-URLS. * tests/substitute.scm: Likewise.
2017-09-07size: Default to '--sort=self'.Ludovic Courtès
* guix/scripts/size.scm (%default-options): Change default value for 'profile<?. * doc/guix.texi (Invoking guix size): Adjust accordingly.
2017-09-05Handle the same HTTP redirects everywhere.Tobias Geerinckx-Rice
* guix/build/download.scm (http-fetch): Complete the hard-coded list of HTTP redirection status codes. * guix/http-client.scm (http-fetch): Likewise. * guix/scripts/lint.scm (probe-uri): Likewise.
2017-09-01scripts: Remove 'max-silent-time' from the default options.Maxim Cournoyer
Fixes <http://bugs.gnu.org/27157>. Having a finite default `max-silent-time' value for scripts such as 'guix environment' could lead to timeouts when building subtitutes; this was undesirable. This change also fixes client behavior to match the documentation, which is that by default the daemon's settings are honored. * guix/scripts/archive.scm (%default-options): Remove max-silent-time entry. * guix/scripts/copy.scm (%default-options): Likewise. * guix/scripts/environment.scm (%default-options): Likewise. * guix/scripts/pack.scm (%default-options): Likewise. * guix/scripts/package.scm (%default-options): Likewise. * guix/scripts/pull.scm (%default-options): Likewise. * guix/scripts/system.scm (%default-options): Likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2017-08-23gnu: bootloader: Deprecate "device" field in favor of "target".Andy Wingo
* gnu/bootloader.scm (<bootloader-configuration>): Deprecate "device" field in favor of "target" field. This is mostly a renaming but also a generalization to support UEFI targets being paths to a mounted partition instead of a device name. * gnu/system/examples/bare-bones.tmpl: * gnu/system/examples/desktop.tmpl: * gnu/system/examples/lightweight-desktop.tmpl: * gnu/system/examples/vm-image.tmpl: * gnu/system/install.scm: * gnu/tests.scm: * gnu/tests/install.scm: * gnu/tests/nfs.scm: * tests/system.scm: Adapt all invocations of bootloader-configuration. * guix/scripts/system.scm (perform-action): Rename device argument to bootloader-target. (process-action): Adapt caller. * doc/guix.texi (Proceeding with the Installation): * doc/guix.texi (Bootloader Configuration): Update documentation.
2017-08-23gnu: scripts: Cleanup regarding "gnu system" bootloader devices.Andy Wingo
* guix/scripts/system.scm (install-bootloader, install): Remove unused "device" argument. (reinstall-bootloader, perform-action): Adapt callers.
2017-08-20guix download: Support retrieving local file without the URI scheme.宋文武
* guix/scripts/download.scm (guix-download): Treat the URL argument as a local file path when it fails on 'string->uri'. Call 'fetch' with the processed 'uri' instead of the original URL argument. * tests/guix-download.sh: Adjust accordingly.
2017-08-19pack: Add "none" compressor.Ricardo Wurmus
* guix/scripts/pack.scm (%compressors): Add compressor "none"; prepend extension with ".". (self-contained-tarball, docker-image): Assume compressor extensions start with period. * doc/guix.texi (Invoking guix pack): Document it.
2017-08-02pull: Honor '--no-grafts'.Ludovic Courtès
* guix/scripts/pull.scm (guix-pull): Parameterize %GRAFT? as a function of OPTS.
2017-08-02pull: Use the commit ID as the version string.Ludovic Courtès
* guix/scripts/pull.scm (build-from-source): Add #:commit parameter. Pass it to BUILD. (build-and-install): Add #:commit and pass it to 'build-from-source'. (guix-pull): Pass #:commit to 'build-and-install'.
2017-08-02pull: Fetch source code from Git.Ludovic Courtès
* guix/scripts/pull.scm (%snapshot-url, with-environment-variable) (with-PATH): Remove. (ensure-guile-git!): New procedure. (%repository-url): New variable. (%default-options): Add 'repository-url' and 'ref'. (show-help, %options): Add '--commit' and '--url'. (temporary-directory, first-directory, interned-then-deleted) (unpack): Remove. (build-from-source): Rename 'tarball' to 'source'. Remove call to 'unpack'. (build-and-install): Rename 'tarball' to 'source'. (honor-lets-encrypt-certificates!, report-git-error): New procedures. (with-git-error-handling): New macro. (guix-pull)[fetch-tarball]: Remove. Wrap body in 'with-git-error-handling'. Rewrite to use 'latest-repository-commit'. * build-aux/build-self.scm (build): Print an error message and exit when GUILE-GIT is #f. * doc/guix.texi (Invoking guix pull): Mention Git. Document '--commit' and '--branch'.