Commit Graph

2125 Commits

Author SHA1 Message Date
Ludovic Courtès
494dc2fc62
guix package: Inherit the transformed version number.
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.
2016-05-27 22:05:34 +02:00
Ludovic Courtès
b18ede2704
download: Default to a 10s connection establishment timeout.
* guix/build/download.scm (ftp-fetch): Add #:timeout and pass it to
'ftp-open'.
(http-fetch): Add #:timeout and pass it to 'open-connection-for-uri' and
in recursive calls.
(url-fetch): Add #:timeout and pass it to 'http-fetch' and 'ftp-fetch'.
2016-05-27 10:37:11 +02:00
Ludovic Courtès
dab2472c6a
download: Use URI objects for content-addressed mirrors.
This fixes a bug whereby 'http-fetch' would be passed a string instead
of a URI object.

* guix/build/download.scm (url-fetch): Rename 'content-addressed-urls'
to 'content-addressed-uris', and call 'string->uri'.
2016-05-27 10:37:11 +02:00
Ludovic Courtès
3af7a7a879
cve: Include the 3 previous years of vulnerabilities.
* guix/cve.scm (fetch-vulnerabilities): Add 'format' call.
(current-vulnerabilities): Include the 3 previous years.
2016-05-26 23:00:08 +02:00
Ludovic Courtès
ac0a7b0fbd
substitute: Internationalize the "Downloading" message.
* guix/scripts/substitute.scm (process-substitution): I18n "Downloading"
message.
2016-05-26 17:00:07 +02:00
Ludovic Courtès
1fd11c9259
grafts: Create only one grafted variant of each derivation.
Currently, with several grafts applicable to Inkscape, this makes:

  guix gc -R $(guix build inkscape -d) | wc -l

go from 2376 to 2266 (4.6%).

* guix/grafts.scm (cumulative-grafts): Pass 'graft-derivation/shallow'
the subset of GRAFTS that applies to DRV.
2016-05-25 23:33:56 +02:00
Ben Woodcroft
25c288cbf1 guix: ruby-build-system: Extract gemspec during 'extract-gemspec'.
* guix/build/ruby-build-system.scm (build): Move extraction from here ...
(extract-gemspec): ... to here.  New variable.
(first-gemspec): New variable.
(%standard-phases): Add 'extract-gemspec' phase.
2016-05-25 22:34:29 +10:00
Ludovic Courtès
007c20b61c
graft: Fail when one of the threads raises an exception.
Fixes <http://bugs.gnu.org/23581>.

* guix/build/graft.scm (exit-on-exception): New procedure.
(rewrite-directory): Use it to wrap REWRITE-LEAF.
2016-05-24 23:52:14 +02:00
Ludovic Courtès
92ed837a1e
size: Pass 'requisites' a list of items.
* guix/scripts/size.scm (substitutable-requisites): Change 'item' to
'items' and adjust.
(requisites*): Likewise.
(mappend-map): Remove.
(store-profile): Adjust accordingly.
2016-05-24 23:41:30 +02:00
Ludovic Courtès
f6fee16e93
store: 'requisites' now takes a list of store items.
* 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.
2016-05-24 23:35:28 +02:00
Ludovic Courtès
db761534df
size: Accept several arguments.
* 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.
2016-05-24 23:05:31 +02:00
Ludovic Courtès
a371aa225c
size: 'store-profile' takes a list of store items.
* 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.
2016-05-24 23:05:28 +02:00
Mathieu Lirzin
cf5f2ad30c
ui: Let users report translation bugs.
* guix/ui.scm (show-bug-report-information): Add a comment for
translators.
2016-05-24 12:58:40 +02:00
Alex Kost
a6eafbed66
build-system/emacs: Use 'emacs-minimal' by default.
* guix/build-system/emacs.scm (default-emacs): Use 'emacs-minimal'.
* gnu/packages/emacs.scm (emacs-auctex): Use 'emacs'.
2016-05-24 11:32:27 +03:00
Ludovic Courtès
e144e3427d
graph: Add 'node-reachable-count'.
* guix/graph.scm (node-reachable-count): New procedure.
* tests/graph.scm ("node-reachable-count"): New test.
2016-05-24 00:06:01 +02:00
Ludovic Courtès
623e4df42a
graph: Expose 'traverse/depth-first'.
* guix/graph.scm (traverse/depth-first): New procedure, based on code
formerly in 'node-transitive-edges'.
(node-transitive-edges): Rewrite in terms of it.
2016-05-24 00:06:01 +02:00
Ludovic Courtès
9a6beb3b7f
refresh: Make 'list-dependents' a monadic procedure.
* 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.
2016-05-24 00:06:01 +02:00
Ludovic Courtès
af98798c7a
union: Compare inode numbers in 'file=?'.
* guix/build/union.scm (file=?): Compare the inode of ST1 and ST2.
2016-05-23 18:05:46 +02:00
Ludovic Courtès
86cf13033e
cve: Remove now unnecessary HTTP caching.
* guix/cve.scm (call-with-cve-port): Use 'http-fetch' instead of
'http-fetch/cached'.
2016-05-23 18:05:46 +02:00
Ludovic Courtès
5cdd21c7fe
cve: Keep a summarized sexp in cache instead of the full XML.
This avoids ~20s of XML parsing when running 'guix lint -c cve'.

