summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* publish: Remove "Guix-Nar-Compression" header from responses.Ludovic Courtès2018-01-09
| | | | | | | | | | This was harmless but non-compliant and unnecessary. * guix/scripts/publish.scm <top level>: Rename "Guix-Nar-Compression" to "X-Nar-Compression" as should have always been. (render-nar, nar-response-port): Adjust accordingly. (strip-headers): New procedure. (sans-content-length, with-content-length): Use it.
* publish: Publish build logs.Ludovic Courtès2018-01-07
| | | | | | | | * guix/scripts/publish.scm (render-log-file): New procedure. (make-request-handler): Add "log" case. * tests/publish.scm ("/log/NAME") ("/log/NAME not found"): New tests. * doc/guix.texi (Invoking guix publish): Document /log URLs.
* publish: Use 'x-raw-file' internal response header.Ludovic Courtès2018-01-07
| | | | | | | | | | | | | This adjusts the workaround for <http://bugs.gnu.org/21093> so that it's not limited to a single content-type. * guix/scripts/publish.scm (render-nar/cached): Add the 'x-raw-file' header on the response. (render-content-addressed-file): Likewise. (with-content-length): Remove the 'x-raw-file' header. (http-write): Instead of dispatching on 'application/octet-stream', check whether 'x-raw-file' is set to determine whether to spawn a thread.
* publish: Save bandwidth on narinfo 404s.Ludovic Courtès2018-01-06
| | | | | | | | This saves 18 bytes on each 404 narinfo response. * guix/scripts/publish.scm (render-narinfo): Pass #:phrase to 'not-found'. (render-narinfo/cached): Likewise.
* guix build: Support '--with-source=PACKAGE@VERSION=URI'.Ludovic Courtès2017-12-23
| | | | | | | | | | | | | * guix/scripts/build.scm (numeric-extension?, tarball-base-name): New procedures, formerly in 'package-with-source'. (transform-package-source)[new-sources]: Look for '=' in URI. Each element of the list of now a (PKG VERSION SOURCE) tuple. Pass VERSION to 'package-with-source'. (package-with-source): Add 'version' parameter and honor it. * tests/scripts-build.scm ("options->transformation, with-source, PKG=URI") ("options->transformation, with-source, PKG@VER=URI"): New tests. * doc/guix.texi (Package Transformation Options): Document the new forms.
* guix system: Check mapped devices upon 'init' and 'reconfigure'.Ludovic Courtès2017-12-22
| | | | | * guix/scripts/system.scm (check-mapped-devices): New procedure. (perform-action): Add call to 'check-mapped-devices'.
* guix gc: '--verify=foo' is reported as an error.Ludovic Courtès2017-12-18
| | | | | | | | | Fixes <https://bugs.gnu.org/29761>. Reported by Martin Castillo <castilma@uni-bremen.de>. * guix/scripts/gc.scm (argument->verify-options): New procedure. (%options) ["verify"]: Adjust to use it. * tests/guix-gc.sh: Add test.
* guix: offload: Add "status" sub-command.Ricardo Wurmus2017-12-16
| | | | | | * guix/scripts/offload.scm (check-machine-status): New procedure. (guix-offload): Call it when the argument is "status". * doc/guix.texi (Daemon Offload Setup): Document it.
* scripts: system: Add --expression option.Mathieu Othacehe2017-12-15
| | | | | | | | | * guix/scripts/system.scm (show-help): Add expression option. (%options): Ditto. (guix-system): Allow commands taking a file as an argument to use an expression instead. (process-action): Read operating-system from expression or file. * doc/guix.texi (Invoking guix system): Introduce the expression option.
* bootloader: Factorize write-file-on-device.Mathieu Othacehe2017-12-15
| | | | | | | | | | | * gnu/bootloader/extlinux.scm (install-extlinux): Factorize bootloader writing in a new procedure write-file-on-device defined in (gnu build bootloader). * gnu/build/bootloader.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add new file. * gnu/system/vm.scm (qemu-img): Adapt to import and use (gnu build bootloader) module during derivation building. * gnu/scripts/system.scm (bootloader-installer-derivation): Ditto.
* lint: 'check-vulnerabilities' also checks package properties.Efraim Flashner2017-12-10
| | | | | | * guix/scripts/lint.scm (check-vulnerabilities): Also check for CVEs listed as mitigated in the package properties. * tests/lint.scm ("cve: known safe from vulnerability"): New test.
* scripts: All commands enable build hooks by default.Ludovic Courtès2017-12-07
| | | | | | | | | * guix/scripts/archive.scm (%default-options): Add 'build-hook?'. * 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.
* bootloader: extlinux: Stop using dd binary.Mathieu Othacehe2017-12-04
| | | | | | | | * gnu/bootloader/extlinux.scm (dd): Remove it, (install-extlinux): replace dd call by Guile I/O procedures. * gnu/system/vm.scm (qemu-image): Add (ice-9 binary-ports) to used-modules list to provide "get-bytevector-n" and "put-bytevector". * guix/scripts/system.scm (bootloader-installer-derivation): Ditto.
* scripts: Default to Guile 2.2 as the guile-for-build.Ludovic Courtès2017-12-03
| | | | | | | * 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.
* Do not set '%fresh-auto-compile'.Ludovic Courtès2017-12-01
| | | | | | | | * 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.
* guix system: 'init' displays a progress bar while copying.Ludovic Courtès2017-12-01
| | | | | | | | | 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'.
* guix system: Simplify closure copy.Ludovic Courtès2017-12-01
| | | | | | | | * 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'.
* weather: Use (guix progress) for progress report.Ludovic Courtès2017-12-01
| | | | | | | | | * 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'.
* lint: Adjust file-name length test for out-of-tree file names.Ludovic Courtès2017-11-28
| | | | | * guix/scripts/lint.scm (check-patch-file-names): Adjust file-name-length calculation.
* lint: 'patch-file-names' checks for file name length.Ludovic Courtès2017-11-28
| | | | | | | | | 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.
* Revert "Add (guix self) and use it when pulling."Ludovic Courtès2017-11-21
| | | | | | | This reverts commit 5f93d97005897c2d859f0be1bdff34c88467ec61. 'guix pull' would fail because (guix self) needs 'scheme-files' from (guix discovery), which was not exported until now.
* Add (guix self) and use it when pulling.Ludovic Courtès2017-11-21
| | | | | | | | | | | | | | | | | | | | 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'.
* pull: Trim import list.Ludovic Courtès2017-11-21
| | | | * guix/scripts/pull.scm: Remove useless imports.
* refresh: Account for hidden packages.Ludovic Courtès2017-11-07
| | | | | | | | Suggested by Marius Bakke <mbakke@fastmail.com> in <https://bugs.gnu.org/29177>. * guix/scripts/refresh.scm (all-packages): Pass #:select? to 'fold-packages'.
* graph: Remove mention of Graphviz from the summary line.Ludovic Courtès2017-10-28
| | | | | * guix/scripts/graph.scm (show-help): Remove mention of Graphviz from the summary line.
* lint: 'refresh' gracefully handles lack of networking access.Ludovic Courtès2017-10-28
| | | | | * guix/scripts/lint.scm (check-for-updates): Wrap 'package-latest-release*' call in 'with-networking-fail-safe'.
* lint: Extract network-related exception handling.Ludovic Courtès2017-10-28
| | | | | | * 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'.
* scripts: Factorize option parsing sans 'GUIX_BUILD_OPTIONS'.Ludovic Courtès2017-10-28
| | | | | | | | | | | | | | * 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.
* scripts: Use 'args-fold*' for command that do not honor build flags.Ludovic Courtès2017-10-27
| | | | | | | | | | 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.
* challenge: Display an overall summary.Ludovic Courtès2017-10-25
| | | | | | | * guix/scripts/challenge.scm (summarize-report-list): New procedure. (guix-challenge): Use it. * doc/guix.texi (Invoking guix challenge): Adjust command output in example.
* substitute: Don't send more than 1000 requests in a row.Ludovic Courtès2017-10-25
| | | | | | | | 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.
* guix package: '--list-available' does not show superseded packages.Ludovic Courtès2017-10-25
| | | | | * guix/scripts/package.scm (process-query) <'list-available>: Filter out P if it matches 'package-superseded'.
* Add (guix progress).Ludovic Courtès2017-10-19
| | | | | | | | | | | | | | | | | | 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.
* guix: substitute: Report the last progress in the child process.宋文武2017-10-17
| | | | | | | | | 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.
* lint: 'home-page' checker reports permanent redirects.Ludovic Courtès2017-10-12
| | | | | | | | * 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.
* offload: Reduce the number of calls to 'machine-load'.Ludovic Courtès2017-10-12
| | | | | | | | | | | | | | | 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.
* substitute: Close the progress port after substitute finished.宋文武2017-10-12
| | | | | | | Fixes <https://bugs.gnu.org/28756>. * guix/scripts/substitute.scm (progress-substitution): Call '(close-port progress)'.
* lint: Remove extra newline.Ludovic Courtès2017-10-09
| | | | * guix/scripts/lint.scm (check-for-updates): Remove trailing "~%".
* guix: lint: Add checker for new upstream versions.Efraim Flashner2017-10-09
| | | | | | | | * 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.
* pull: Add GUIX_PULL_URL environment variable.Oleg Pykhalov2017-10-07
| | | | | | | | * 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>
* guix package: '--upgrade' no longer reverses package order.Ludovic Courtès2017-10-07
| | | | | | | | 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'.
* publish: Cache uncompressed nars as well.Ludovic Courtès2017-10-05
| | | | | | | | | | | | 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.
* guix system: Error out when passed a wrong file system UUID/label.Ludovic Courtès2017-10-05
| | | | | | * guix/scripts/system.scm (check-file-system-availability): New procedure. (perform-action): Use it.
* guix: Revert accidentally committed changes.Ricardo Wurmus2017-09-28
| | | | | | | | 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.
* import: Add JSON importer.Ricardo Wurmus2017-09-28
| | | | | | | * 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.
* download: Don't report the progress too fast.宋文武2017-09-20
| | | | | | | | | | | | * 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.
* substitute: Close the download port after substitution finished.宋文武2017-09-18
| | | | | * guix/scripts/substitute.scm (progress-substitution): Call 'close-port' after 'restore-file'.
* guix system: Add 'search' command.Ludovic Courtès2017-09-16
| | | | | | | | | | | | | | * 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.
* ui: Generalize relevance computation.Ludovic Courtès2017-09-16
| | | | | | | * 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.
* guix download: Honor mirrors when using '-o'.Ludovic Courtès2017-09-14
| | | | | | | Previously "guix download -o x mirror://gnu/…" would fail. * guix/scripts/download.scm (download-to-file): Pass #:mirrors to 'url-fetch'.