Commit Graph

427 Commits

Author SHA1 Message Date
Cyrill Schenkel
cdb5b075d5 gc: ignore trailing slash or subdirectories for `guix gc -d'
Fixes <http://bugs.gnu.org/19757>.

* guix/scripts/gc.scm (guix-gc): Convert paths to direct store paths.
* guix/store.scm (direct-store-path): Get rid of subdirectories in store path.
* tests/guix-gc.sh: New tests.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2015-05-26 22:26:01 +02:00
Ludovic Courtès
db030303b8 guix system: Add '--on-error'.
* guix/ui.scm (load*): Add #:on-error parameter.
  [tag, error-string]: New variables.
  Wrap 'load' call in 'call-with-prompt'.  Pass TAG to 'make-stack'.  Honor
  ON-ERROR after 'report-load-error' call.
  (report-load-error): Change to not exit on error.  Make private.
* guix/scripts/system.scm (show-help, %options): Add --on-error.
  (guix-system): Use 'load*' and pass it #:on-error.
2015-05-25 22:52:41 +02:00
Ludovic Courtès
5f1087c481 guix package: --manifest DTRT when combined with --dry-run.
* guix/scripts/package.scm (guix-package)[process-actions]: Process 'manifest
  action regardless of whether 'dry-run? is set.  Adjust the message
  accordingly.
* tests/guix-package.sh: Add error-reporting test.
2015-05-25 21:34:23 +02:00
Ludovic Courtès
f245b03deb guix system: init: Copy the closure of 'grub.cfg', not that of the system.
Fixes <http://bugs.gnu.org/20591>.
Reported by Daniel Pimentel <d4n1@openmailbox.org>.

* guix/scripts/system.scm (install): Copy the closure of GRUB.CFG rather than
  that of OS-DIR.
2015-05-24 17:20:24 +02:00
Ludovic Courtès
328639e48f guix system: Always add zero previous entries in grub.cfg for 'init'.
* guix/scripts/system.scm (grub.cfg): Remove.
  (perform-action): Call 'operating-system-grub.cfg' with the empty list as
  the 2nd argument when ACTION is 'init.
2015-05-24 17:15:16 +02:00
Ludovic Courtès
4a35a866be guix system: init: Make sure the target is root-owned.
Suggested by Mark H Weaver <mhw@netris.org>.

* guix/scripts/system.scm (install): Add 'chown' and 'chmod' calls for TARGET
  when running as root, and warn otherwise.
2015-05-24 00:26:12 +02:00
Ludovic Courtès
a4b1a6b65e guix package: Adjust --help message.
* guix/scripts/package.scm (show-help): Add KIND parameter for
  --search-paths as a followup to dbc31ab.
2015-05-21 21:33:18 +02:00
David Thompson
2d977638c9 scripts: Move 'set-build-options-from-command-line*' to (guix scripts build) module.
* guix/scripts/build.scm (set-build-options-from-command-line*): New
  procedure.
* guix/scripts/environment.scm (set-build-options-from-command-line*): Delete.
2015-05-21 08:29:47 -04:00
David Thompson
4d043ab628 ui: Deduplicate 'show-what-to-build*'.
* guix/ui.scm (show-what-to-build*): New procedure.
* guix/scripts/environment.scm (show-what-to-build*): Delete.
* guix/scripts/system.scm (show-what-to-build*): Likewise.
* build-aux/make-binary-tarball.scm (show-what-to-build*): Likewise.
2015-05-21 08:29:47 -04:00
David Thompson
1b6764477f package: Add --manifest option.
* guix/scripts/package.scm (show-help): Add help text.
  (%options): Add manifest option.
  (guix-package): Add manifest option handler.
* doc/guix.texi ("Invoking guix package"): Document it.
* tests/guix-package.sh: Add test.
2015-05-20 12:13:04 -04:00
David Thompson
7ea1432e22 ui: Factorize user-provided Scheme file loading.
* guix/ui.scm (make-user-module, load*): New procedures.
* guix/scripts/system.scm (%user-module): Define in terms of
  'make-user-module'.
  (read-operating-system): Define in terms of load*'.
2015-05-20 12:13:04 -04:00
Ludovic Courtès
dbc31ab25c guix package: Add optional argument to --search-paths.
* guix/scripts/package.scm (search-path-environment-variables): Add #:kind
  parameter.  Pass it to 'environment-variable-definition'.
  (display-search-paths): Add #:kind parameter and pass it to
  'search-path-environment-variables'.
  (%options): Add an optional parameter for "--search-paths".
  (guix-package)[process-query]: Handle it.
* tests/guix-package-net.sh: Adjust existing test.
* tests/guix-package.sh: Adjust existing tests and add new test.
* doc/guix.texi (Invoking guix package): Document it.
2015-05-20 12:13:39 +02:00
Ludovic Courtès
755e1147aa guix package: --search-paths mentions $PATH.
* guix/scripts/package.scm (search-path-environment-variables): Add $PATH to
  SEARCH-PATHS.
2015-05-20 12:13:38 +02:00
Ludovic Courtès
38d2778608 guix gc: Add '--optimize'.
* guix/scripts/gc.scm (show-help, %options): Add --optimize.
  (guix-gc): Handle it.
2015-05-19 16:09:58 +02:00
Ludovic Courtès
9e2292ef3d publish: Add '--listen'.
* guix/scripts/publish.scm (show-help, %options): Add --listen.
  (getaddrinfo*): New procedure.
  (%default-options): Add 'address'.
  (open-server-socket): Replace 'addr' and 'port' with 'address', a
  sockaddr.
  (guix-publish): Adjust accordingly.  Augment "publishing" message with
  the actual address.
* doc/guix.texi (Invoking guix publish): Document it.
2015-05-12 21:22:52 +02:00
Ludovic Courtès
5463fe512a publish: Add '--user' option.
* guix/scripts/publish.scm (show-help): Add --user.
  (%options): Likewise.
  (run-publish-server): Change 'port' parameter to 'socket'.  Pass
  #:socket instead of #:addr and #:port to 'run-server'.  Update caller
  accordingly.
  (open-server-socket, gather-user-privileges): New procedures.
  (guix-publish): Use them.  Force %PRIVATE-KEY and %PUBLIC-KEY early
  on.  Warn when running as root.
* doc/guix.texi (Invoking guix publish): Document --user.
2015-05-12 21:22:52 +02:00
Ludovic Courtès
09d809db6a Remove assorted Guile 2.0.5 workarounds.
* guix/scripts/authenticate.scm (%default-port-conversion-strategy):
  Remove.
* guix/scripts/substitute.scm (fetch): Remove 2.0.5 special cases.
* guix/serialization.scm (write-file): Remove 'scandir' workaround.
* guix/ui.scm (command-files): Likewise.
2015-05-10 11:07:51 +02:00
Ludovic Courtès
7623848343 download: Work around Guile small-receive-buffer bug.
Previously, code using directly (guix build download) was still affected
by <http://bugs.gnu.org/15368>.  This includes source derivations, the
'guix download' command, and (guix gnu-maintenance).

'guix substitute' was unaffected since it used (guix http-client), which
already had the fix.

* guix/http-client.scm (open-socket-for-uri): Remove.
  (http-fetch): Remove #:buffered? argument to 'open-socket-for-uri';
  use 'setvbuf' instead.
* guix/scripts/substitute.scm (fetch): Likewise.
* guix/build/download.scm (open-socket-for-uri): New procedure, taken
  from guix/http-client.scm, but without the #:buffered? parameter.
2015-05-06 10:31:11 +02:00
Ludovic Courtès
8e3a3bc290 environment: Move iteration outside of 'for-each-search-path'.
* guix/search-paths.scm (search-path-definition): New procedure.
* guix/scripts/environment.scm (for-each-search-path): Rename to...
  (evaluate-input-search-paths): ... this.  Remove 'proc' and 'pure?'
  parameters, and return directly the list of search-path/value pairs.
  (create-environment): Use 'for-each' and 'evaluate-input-search-paths'
  instead of 'for-each-search-path'.
  (show-search-paths): Use 'for-each', 'search-path-definition', and
  'evaluate-search-paths' instead of 'for-each-search-path'.
2015-05-05 15:13:59 +02:00
Ludovic Courtès
b9ea6c6bf4 environment: Use 'evaluate-search-paths'.
This allows 'guix environment' to correctly handle non-directory
and/or pattern search-path specifications, such as that for
'XML_CATALOG_FILES'.

* guix/scripts/environment.scm (for-each-search-path): Use
  'evaluate-search-paths' instead of 'search-path-as-list' & co.
2015-05-05 15:13:59 +02:00
Ludovic Courtès
fdfa753c69 search-paths: Define the 'PATH' environment variable.
* guix/search-paths.scm ($PATH): New variable.
* guix/scripts/environment.scm (for-each-search-path): Use it.
2015-05-05 15:13:58 +02:00
Ludovic Courtès
369149995c search-paths: 'evaluate-search-paths' can be passed a list of directories.
* guix/search-paths.scm (evaluate-search-paths): Change 'directory' to
  'directories', and adjust 'search-path-as-list' accordingly.
* guix/scripts/package.scm (search-path-environment-variables): Adjust
  call accordingly.
2015-05-05 15:13:58 +02:00
Ludovic Courtès
099a2c7055 environment: Use (guix search-paths).
* guix/scripts/environment.scm: Use (guix search-paths).  Fixes a
  regression introduced in e89431b.
2015-05-05 11:01:08 +02:00
Ludovic Courtès
441cfb420a search-paths: 'evaluate-search-paths' now returns spec/value pairs.
* guix/search-paths.scm (evaluate-search-paths): Return
  specification/value pairs instead of variable/value pairs.
* guix/scripts/package.scm (search-path-environment-variables): Adjust
  accordingly.  Pass #:separator to 'environment-variable-definition'.
2015-05-04 23:30:52 +02:00
Ludovic Courtès
b07901c0cc search-paths: Add 'environment-variable-definition'.
* guix/search-paths.scm (environment-variable-definition): New variable.
* guix/scripts/package.scm (search-path-environment-variables): Use it.
2015-05-04 23:30:52 +02:00
Ludovic Courtès
6568d2bd6e search-paths: Add 'evaluate-search-paths', from (guix scripts package).
* guix/scripts/package.scm (with-null-error-port,
  evaluate-search-paths): Move to...
* guix/search-paths.scm: ... here.
* guix/utils.scm (string-tokenize*): Move to...
* guix/search-paths.scm: ... here.
* tests/utils.scm ("string-tokenize*"): Adjust accordingly.
2015-05-04 23:30:51 +02:00
Ludovic Courtès
e89431bf01 Move search path specifications to (guix search-paths).
* guix/packages.scm (<search-path-specification>,
  search-path-specification->sexp, sexp->search-path-specification):
  Move to...
* guix/search-paths.scm: ... here.  New file.
* Makefile.am (MODULES): Add it.
* guix/build-system/cmake.scm, guix/build-system/glib-or-gtk.scm,
  guix/build-system/gnu.scm, guix/build-system/haskell.scm,
  guix/build-system/perl.scm, guix/build-system/python.scm,
  guix/build-system/ruby.scm, guix/build-system/waf.scm,
  guix/profiles.scm, guix/scripts/package.scm: Use it.
2015-05-04 23:30:51 +02:00
Ludovic Courtès
5e6039a48b substitute: Increase TTL from 24h to 36h.
* guix/scripts/substitute.scm (%narinfo-ttl): Increase to 36h.
2015-05-04 23:30:51 +02:00
Eric Bavier
2087023dd4 guix: build: Fix indentation for --sources in help output.
* guix/scripts/build.scm (show-help)[--sources]: Make indentation
  consistent with other long options.
2015-05-04 14:16:39 -05:00
Ludovic Courtès
4e9f592058 guix package: Introduce 'evaluate-search-paths'.
* guix/scripts/package.scm (evaluate-search-paths): New procedure, with
  most of the code formerly in 'search-path-environment-variables'.
  (search-path-environment-variables): Use it.
2015-05-04 00:24:21 +02:00
Ludovic Courtès
3badccaa73 guix package: Move profile cleaning out of 'search-path-environment-variables'.
* guix/scripts/package.scm (user-friendly-profile): New procedure.
  (search-path-environment-variables): Remove 'profile' local variable.
  (display-search-paths): Explicitly call 'user-friendly-profile' for
  the argument to 'search-path-environment-variables'.
  (guix-package)[process-query]: Likewise.
2015-05-04 00:24:21 +02:00
Eric Bavier
2cdfe13dea guix: build: Add transitive source building.
* guix/scripts/build.scm (%options, options->derivations): Add --sources
  option.
* doc/guix.texi (Invoking guix build): Document --sources option.
* tests/guix-build.sh: Add tests.
2015-05-02 23:15:40 -05:00
Ludovic Courtès
dedb17ad01 profiles: Store search paths in manifests.
Discussed in <http://bugs.gnu.org/20255>.

* guix/packages.scm (sexp->search-path-specification): New variable.
* guix/profiles.scm (<manifest-entry>)[search-paths]: New field.
  (package->manifest-entry): Initialize it.
  (manifest->gexp): Match it.  Wrap #$deps in (propagated-inputs ...).
  Emit (search-paths ...).  Increment version.
  (find-package): New procedure.
  (sexp->manifest)[infer-search-paths]: New procedure.
  Use it to initialize the 'search-paths' field for versions 0 and 1.
  Add case for version 2.
* guix/scripts/package.scm (search-path-environment-variables)[manifest-entry->package]:
  Remove.
  Use 'manifest-entry-search-paths' instead of 'manifest-entry->package'
  plus 'package-native-search-paths'.
* tests/profiles.scm ("profile-manifest, search-paths"): New test.
2015-05-02 23:57:11 +02:00
Ludovic Courtès
310709ae58 substitute: Fix file descriptor leak in 'http-multiple-get'.
In practice we would not leak much since we reconnect after ~100
requests (with nginx running on hydra.gnu.org.)

* guix/scripts/substitute.scm (http-multiple-get): Call 'close-port'
  before 'connect'.
2015-05-01 12:50:27 +02:00
Ludovic Courtès
ee8591990f guix package: Fix 'readlink*' implementation.
* guix/scripts/package.scm (readlink*): Fix to handle symlinks with
  relative targets.  Taken from ld-wrapper2.in.
2015-04-19 23:34:53 +02:00
Ludovic Courtès
5763ad9266 guix package: -A and -s take supported systems into account.
* guix/scripts/package.scm (guix-package)[process-query]
  <list-available>: Restrict results to packages matching
  'supported-package?".
* guix/ui.scm (package->recutils): Print "systems:".
* tests/guix-package.sh: Add tests.
* doc/guix.texi (Invoking guix package): Adjust description of
  '--list-available' accordingly.
2015-04-19 23:34:53 +02:00
Mark H Weaver
933204e5b1 Merge branch 'master' into core-updates
Conflicts:
	gnu-system.am
	gnu/packages/gstreamer.scm
2015-04-17 09:54:11 -04:00
Ludovic Courtès
4b9b3cbbc4 refresh: Allow users to refer to specific package versions.
* guix/scripts/refresh.scm (guix-refresh): Use 'specification->package'
  instead of 'find-packages-by-name'.  This allows users to specify
  things like "qt-4.8.6".
* doc/guix.texi (Invoking guix refresh): Add an example.
2015-04-16 23:15:06 +02:00
Ludovic Courtès
aa46a028c4 profiles: Generalize "hooks" for 'profile-derivation'.
* guix/profiles.scm (info-dir-file): Remove (null? (manifest-entries
  manifest)) test.
  (ca-certificate-bundle): Likewise.
  (ghc-package-cache-file): Turn 'if' into 'and', and remove second
  arm.
  (%default-profile-hooks): New variable.
  (profile-derivation): Remove #:info-dir?, #:ghc-package-cache?, and
  #:ca-certificate-bundle?.  Add #:hooks.  Iterate over HOOKS.  Adjust
  'inputs' accordingly.
* guix/scripts/package.scm (guix-package): Adjust 'profile-derivation'
  call accordingly.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation",
  "profile-derivation, inputs"): Likewise.
2015-04-15 22:44:51 +02:00
Mark H Weaver
d5f01e48e0 guix package: Add '--do-not-upgrade' option.
* guix/scripts/package.scm (%options): Add the '--do-not-upgrade' option.
  (show-help): Document it.
  (options->installable): Add 'do-not-upgrade-regexps' variable.
  Use it in 'packages-to-upgrade'.
* doc/guix.texi (Invoking guix package): Document the '--do-not-upgrade'
  option.
2015-04-14 10:44:19 -04:00
Ludovic Courtès
002c57c6f7 lint: Add a 'derivation' checker.
* guix/scripts/lint.scm (check-derivation): New procedure.
  (%checkers): Add 'derivation' checker.
* tests/lint.scm ("derivation: invalid arguments"): New test.
2015-04-13 00:02:59 +02:00
Ludovic Courtès
b210b35d61 lint: Report patches that cannot be found.
* guix/scripts/lint.scm (check-patch-file-names): Wrap body in 'guard'.
* tests/lint.scm ("patches: not found"): New test.
2015-04-10 10:27:46 +02:00
Ludovic Courtès
56b1b74c90 lint: Rename 'check-patches' to 'check-patch-file-names'.
* guix/scripts/lint.scm (check-patches): Rename to...
  (check-patch-file-names): ... this.  Rename 'filename' to 'file'.
  (%checkers): Adjust accordingly.
* tests/lint.scm ("patches: file names"): Likewise.
2015-04-10 10:11:59 +02:00
Ludovic Courtès
ee5408576d Merge branch 'master' into core-updates 2015-04-09 21:10:46 +02:00
Federico Beffa
042bc828fc profiles: Generate GHC's package database cache.
* guix/profiles.scm (ghc-package-cache-file): New procedure.
  (profile-derivation): Add 'ghc-package-cache?' keyword argument.  If true
  (the default), add the result of 'ghc-package-cache-file' to 'inputs'.
* guix/scripts/package.scm (guix-package)[process-actions]: Pass
  #:ghc-package-cache? to 'profile-generation'.
* tests/packages.scm ("--search-paths with pattern"): Likewise.
* tests/profiles.scm ("profile-derivation"): Likewise.
2015-04-08 17:31:12 +02:00
Federico Beffa
863af4e121 import: Add hackage importer.
* guix/scripts/import.scm (importers): Add hackage.
* guix/scripts/import/hackage.scm: New file.
* po/guix/POTFILES.in: Add guix/scripts/import.scm.
* doc/guix.texi: Add section on 'hackage' importer.
2015-04-08 17:31:11 +02:00
宋文武
cf3e3e374c Merge branch 'master' into core-updates 2015-04-08 16:04:37 +08:00
Ludovic Courtès
1151f6aeae ui: Add 'report-load-error'.
* guix/scripts/system.scm (read-operating-system): Replace error
  handling code by a call to 'report-load-error'.
* guix/ui.scm (report-load-error): New procedure.
2015-04-07 22:28:36 +02:00
Ludovic Courtès
250bc998ac guix package: Avoid 'exit' calls in 'delete-matching-generations'.
* guix/scripts/package.scm (delete-matching-generations): Remove call to
  'exit' when PATTERN is "0".  Call 'leave' instead of 'exit'
  when (null-list? number).
2015-04-06 21:27:35 +02:00
Ludovic Courtès
d26eb84d14 guix package: Never remove the current generation and warn about it.
Fixes <http://bugs.gnu.org/19978>.
Reported by taylanbayirli@gmail.com (Taylan Ulrich Bayırlı/Kammer).

* guix/scripts/package.scm (delete-matching-generations): Warn when
  CURRENT is in NUMBERS, and always remove it before calling
  'delete-generations'.
* tests/guix-package.sh: Add --switch-generation=2 invocation before
  --delete-generations=3 invocation.
  Add --delete-generations=1.. test case.
2015-04-06 21:27:32 +02:00