* guix/cve.scm (vulnerability->sexp, sexp->vulnerability)
(fetch-vulnerabilities): New procedures.
(current-vulnerabilities): Use 'fetch-vulnerabilities'.
2016-05-23 18:05:46 +02:00
Ludovic Courtès
ece6864bd0
grafts: Rename files whose name matches a graft.
Fixes <http://bugs.gnu.org/23132>.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/graft.scm (rename-matching-files): New procedure.
(rewrite-directory): Use it.
* tests/grafts.scm ("graft-derivation, renaming"): New test.
2016-05-21 01:35:14 +02:00
Ludovic Courtès
cf8b312d18
grafts: Preserve empty directories when grafting.
* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Add case for
'directory.
Pass #:directories? #t to 'find-files'.
2016-05-21 01:35:14 +02:00
Ludovic Courtès
30d4bc0434
substitute: Gracefully handle invalid store file names.
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.
2016-05-21 01:35:14 +02:00
Ludovic Courtès
a773c3142d
graph: Allow store file names for 'derivation' and 'references' graphs.
* 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.
2016-05-21 01:35:14 +02:00
Ludovic Courtès
97507ebedc
derivations: 'derivation' sorts items in the resulting object.
* guix/derivations.scm (derivation-input<?): New procedure.
(write-derivation)[coalesce-duplicate-inputs]: Remove.
Remove calls to 'sort'.
(coalesce-duplicate-inputs): New procedure.
(derivation-hash): Sort INPUTS and use 'coalesce-duplicate-inputs'.
(derivation)[input->derivation-input]
[coalesce-duplicate-inputs]: New procedures.
Sort OUTPUTS, INPUTS, and ENV-VARS.
* tests/derivations.scm ("read-derivation vs. derivation"): New test.
2016-05-21 01:35:14 +02:00
Ludovic Courtès
3cabdead6f
graph: Use absolute file name canonicalization.
* guix/scripts/graph.scm (guix-graph): Wrap in 'with-fluids'.
2016-05-21 01:35:14 +02:00
Ricardo Wurmus
932f2b70a6
ant-build-system: Add unpack phase.
* guix/build/ant-build-system.scm (unpack): New procedure.
(%standard-phases): Use it.
2016-05-20 15:24:32 +02:00
Ludovic Courtès
99effc8faa
lint: Honor 'cpe-name' and 'cpe-version' package properties.
* 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'.
2016-05-17 18:15:53 +02:00
Ludovic Courtès
aa8fff0ceb
store: Clarify 'query-path-hash' docstring.
* guix/store.scm (query-path-hash): Clarify docstring.
2016-05-17 14:02:48 +02:00
Ludovic Courtès
149590380a
import: Gracefully report import failures.
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.
2016-05-17 14:02:48 +02:00
Ludovic Courtès
787afdd0f1
import: Exit with non-zero when an unknown importer is asked.
* guix/scripts/import.scm (guix-import): Use 'leave' instead of 'format'
when IMPORTER is unknown.
2016-05-17 14:02:48 +02:00
Ricardo Wurmus
9916ae15bb
import cran: latest-bioconductor-release: Wrap Bioconductor URL in list.
* guix/import/cran.scm (latest-bioconductor-release): Wrap Bioconductor
URL in list in the "urls" field of the "upstream-source" value.
2016-05-16 21:00:41 +02:00
Ricardo Wurmus
9583e07cae
import cran: Use URL for Bioconductor 3.3.
* guix/import/cran.scm (%bioconductor-svn-url): Update to release URL
  for version 3.3.
2016-05-16 20:52:46 +02:00
Ricardo Wurmus
8bfd602bb0 build: Accept dates with space-padded hour field.
* guix/build/download.scm: Replace "parse-rfc-822-date" from the (web
  http) module.
