summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* utils: Add `guile-version>?', and use it.Ludovic Courtès2013-08-23
| | | | | | | | | | | | | | This fixes Guile version comparisons when (version) has a vendor-specific suffix. Reported by Andreas Enge <andreas@enge.fr>. * guix/utils.scm (guile-version>?): New procedure. * tests/utils.scm ("guile-version>? 1.8", "guile-version>? 10.5"): New tests. * guix/scripts/substitute-binary.scm (fetch, progress-report-port): Use `guile-version>?' instead of `version>?'. * guix/http-client.scm (when-guile<=2.0.5, http-fetch): Likewise.
* substitute-binary: Try hard to avoid port buffering.Ludovic Courtès2013-08-22
| | | | | | | | | * guix/scripts/substitute-binary.scm (fetch): In the `file' case, open with the `b' flag, so that the coding cookie reading thing doesn't lead to buffering some of the data (on 2.0.5). * tests/utils.scm ("filtered-port, file"): Open with `r0b'. Fixes a test failure with Guile 2.0.5 whereby the first byte of FILE would be missing from DECOMPRESSED.
* substitute-binary: Don't pretend to report download progress on Guile 2.0.5.Ludovic Courtès2013-08-21
| | | | | * guix/scripts/substitute-binary.scm (progress-report-port): On Guile 2.0.5, return PORT directly and emit a warning.
* guix package: Allow separate install of several outputs of the same package.Ludovic Courtès2013-07-15
| | | | | | * guix/scripts/package.scm (guix-package)[process-actions](same-package?): New procedure. Use it instead of `alist-delete' when filtering out duplicate packages from the profile.
* Rename (guix web) to (guix http-client).Ludovic Courtès2013-07-14
| | | | | | | * guix/web.scm: Rename to... * guix/http-client.scm: ... this. * guix/gnu-maintenance.scm, guix/scripts/substitute-binary.scm, Makefile.am, po/POTFILES.in: Update accordingly.
* guix package: Fix handling of `-e'.Ludovic Courtès2013-07-12
| | | | | | | | | | | | | This fixes a bug whereby a command like guix package -e '(@@ (gnu packages base) gnu-make-boot0)' would only succeed when the outputs of that package are available, and otherwise fail with "/nix/store/... is not valid". * guix/scripts/package.scm (guix-package)[process-action](package->tuple): Leave P as is in the result. Move `package->tuple' call from INSTALL* to INSTALL.
* guix package: Reuse FTP connections for subsequent `latest-release' calls.Ludovic Courtès2013-07-12
| | | | | | | | * guix/gnu-maintenance.scm (latest-release): Add `ftp-close' and `ftp-open' keyword parameters. * guix/scripts/package.scm (ftp-open*): New variable. (check-package-freshness): Call `latest-release' with `ftp-open*' and a no-op procedure.
* substitute-binary: Directly replace the global `regexp-exec'.Ludovic Courtès2013-07-11
| | | | | | | * guix/scripts/substitute-binary.scm (%regexp-exec-mutex, string->uri): Remove. (regexp-exec): Replace this global binding by a thread-safety wrapper. (fields->alist): Remove `with-mutex', and directly alias `recutils->alist'.
* substitute-binary: Increase the default timeout.Ludovic Courtès2013-07-11
| | | | * guix/scripts/substitute-binary.scm (%fetch-timeout): Set to 5 seconds.
* guix refresh: Keep only the newest versions of packages as upgrade candidates.Ludovic Courtès2013-07-11
| | | | | * guix/scripts/refresh.scm (guix-refresh)[keep-newest]: New procedure. Use it to keep only once copy of each package.
* records: Add `recutils->alist' for public consumption.Ludovic Courtès2013-07-10
| | | | | | | * guix/records.scm (%recutils-field-rx): New variable. (recutils->alist): New procedure, formerly known as `fields->alist'. * guix/scripts/substitute-binary.scm (fields->alist): Use it. * tests/records.scm ("recutils->alist"): New test.
* Use `port-sha256' and `open-sha256-port'.Ludovic Courtès2013-07-03
| | | | | | | | * guix/derivations.scm (derivation-hash): Add comment as to why we keep the plain `sha256' call. * guix/scripts/download.scm (guix-download): Use `port-sha256' instead of (compose sha256 get-bytevector-all). * guix/scripts/refresh.scm (update-package): Likewise.
* Move `sha256' to (guix hash).Ludovic Courtès2013-07-01
| | | | | | | | | * guix/utils.scm (sha256): Move to... * guix/hash.scm: ... here. New file. * Makefile.am (MODULES): Add it. * guix/derivations.scm, guix/scripts/download.scm, guix/scripts/hash.scm, guix/scripts/refresh.scm, tests/base32.scm, tests/derivations.scm, tests/store.scm: Use (guix hash).
* substitute-binary: Avoid dangling connections to the server.Ludovic Courtès2013-06-29
| | | | | | | | | * guix/web.scm (open-socket-for-uri): New procedure. (http-fetch): Add `port' keyword parameter; use it. * guix/scripts/substitute-binary.scm (%random-state): New variable. (with-timeout): Wait a little before retrying. (fetch): Use `open-socket-for-uri', and keep a copy of the socket in variable `port'. Close PORT upon timeout.
* package: Fix i18n of the number of packages message.Ludovic Courtès2013-06-20
| | | | | * guix/scripts/package.scm (guix-package)[process-actions]: Use `N_' for i18n of the number of packages message.
* substitute-binary: Report progress while downloading.Ludovic Courtès2013-06-20
| | | | | | | * guix/scripts/substitute-binary.scm (decompressed-port): Improve docstring. (progress-report-port): New procedure. (guix-substitute-binary)["--substitute"]: Use it to report progress. * guix/build/download.scm: Export `progress-proc' and `uri-abbreviation'.
* package: Display the number of installed packages upon completion.Ludovic Courtès2013-06-19
| | | | | * guix/scripts/package.scm (guix-package)[process-actions]: Display the number of packages in the profile upon completion.
* substitute-binary: Provide feedback when the server is unresponsive.Ludovic Courtès2013-06-18
| | | | | | | | * guix/scripts/substitute-binary.scm (%fetch-timeout): New variable. (with-timeout): New macro. (fetch): Add `timeout?' keyword parameter. Enclose `http-fetch' call in `with-timeout'. (guix-substitute-binary): Call `fetch' with #:timeout? #f.
* guix gc: Add `--requisites'.Ludovic Courtès2013-06-13
| | | | | | | * guix/scripts/gc.scm (show-help, %options): Add `--requisites'. (guix-gc): Handle it. * doc/guix.texi (Invoking guix gc): Document `--requisites'. * NEWS: Update.
* guix refresh: Add '--key-download'.Nikita Karetnikov2013-06-10
| | | | | | | | | | | | | | | | | | | | * guix/gnu-maintenance.scm (download-tarball): Add a 'key-download' keyword argument and pass it to 'gnupg-verify*'. Make 'archive-type' a keyword argument. (package-update): Add a 'key-download' keyword argument. Pass 'archive-type' and 'key-download' keyword arguments to 'download-tarball'. * guix/gnupg.scm: Import (ice-9 i18n) and (guix ui). (gnupg-verify*): Add a 'key-download' keyword argument and adjust 'gnupg-verify*' to use it. Make 'server' a keyword argument. * guix/scripts/refresh.scm (show-help, %options): Add and document '--key-download'. (update-package): Add a 'key-download' keyword argument and pass it to 'package-update'. (guix-refresh): Pass 'key-download' to 'update-package'. Limit lines to a maximum of 79 characters.
* substitute-binary: Don't cache .narinfo lookups when lacking networking.Ludovic Courtès2013-06-04
| | | | | * guix/scripts/substitute-binary.scm (lookup-narinfo): Don't cache NARINFO when CACHE is #f.
* substitute-binary: Gracefully exit upon networking errors.Ludovic Courtès2013-05-29
| | | | | | | Suggested by Andreas Enge <andreas@enge.fr>. * guix/scripts/substitute-binary.scm (with-networking): New macro. (guix-substitute-binary): Wrap the body in `with-networking'.
* build, package: Add `--fallback' option.Ludovic Courtès2013-05-29
| | | | | | | | | * guix/scripts/build.scm (%options, show-help): Add `--fallback'. (guix-build): Call `set-build-options' with #:fallback?. * guix/scripts/package.scm (%options, show-help): Add `--fallback'. (guix-package): Call `set-build-options' with #:fallback?. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--fallback'.
* package: Fix default profile ownership check when it's just been created.Ludovic Courtès2013-05-24
| | | | | | * guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check whether S is true before checking its owner. Fixes the case where we built %PROFILE-DIRECTORY just above.
* build: Add `--target' option.Ludovic Courtès2013-05-24
| | | | | | | | | | * guix/scripts/build.scm (derivations-from-package-expressions): Add `package-derivation' parameter. (show-help, %options): Add `--target'. (guix-build): Use `package-cross-derivation' when `--target' is passed. * tests/guix-build.sh: Add dry-run test with `--target'. * doc/guix.texi (Invoking guix build): Document `--target'.
* Add `--max-silent-time' to `guix build' and `guix package'.Ludovic Courtès2013-05-20
| | | | | | | | | | | | | | | | * guix/scripts/build.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-build): Pass `max-silent-time' to `set-build-options'. * guix/scripts/package.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-package): Pass `max-silent-time' to `set-build-options'. * guix/ui.scm (string->number*): New procedure. * tests/derivations.scm ("build-expression->derivation and max-silent-time"): New test. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--max-silent-time'.
* package: Make sure the profile directory is owned by the user.Ludovic Courtès2013-05-16
| | | | | | | * guix/scripts/package.scm (guix-package)[ensure-default-profile]: Check the owner of %PROFILE-DIRECTORY. Report an error when the owner is not the current user. Add `rtfm' procedure. * doc/guix.texi (Invoking guix package): Mention the ownership test.
* substitute-binary: Pass `filtered-port' an unbuffered port.Ludovic Courtès2013-05-15
| | | | | | | | | | | | | | | | | | This fixes a bug whereby `read-response' would read more than just the response, with the extra data going into the port's buffer; the "bzip2 -dc" process spawned by `filtered-port' would not see the those buffered data, which are definitely lost, and would bail out with "bzip2: (stdin) is not a bzip2 file." * guix/utils.scm (filtered-port): Document that INPUT must be unbuffered. * guix/web.scm (http-fetch): Add `buffered?' parameter. Call `open-socket-for-uri' explicitly, and call `setvbuf' when BUFFERED? is false. Pass the port to `http-get'. Close it upon 301/302. * guix/scripts/substitute-binary.scm (fetch): Add `buffered?' parameter. Pass it to `http-fetch'; honor it for `file' URIs. (guix-substitute-binary): Call `fetch' with #:buffered? #f for port RAW. * tests/utils.scm ("filtered-port, file"): Open FILE as unbuffered.
* substitute-binary: Work around thread-unsafe `regexp-exec'.Ludovic Courtès2013-05-14
| | | | | | * guix/scripts/substitute-binary.scm (%regexp-exec-mutex): New variable. (string->uri): New procedure. (fields->alist): Wrap `regexp-exec' call in `with-mutex'.
* package: Always clear the SIGINT handler.Ludovic Courtès2013-05-14
| | | | | * guix/scripts/package.scm (call-with-sigint-handler): Wrap THUNK in `dynamic-wind' so that the SIGINT handler is always cleared.
* ftp-client: Let callers handle `ftp-open' exceptions.Ludovic Courtès2013-05-14
| | | | | | * guix/ftp-client.scm (ftp-open): Let exceptions through. * guix/scripts/package.scm (waiting): Wrap EXP in a `dynamic-wind', so the line is always cleared.
* Move record utilities to (guix records).Ludovic Courtès2013-05-12
| | | | | | | | | | | | | | | | * guix/utils.scm (define-record-type*): Move to... * guix/records.scm: ... here. New file. * guix/build-system.scm, guix/packages.scm: Use it. * guix/gnu-maintenance.scm: Likewise. (official-gnu-packages)[alist->record]: Remove. * guix/scripts/substitute-binary.scm: Likewise. (alist->record, object->fields): Remove. * tests/utils.scm ("define-record-type*", "define-record-type* with letrec* behavior", "define-record-type* & inherit", "define-record-type* & inherit & letrec* behavior", "define-record-type* & thunked", "define-record-type* & thunked & default", "define-record-type* & thunked & inherited"): Move to... * tests/records.scm: ... here. New file.
* tests: Add `guix hash' test.Ludovic Courtès2013-05-11
| | | | | | | * guix/scripts/hash.scm (guix-hash)[eof->null]: New procedure. Use it to convert the EOF object to the empty bytevector. * tests/guix-hash.sh: New file. * Makefile.am (SH_TESTS): Add it.
* refresh: Add `--key-server' and `--gpg'.Ludovic Courtès2013-05-11
| | | | | | | | * guix/scripts/refresh.scm (%options): Add `--key-server' and `--gpg'. (show-help): Update accordingly. (update-package): New procedure, formerly in `guix-refresh'. (guix-refresh): Use it. Parameterize `%openpgp-key-server' and `%gpg-command'.
* package: Store the output path of packages installed with `-e'.Ludovic Courtès2013-05-10
| | | | | | * guix/scripts/package.scm (guix-package)[process-actions](package->tuple): Put the output path in the tuple, not the derivation path. * tests/guix-package.sh: Add test.
* package: Make sure the dependencies get built along with the manifest.Ludovic Courtès2013-05-10
| | | | | | | | | | | | | | | | | | | | Before this, something like "guix package -i glibc" could fail because glibc lists linux-libre-headers as a propagated input (which would be added as a dependency in the manifest) but the linux-libre-headers output could be unavailable, leading to an error like this: path `/nix/store/4v2bk8sx5cm166gks3fi3q7d9zchibnk-linux-libre-headers-3.3.8' is not valid This patch adds such dependencies as inputs of the profile derivation. * guix/scripts/package.scm (profile-derivation): Accept package objects in the `deps' field of an element of PACKAGES. Convert them to their output path for BUILDER, and add them to the inputs of the `build-expression->derivation' call. (input->name+path): When INPUT doesn't contain a package object, return it as is. (guix-package)[process-actions](canonicalize-deps): Expect DEPS to contain package objects, and leave them as is.
* refresh: Gracefully handle failure to download a tarball.Ludovic Courtès2013-05-10
| | | | | | * guix/scripts/refresh.scm (guix-refresh): When updating a source file, gracefully handle the case where TARBALL is #f. Reported by Nikita Karetnikov <nikita@karetnikov.org>.
* package: Use ~/.guix-profile as the default for --search-paths.Ludovic Courtès2013-05-10
| | | | | | * guix/scripts/package.scm (search-path-environment-variables): Prefer %USER-ENVIRONMENT-DIRECTORY when it points to PROFILE. (display-search-paths): Use 3 spaces for indentation.
* package: Display the output of packages to be installed/removed.Ludovic Courtès2013-05-08
| | | | | * guix/scripts/package.scm (guix-package)[show-what-to-remove/install]: Display the output name.
* package: Preserve the installed package output when upgrading.Ludovic Courtès2013-05-08
| | | | | | | * guix/scripts/package.scm (guix-package)[find-package]: Add optional parameter `output'. Use it. [process-actions]: When computing UPGRADE, pass OUTPUT to `find-package'.
* package: Fix spacing in user messages.Ludovic Courtès2013-05-07
| | | | * guix/scripts/package.scm (guix-package)[process-actions]: Fix spacing.
* refresh: Change default to not update source files.Ludovic Courtès2013-05-06
| | | | | | * guix/scripts/refresh.scm (%options): Change `--dry-run' to `--update'. (show-help): Adjust accordingly. (guix-refresh): Likewise.
* Merge branch 'core-updates'Ludovic Courtès2013-04-30
|\
| * guix package: Add `--search-paths' & co.Ludovic Courtès2013-04-28
| | | | | | | | | | | | | | | | | | * guix/scripts/package.scm (search-path-environment-variables, display-search-paths): New procedures. (show-help, %options): Add `--search-paths'. (guix-package)[process-actions]: Call `display-search-paths' once the profile is ready. [process-query]: Honor `search-paths'.
* | substitute-binary: Support decompression from non-file ports.Ludovic Courtès2013-04-29
| | | | | | | | | | | | | | | | | | | | | | * guix/scripts/substitute-binary.scm (filtered-port): Move to utils.scm. (decompressed-port): Upon "none", return '() as the second value. (guix-substitute-binary): Expect `decompressed-port' to return a list of PIDs as its second value. * guix/utils.scm (filtered-port): New procedure. Add case for when INPUT is not `file-port?'. * tests/utils.scm ("filtered-port, file", "filtered-port, non-file"): New tests.
* | ui: Add `args-fold*' and use it.Ludovic Courtès2013-04-27
| | | | | | | | | | | | | | | | * guix/ui.scm (args-fold*): New procedure. * guix/scripts/build.scm, guix/scripts/download.scm, guix/scripts/gc.scm, guix/scripts/hash.scm, guix/scripts/import.scm, guix/scripts/package.scm, guix/scripts/pull.scm, guix/scripts/refresh.scm: Use `args-fold*' instead of `args-fold'.
* | pull: Use `download-to-store'.Ludovic Courtès2013-04-27
|/ | | | | * guix/scripts/pull.scm (download-and-store): Remove. (unpack): Use `download-to-store' instead.
* refresh: Add `--select'.Ludovic Courtès2013-04-25
| | | | | | | * guix/scripts/refresh.scm (%options): Add `--select'. (show-help): Likewise. Augment initial help text. (guix-refresh)[core-package?]: New procedure. Use it when selecting packages.
* web: Factorize `http-get' hackery.Ludovic Courtès2013-04-25
| | | | | | | | | | | | | This should fix `substitute-binary --query' on Guile 2.0.5. * guix/web.scm: New file. * Makefile.am (MODULES): Add it. * po/POTFILES.in: Add it. * guix/gnu-maintenance.scm (http-fetch): Remove. (%package-list-url): Turn into a URI. (official-gnu-packages): Add #:text? #t to `http-fetch' call. * guix/scripts/substitute-binary.scm (fetch): Remove `http' case, and use `http-fetch' instead.
* Add `guix refresh' and related auto-update tools.Ludovic Courtès2013-04-25
| | | | | | | | | * guix/gnu-maintenance.scm (ftp-server/directory)[quirks]: Add glib. (package-update-path, download-tarball, package-update, update-package-source): New procedures. * guix/gnupg.scm, guix/scripts/refresh.scm: New files. * Makefile.am (MODULES): Add them. * guix/utils.scm (file-extension): New procedure.