2016-05-16 18:26:26 +02:00
Efraim Flashner
6b287c5c35
download: Update debian mirrors.
* guix/download.scm (mirrors)[debian]: Add Debian's archive to the
Debian mirror list.
2016-05-16 12:10:49 +03:00
Ludovic Courtès
cd436bf05a
download: Support content-addressed mirrors.
* guix/download.scm (%content-addressed-mirrors)
(%content-addressed-mirror-file): New variables.
* guix/download.scm (url-fetch)[builder]: Define
'value-from-environment.  Pass #:hashes and
 #:content-addressed-mirrors to 'url-fetch'.
Define "guix download hashes" environment variable.
* guix/build/download.scm (url-fetch): Add #:content-addressed-mirrors
and #:hashes.
[content-addressed-urls]: New variable.
Use it.
2016-05-14 17:37:47 +02:00
Ludovic Courtès
c22a475725
guix build: Catch 'getaddrinfo-error' for '--log-file'.
* guix/scripts/build.scm (log-url)[valid-url?]: Catch
'getaddrinfo-error'.
2016-05-14 16:56:21 +02:00
Ludovic Courtès
6e94a57478
guix build: Do not show what to build when '-d' is used.
* guix/scripts/build.scm (guix-build): Don't call 'show-what-to-build'
when OPTS contains 'derivations-only?'.
2016-05-14 16:47:12 +02:00
Mark H Weaver
9f5e796753
Merge branch 'master' into gnome-updates 2016-05-11 13:37:47 -04:00
Alex Kost
19e1d5f7f9 guix: utils: Re-export 'memoize'.
Suggested by Ludovic Courtès <ludo@gnu.org>.

* guix/utils.scm: Re-export 'memoize' to avoid a potential breakage of
  emacs interface.  See
  <http://lists.gnu.org/archive/html/guix-devel/2016-05/msg00146.html>
  for details.
2016-05-09 11:41:00 +03:00
宋文武
6655a74326 Merge branch 'master' into gnome-updates 2016-05-08 17:54:46 +08:00
Ludovic Courtès
d33c8b4649
syscalls: Use 'define-c-struct' for 'fcntl-flock'.
* guix/build/syscalls.scm (%struct-flock): Use 'define-c-struct'.
(fcntl-flock): Use 'write-flock!' and 'make-bytevector' instead of
'make-c-struct'.
2016-05-06 13:25:30 +02:00
Ludovic Courtès
4e0ea3eb28
utils: Move 'fcntl-flock' to (guix build syscalls).
* guix/utils.scm (%struct-flock, F_SETLKW, F_SETLK, F_xxLCK)
(fcntl-flock): Move to...
* guix/build/syscalls.scm: ... here.  New variables.
* guix/nar.scm: Adjust imports accordingly.
* tests/utils.scm ("fcntl-flock wait", "fcntl-flock non-blocking"): Move
to...
* tests/syscalls.scm: ... here.  New tests.
(temp-file): New variable.
2016-05-06 13:25:30 +02:00
Ludovic Courtès
958dd3ce68
utils: Move combinators to (guix combinators).
* 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.
2016-05-04 23:35:55 +02:00
Ludovic Courtès
4b6fa8b339
utils: Remove 'split'.
This procedure was redundant with SRFI-1's 'break'.

* guix/utils.scm (split): Remove.
* tests/utils.scm ("split, element is in list")
("split, element is not in list"): Remove.
2016-05-04 23:35:55 +02:00
Ludovic Courtès
6aaf3ea62d
environment: Use 'break' instead of 'split'.
* guix/scripts/environment.scm (parse-args): Use 'break' instead of
'split'.
2016-05-04 23:35:55 +02:00
Ludovic Courtès
8bf92e3904
services: herd: Move UI handling to 'guix system'.
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.
2016-05-04 23:35:55 +02:00
Mark H Weaver
4e9d04a80b Merge branch 'master' into gnome-updates 2016-05-04 11:43:50 -04:00
Ludovic Courtès
a8f3424b25
syscalls: Wrap TCSA* constants in 'tcsetattr-action' macro.
* guix/build/syscalls.scm (tcsetattr-action): New macro.
(TCSANOW, TCSADRAIN, TCSAFLUSH): Remove.
(tcsetattr): Adjust docstring accordingly.
* tests/syscalls.scm ("tcsetattr"): Adjust accordingly.
2016-05-03 17:45:29 +02:00
宋文武
d72d783301 profiles: Factor out 'manifest-lookup-package'.
* guix/profiles.scm (manifest-lookup-package): New procedure.
(gtk-icon-themes, xdg-desktop-database, xdg-mime-database): Use it.
2016-05-02 22:06:46 +08:00