Commit Graph

2430 Commits (7843f276d1c9c2b0c6b6a2c91ddd12500320945e)

Author SHA1 Message Date
Ludovic Courtès 40f788b9f6
download: Add mirror.hydra.gnu.org as a content-addressed mirror.
* guix/download.scm (%content-addressed-mirrors): Add
'mirror.hydra.gnu.org'.
2016-07-31 18:27:14 +02:00
Ludovic Courtès 38f1cf8a8e
download: Pass the raw file name to content-addressed mirrors.
* guix/build/download.scm (url-fetch)[content-addressed-uris]: Call
'strip-store-file-name' on FILE before passing it to 'make-url'.
2016-07-31 18:27:14 +02:00
Alex Kost a82a201a8d
emacs: Disable grafts when dry-run is enabled.
* emacs/guix-main.scm (process-package-actions): Set grafting according
to 'dry-run?'.
* guix/scripts.scm (build-package): Disable grafts when 'dry-run?' is #t.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-07-30 18:17:03 +03:00
Mark H Weaver 359aba76b6
Merge branch 'master' into core-updates 2016-07-29 18:29:58 -04:00
Ludovic Courtès da2d893e32
size: Fix corner case with multiple items on the command line.
Fixes 'guix size foo bar' when 'foo' is in the local store and 'bar'
isn't, which could lead to an incomplete requisite list.

* guix/scripts/size.scm (requisites*): Partition ITEMS according to
'valid-path?'.  Use 'substitutable-requisites' only on invalid items.
2016-07-29 22:32:04 +02:00
Leo Famulari 49d725a108
Merge branch 'master' into core-updates 2016-07-28 16:46:27 -04:00
Mark H Weaver 622c22ccb4
Merge branch 'master' into core-updates 2016-07-28 14:13:26 -04:00
Ludovic Courtès 4e3bfaf406
guix package: Suggest prefix search path settings.
* guix/scripts/package.scm (build-and-use-profile): Pass #:kind 'prefix
to 'display-search-paths'.
2016-07-28 20:07:59 +02:00
Ludovic Courtès 6980511b73
packages: Add 'hidden-package'.
* guix/packages.scm (hidden-package, hidden-package?): New procedures.
* gnu/packages.scm (fold-packages): Filter out 'hidden-package?'.
* tests/packages.scm ("hidden-package"): New test.
2016-07-28 18:50:43 +02:00
Andreas Enge e309c75610
Merge remote-tracking branch 'origin/master' into core-updates 2016-07-28 11:08:55 +02:00
Ludovic Courtès 688ec13c45
zlib: Protect against non-empty port internal buffers.
* guix/zlib.scm (make-gzip-input-port)[gzfile]: Error out
if (drain-input port) returns a non-empty string.
* guix/zlib.scm (make-gzip-output-port)[gzfile]: Call 'force-output'.
2016-07-27 12:45:01 +02:00
Ludovic Courtès d00240c36e
zlib: Clarify when 'gzread!' can return zero.
* guix/zlib.scm (gzread!): Augment docstring to clarify when zero is
returned (based on reading zlib code).
(make-gzip-input-port)[read!]: Remove scary comment.
2016-07-27 12:45:01 +02:00
Ludovic Courtès 9e90fc7713
profiles: Output in 'package->manifest-entry' defaults to "out".
Fixes <http://bugs.gnu.org/24029>.
Reported by Dylan Jeffers <sapientech@openmailbox.org>.

* guix/profiles.scm (package->manifest-entry): Change #:output to
default to "out".
(packages->manifest): Add 'package?' in second 'match' clause.
* tests/profiles.scm ("package->manifest-entry defaults to \"out\""):
New test.
2016-07-26 18:18:53 +02:00
Ludovic Courtès 201855221f
environment: Set 'GUIX_ENVIRONMENT' to the profile.
* guix/scripts/environment.scm (create-environment): Set
'GUIX_ENVIRONMENT' to PROFILE.
* tests/guix-environment.sh: Test it.
* doc/guix.texi (Invoking guix environment): Document it.
2016-07-26 17:59:25 +02:00
Ludovic Courtès 8173ceee1f
import: pypi: Correctly handle new-style URLs.
Fixes <http://bugs.gnu.org/23997>.

* guix/import/pypi.scm (guix-package->pypi-name): Rewrite using
'basename' and 'hyphen-package-name->name+version'.
* tests/pypi.scm ("guix-package->pypi-name, old URL style")
("guix-package->pypi-name, new URL style"): New tests.
2016-07-26 17:49:34 +02:00
Andreas Enge 14656f4495
Merge remote-tracking branch 'origin/master' into core-updates 2016-07-25 21:58:36 +02:00
Alex Kost 9eb5a449ee
profiles: Add fonts-dir-file hook.
* guix/profiles.scm (fonts-dir-file): New procedure.
(%default-profile-hooks): Add it.
2016-07-25 17:18:52 +03:00
David Craven 99fe215cc1
lint: 'inputs-should-be-native' checks for intltool, itstool and glib:bin.
* guix/scripts/lint.scm (check-inputs-should-be-native): Warn when intltool,
itstool or glib:bin isn't a native-input.
* tests/lint.scm (inputs: glib:bin is probably a native input): Add test.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-07-24 19:54:15 +02:00
Alex Griffin fe224d20cc
download: Add SourceForge load balancer.
* guix/download.scm (%mirrors)[sourceforge]: Add canonical load balancer for
sourceforge.net.

Signed-off-by: Leo Famulari <leo@famulari.name>
2016-07-24 12:35:46 -04:00
Leo Famulari d227260d2f
Merge branch 'master' into core-updates
Resolved conflicts:
* gnu/packages/scheme.scm: Conflict in import of (guix licenses). On master,
"#:hide (openssl)" was used. On core-updates, "#:select (some licenses)" was
used. The latter won the conflict.
* gnu/packages/version-control.scm (git)[arguments]: Whitespace conflict
in 'install-shell-completion.
2016-07-22 18:58:31 -04:00
Ludovic Courtès 13cee334f1
pull: Install (guix config) module to override the user's one.
* build-aux/build-self.scm (zlib, gzip, bzip2, xz): New variables.
(build)[storedir, localstatedir, sysconfdir, sbindir]: New variables.
[builder]: Pass them to 'build-guix'.
* guix/build/pull.scm (build-guix): Add #:system, #:storedir,
  #:localstatedir, #:sysconfdir, #:sbindir, #:package-name,
  #:package-version, #:bug-report-address, #:home-page-url, #:libgcrypt,
  #:zlib, #:gzip, #:bzip2, and #:xz.  Remove #:gcrypt.
  Instantiate all the substitution variables in (guix config).  Remove
  code to delete OUT/guix/config.{scm,go}.
* guix/config.scm.in: Add note about (guix script pull).
2016-07-20 22:53:02 +02:00
Ludovic Courtès 0b0086e94c
config: Export the raw installation directories.
* guix/config.scm.in (%storedir, %localstatedir)
(%sysconfdir, %sbindir): New variables.
(%store-directory): Use %STOREDIR.
(%state-directory): Use %LOCALSTATEDIR.
(%config-directory): Use %SYSCONFDIR.
(%guix-register-program): Use %SBINDIR.
2016-07-20 22:53:02 +02:00
Ludovic Courtès ab84b927ef
download: Prepare to support the 'guix publish' /file URLs.
* guix/download.scm (%content-addressed-mirrors): Add 'file' parameter
to the lambda.
* guix/build/download.scm (url-fetch)[content-addressed-uris]: Adjust
accordingly.
2016-07-20 17:02:35 +02:00
Ludovic Courtès ff6638d112
publish: Handle '/file' URLs, for content-addressed files.
* guix/scripts/publish.scm (render-content-addressed-file): New procedure.
(http-write): Add 'application/octet-stream' case.
(make-request-handler): Add /file/NAME/sha256/HASH URLs.
* tests/publish.scm ("/file/NAME/sha256/HASH")
("/file/NAME/sha256/INVALID-NIX-BASE32-STRING")
("/file/NAME/sha256/INVALID-HASH"): New tests.
* doc/guix.texi (Invoking guix publish): Mention the /file URLs.
2016-07-20 16:54:31 +02:00
Ludovic Courtès 260bc60f83
derivations: Export 'fixed-output-path'.
* guix/derivations.scm (fixed-output-path): Change 'output',
'hash-algo', and 'recursive?' to keyword parameters.  Export.
(derivation): Adjust accordingly.
2016-07-20 16:39:19 +02:00
Ludovic Courtès 7575655212
Merge branch 'master' into core-updates 2016-07-20 11:42:17 +02:00
Ludovic Courtès 053fa76ae7
publish: Keep compression disabled when zlib is missing.
Reported by David Thompson.

* guix/scripts/publish.scm (%options)[--compression]: Warn if LEVEL > 0
and zlib is missing, and return RESULT.
2016-07-19 16:47:19 +02:00
Ludovic Courtès 4a1fc562ae
publish: Add '--compression'.
* guix/scripts/publish.scm (show-help, %options): Add '--compression'.
(<compression>): New record type.
(%no-compression, %default-gzip-compression): New variables.
(%default-options): Add 'compression' key.
(narinfo-string): Add #:compression parameter and honor it.
(render-narinfo): Likewise.
(render-nar): Likewise.
<top level>: Add call to 'declare-header!'.
(swallow-zlib-error): New macro.
(nar-response-port): New procedure.
(http-write): Add call to 'force-output'.  Use 'nar-response-port'
instead of 'response-port'.  Use 'swallow-zlib-error'.
(make-request-handler): Add #:compression parameter and honor it.  Add
"nar/gzip" URL handler.
(run-publish-server): Add #:compression parameter and honor it.
(guix-publish): Honor --compression.
* tests/publish.scm (http-get-port, wait-until-ready): New procedures.
<top level>: Run main server with "-C0".  Call 'wait-until-ready'.
("/nar/gzip/*", "/*.narinfo with compression"): New tests.
* doc/guix.texi (Invoking guix publish): Document it.
2016-07-19 00:07:12 +02:00
Ludovic Courtès 721539026d
Add (guix zlib).
* guix/zlib.scm, tests/zlib.scm: New files.
* Makefile.am (MODULES): Add guix/zlib.scm.
(SCM_TESTS): Add tests/zlib.scm.
* m4/guix.m4 (GUIX_LIBGCRYPT_LIBDIR): New macro.
* configure.ac (LIBGCRYPT_LIBDIR): Use it.  Define and substitute
'LIBZ'.
* guix/config.scm.in (%libz): New variable.
2016-07-19 00:07:12 +02:00
Vincent Legoll 1187a27112
guix gc: Display of saved space for garbage collection.
Fixes <http://bugs.gnu.org/23979>.

* guix/scripts/gc.scm (guix-gc): Display freed bytes.

Signed-off-by: Vincent Legoll <vincent.legoll@idgrilles.fr>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-07-16 14:41:39 +02:00
Ludovic Courtès f82ce8f6b1
build: Substitute URLs now default to "mirror.hydra.gnu.org" alone.
* config-daemon.ac: Remove "hydra.gnu.org" from 'guix_substitute_urls'.
* guix/store.scm (%default-substitute-urls): Remove "hydra.gnu.org".
2016-07-16 14:41:39 +02:00
Ludovic Courtès babc2c80a7
records: Improve reporting of invalid field specifiers.
Fixes <http://bugs.gnu.org/23969>.
Reported by Vincent Legoll <vincent.legoll@gmail.com>.

* guix/records.scm (report-invalid-field-specifier): New procedure.
* tests/records.scm ("define-record-type* & wrong field specifier"): New
test.
2016-07-14 19:07:07 +02:00
Ludovic Courtès db8f6b3412
challenge: Disable grafting.
* guix/scripts/challenge.scm (guix-challenge): Set %GRAFT? to #f.
2016-07-14 19:07:07 +02:00
Ludovic Courtès a7a3b39060
substitute: Gracefully handle trailing slashes in URLs.
Previously, using something like
"--substitute-urls=http://example.org///" would lead to a
'cache-narinfo!' call with #f as its second argument.

It would also do the wrong thing for URLs with a non-empty initial path
component, such as "http://example.org/foo/bar".

* guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]:
Add call to 'basename' for PATH.
2016-07-14 19:07:07 +02:00
Ludovic Courtès bfcb3d767b
lint: 'validate-uri' reports suspiciously small 200 responses.
* guix/scripts/lint.scm (validate-uri): Upon 200 http-response, check
the 'response-content-length' and emit a warning when it is <= 1000.
* tests/lint.scm (call-with-http-server): Add 'data' parameter.
(with-http-server): Likewise.
(%long-string): New variable.
("home-page: 200"): Pass %LONG-STRING to 'with-http-server'.
("home-page: 404", "source: 200", "source: 404"): Likewise.
("home-page: 200 but short length"): New test.
("source: 200 but short length"): New test.
2016-07-13 00:50:05 +02:00
Ludovic Courtès cd4c41fdcf
download: Attempt to update SourceForge mirror URLs.
* guix/download.scm (%mirrors)[sourceforge]: End in "/project" instead
of "/sourceforge".  Remove a couple of dangling URLs.
2016-07-13 00:32:36 +02:00
Ludovic Courtès 1929fdba80
packages: <origin> no longer has an 'imported-modules' field.
* guix/packages.scm (<origin>)[imported-modules]: Remove.
(patch-and-repack): Remove #:imported-modules.  Use
'with-imported-modules'.  Remove #:modules argument to
'gexp->derivation'.
(origin->derivation): Adjust accordingly.
* doc/guix.texi (origin Reference): Adjust accordingly.
2016-07-12 22:47:08 +02:00
Ludovic Courtès 66a35ceb43
gexp: Remove more uses of #:modules.
* guix/scripts/system.scm (switch-to-system): Adjust comment.
* tests/gexp.scm ("gexp->derivation #:references-graphs"): Use
'with-imported-modules' instead of #:modules.
* tests/grafts.scm ("graft-derivation, preserve empty directories"):
Likewise.
2016-07-12 22:47:08 +02:00
Ludovic Courtès 9c14a487bb
gexp: 'program-file' and 'gexp->script' no longer have #:modules.
* guix/gexp.scm (<program-file>)[modules]: Remove.
(program-file): Remove #:modules and adjust accordingly.
(program-file-compiler): Likewise.
(gexp->script): Likewise.
2016-07-12 22:47:08 +02:00
Ludovic Courtès a769bffb65
gexp: 'computed-file' no longer has a #:modules parameter.
* guix/gexp.scm (<computed-file>)[modules]: Remove.
(computed-file): Remove #:modules.
(computed-file-compiler): Likewise.
* doc/guix.texi (G-Expressions): Adjust accordingly.
2016-07-12 22:47:08 +02:00
Ludovic Courtès e9b046fdda
download: Use 'with-imported-modules'.
* guix/cvs-download.scm (cvs-fetch): Use 'with-imported-modules' instead
of the #:modules argument of 'gexp->derivation'.
* guix/download.scm (url-fetch): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/hg-download.scm (hg-fetch): Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
2016-07-12 22:47:08 +02:00
Ludovic Courtès 99b231dee6
profiles: Use 'with-imported-modules'.
* guix/profiles.scm (info-dir-file): Use 'with-imported-modules' instead
of the #:module argument to 'gexp->derivation'.
(ghc-package-cache-file): Likewise.
(ca-certificate-bundle): Likewise.
(gtk-icon-themes): Likewise.
(xdg-desktop-database): Likewise.
(xdg-mime-database): Likewise.
(profile-derivation): Likewise.
2016-07-12 22:47:08 +02:00
Ludovic Courtès 2b4185792d
gexp: 'gexp->file' emits code to set '%load-path'.
* guix/gexp.scm (gexp->file): Add #:set-load-path? parameter and honor it.
* gnu/system.scm (operating-system-parameters-file): Pass
  #:set-load-path? #f.
* doc/guix.texi (G-Expressions): Adjust accordingly.
2016-07-12 22:47:08 +02:00
Ludovic Courtès dd8d1a3046
gexp: Factorize load-path-setting expression.
* guix/gexp.scm (load-path-expression): New procedure.
(gexp->script): Use it.
2016-07-12 22:47:08 +02:00
Ludovic Courtès 0bb9929eaa
gexp: Add 'with-imported-modules' macro.
* guix/gexp.scm (<gexp>)[modules]: New field.
(gexp-modules): New procedure.
(gexp->derivation): Use it and append the result to %MODULES.
Update docstring to mark #:modules as deprecated.
(current-imported-modules, with-imported-modules): New macros.
(gexp): Pass CURRENT-IMPORTED-MODULES as second argument to 'gexp'.
(gexp->script): Use and honor 'gexp-modules'; define '%modules'.
* tests/gexp.scm ("gexp->derivation & with-imported-modules")
("gexp->derivation & nested with-imported-modules")
("gexp-modules & ungexp", "gexp-modules & ungexp-splicing"):
New tests.
("program-file"): Use 'with-imported-modules'.  Remove #:modules
argument to 'program-file'.
* doc/guix.texi (G-Expressions): Document 'with-imported-modules'.
Mark #:modules of 'gexp->derivation' as deprecated.
* emacs/guix-devel.el: Add syntax for 'with-imported-modules'.
(guix-devel-keywords): Add it.
* .dir-locals.el: Likewise.
2016-07-12 22:47:08 +02:00
Ludovic Courtès affd7761f3
gexp: Keep only a single 'references' field.
The distinction between native inputs and "normal" inputs can already be
determined by looking at the 'native?' field of <gexp-input>.  The extra
'natives' field of <gexp> added complexity for no good reason.

* guix/gexp.scm (<gexp>)[natives]: Remove.
(write-gexp): Remove use of 'gexp-native-references'.
(gexp-inputs)[native-input?]: New procedure.
Use it.
(gexp->sexp)[reference->sexp]: Honor N? for input lists.
Remove use of 'gexp-native-references'.
(gexp)[collect-native-escapes]: Remove.
Simplify.
2016-07-12 22:47:08 +02:00
Alex Sassmannshausen 5b8e564ccd
import: cpan: Use our mirrors for 'https' URLs.
* guix/import/cpan.scm (fix-source-url): New procedure.
  (cpan-module->sexp): Use it to construct our source-url.
* tests/cpan.scm: Add tests for fix-source-url.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-07-03 23:58:29 +02:00
Ricardo Wurmus 140dd8f82c
guix: Support authentication when fetching from SVN.
* guix/svn-download.scm (<svn-reference>): Add fields for optional
credentials.
(svn-fetch): Pass credentials to build-side "svn-fetch".
* guix/build/svn.scm (svn-fetch): Pass optional credentials to svn
command.
2016-07-03 18:55:30 +02:00
Ludovic Courtès 8aa5e15ebd
download: Update CPAN mirrors.
* guix/download.scm (%mirrors)[cpan]: Remove enstimac.fr, which seems
dead; add ibcp.fr.
2016-07-02 16:24:35 +02:00
David Thompson 242ad41c01
download: Use basic authentication when userinfo is present in URI.
* guix/download.scm (url-fetch): Include (guix base64) module on the
  build-side.
* guix/build/download.scm (http-fetch): Add "Authorization" header when
  userinfo is present in the URI.
2016-06-29 08:51:41 -04:00
Ludovic Courtès 01497dfe6c
Merge branch 'master' into core-updates 2016-06-27 09:30:01 +02:00
David Craven 9dd674db01
daemon: Rename 'NIX_CONF_DIR' to 'GUIX_CONFIGURATION_DIRECTORY'.
Partly fixes <http://bugs.gnu.org/22459>.
Reported by Jeff Mickey <j@codemac.net> and David Craven <david@craven.ch>.

* nix/libstore/globals.cc (Settings::processEnvironment()): Change
'NIX_CONF_DIR' to 'GUIX_CONFIGURATION_DIRECTORY'.
* nix/local.mk (libstore_a_CPPFLAGS): Likewise.
* guix/config.scm.in (%config-directory): Likewise.
* build-aux/test-env.in: Likewise.
* gnu/packages/patches/hydra-automake-1.15.patch: Likewise.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-06-26 23:11:07 +02:00
Cyril Roelandt aebd383d04 import: pypi: do not fail when 'run_requires' is missing from the metadata.
* guix/import/pypi.scm (read-wheel-metadata): do not crash when 'run_requires'
is missing from the metadata.
2016-06-25 15:33:06 +02:00
宋文武 8ea8e8d3c3
guix: python-build-system: Change pypi-uri to use https://pypi.io.
* guix/build-system/python.scm (pypi-uri): Use https://pypi.io.
* gnu/packages/python.scm (python-twisted)[uri]: Remove https://pypi.io.
2016-06-25 20:49:59 +08:00
Ludovic Courtès 934c5d5b28
utils: 'cache-directory' always appends "/guix".
Fixes <http://bugs.gnu.org/23836>.
Fixes a regression introduced in f10dcbf1a9.
Reported by myglc2 <myglc2@gmail.com>.

* guix/utils.scm (cache-directory): Always append "/guix".
2016-06-25 01:13:23 +02:00
Efraim Flashner bae06364c1
bournish: Add 'wc' command.
* guix/build/bournish.scm (lines+chars, file-exists?*, wc-print)
(wc-l-print, wc-c-print, wc-command, wc-command-implementation)
(wc-l-command-implementation, wc-c-command-implementation): New procedures.
(%commands): Add 'wc'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-06-23 10:27:02 +02:00
Ludovic Courtès f10dcbf1a9
substitute: Use ~/.cache when invoked by an unprivileged user.
This is a followup to ea0c6e0507.

* guix/scripts/substitute.scm (%narinfo-cache-directory): Use
'cache-directory' when (getuid) returns non-zero.
(cache-narinfo!): Remove 'catch'.
2016-06-22 23:46:32 +02:00
Ludovic Courtès 3583b27b2c
utils: 'cache-directory' honors 'XDG_CACHE_HOME'.
* guix/utils.scm (cache-directory): Honor 'XDG_CACHE_HOME', not
'XDG_CONFIG_HOME'.
2016-06-22 23:39:57 +02:00
Alex Kost 2831675bfd
build: emacs: Search for elisp in "share/emacs/site-lisp".
* guix/build/emacs-build-system.scm (emacs-inputs-el-directories):
Add ".../share/emacs/site-lisp" directory to the returned result as
elisp files can also be placed there.
2016-06-22 11:15:28 +03:00
Ludovic Courtès a9601e2352
gexp: Use a relative file name.
This is a followup to cbbbb7be0f.

* guix/gexp.scm (%utils-module): Use a file name relative to this file
instead of using 'search-path'.
2016-06-20 23:50:46 +02:00
Ludovic Courtès a68d0f6fd5
utils: 'current-source-directory' gracefully handles lack of source info.
* guix/utils.scm (current-source-directory): Add case for when FILE-NAME
is #f.
2016-06-20 00:52:53 +02:00
Ludovic Courtès cbbbb7be0f
utils: 'current-source-directory' resolves relative file names at run time.
* guix/utils.scm (absolute-dirname): New procedure.
(current-source-directory): Emit code to use it instead of calling
'search-path'.
2016-06-20 00:52:53 +02:00
Ludovic Courtès 95fa173ed1
store: 'register-path' no longer swallows 'system-error' exceptions.
* guix/store.scm (register-path): Do not catch 'system-error'.
2016-06-20 00:52:53 +02:00
Ludovic Courtès c0eeccbc24
Merge branch 'master' into core-updates 2016-06-17 15:48:27 +02:00
Ludovic Courtès d4dd37fc46
utils: 'current-source-directory' returns the absolute directory name.
* guix/utils.scm (current-source-directory): When FILE-NAME is relative,
use 'search-path' to determine the absolute file name.
2016-06-16 23:50:44 +02:00
Ludovic Courtès 5dbae738f0
utils: 'current-source-directory' is now purely an expansion-time thing.
* guix/utils.scm (extract-directory): Remove.
(current-source-directory): Rewrite as a 'syntax-case' macro.
2016-06-16 23:50:44 +02:00
Ludovic Courtès a7db719f3d
packages: Disambiguate 'modules' and 'imported-modules' in <origin>.
The two mistakes made here (confusion between 'modules' and
'imported-modules') were canceling each other.

* guix/packages.scm (patch-and-repack): Use IMPORTED-MODULES, not
MODULES, as the base of the module list passed as #:modules to
'gexp->derivation'.
(origin->derivation): Pass IMPORTED-MODULES, not MODULES, as
the #:imported-modules argument of 'patch-and-repack'.
* gnu/packages/engineering.scm (fastcap)[source]: Add 'imported-modules'
field.
2016-06-16 14:31:52 +02:00
Ludovic Courtès 0687fc9cd9
gexp: Add #:select? parameter to 'local-file'.
* guix/gexp.scm (<local-file>)[select?]: New field.
(true): New procedure.
(%local-file): Add #:select? and honor it.
(local-file): Likewise.
* tests/gexp.scm ("local-file, #:select?"): New test.
* doc/guix.texi (G-Expressions): Adjust accordingly.
2016-06-16 09:34:32 +02:00
Ludovic Courtès 07c8a98c3b
gexp: Move 'current-source-directory' to (guix utils).
* guix/gexp.scm (extract-directory, current-source-directory): Move to...
* guix/utils.scm (extract-directory, current-source-directory):
... here.  New procedures.
2016-06-16 09:34:32 +02:00
Ricardo Wurmus c4e48b68bd
guix: Add downloader for Mercurial repositories.
* guix/build/hg.scm: New file.
* guix/hg-download.scm: New file.
* Makefile.am (MODULES): Add them.
2016-06-15 17:02:18 +02:00
Ludovic Courtès 1ec32f4a9d
store: Add #:select? parameter to 'add-to-store'.
* guix/store.scm (write-arg): Remove 'file' case.
(true): New procedure.
(add-to-store): Add #:select? parameter and honor it.  Use hand-coded
stub instead of 'operation'.
(interned-file): Add #:select? parameter and honor it.
* doc/guix.texi (The Store Monad): Adjust 'interned-file' documentation
accordingly.
2016-06-15 15:26:30 +02:00
Ludovic Courtès da675305dd
packages: The 'source' can be any lowerable object.
* guix/packages.scm (expand-input): Use 'struct?' instead of 'origin?'
when matching SOURCE.
(package-source-derivation): Use 'lower-object' instead of
'origin->derivation'.
* tests/packages.scm ("package-source-derivation, local-file"): New
test.
* doc/guix.texi (package Reference): Update 'source' documentation
accordingly.
2016-06-15 15:26:30 +02:00
Ludovic Courtès 789510640d
packages: 'origin->derivation' expects an origin and nothing else.
* guix/packages.scm (origin->derivation): Rename 'source' parameter to
'origin'.  Move cases where SOURCE is a string to...
(package-source-derivation): ... here.
2016-06-15 15:26:30 +02:00
Ludovic Courtès 5257ab6de2
packages: Recognize the '.Z' extension.
Reported by thomasd on #guix.

* guix/packages.scm (patch-and-repack)[decompression-type]: Add "Z".
2016-06-15 15:26:30 +02:00
Cyril Roelandt 266785d21e import: pypi: read requirements from wheels.
* doc/guix.tex (Invoking guix import): Mention that the pypi importer
works better with "unzip".
* guix/import/pypi.scm (latest-wheel-release,
wheel-url->extracted-directory): New procedures.
* tests/pypi.scm (("pypi->guix-package, wheels"): New test.
2016-06-14 22:03:22 +02:00
Ludovic Courtès c25637dfe8
utils: 'with-atomic-file-output' closes the port upon exception.
Previously it could have left the file descriptor open.

* guix/utils.scm (with-atomic-file-output): Call 'close-port' in handler.
2016-06-13 18:05:54 +02:00
Ludovic Courtès d1f33ba44b
syscalls: Use 'syscall->procedure' everywhere.
* guix/build/syscalls.scm (mkdtemp!, setns, %ioctl, network-interfaces):
(free-ifaddrs): Use 'syscall->procedure'.
2016-06-13 18:05:54 +02:00
Ludovic Courtès 1752a17a1e
utils: 'with-atomic-file-output' calls 'fdatasync'.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>
at <https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00456.html>.

* guix/build/syscalls.scm (fdatasync): New procedure.
* guix/utils.scm (with-atomic-file-output): Use it.  Use 'close-port'
instead of 'close'.
2016-06-13 18:05:54 +02:00
Leo Famulari ee86e7e148
Merge branch 'master' into core-updates 2016-06-12 22:09:26 -04:00
Ludovic Courtès fe585be9aa
serialization: Add #:select? parameter to 'write-file'.
* guix/serialization.scm (write-file): Add #:select? parameter and honor it.
* tests/nar.scm ("write-file #:select? + restore-file"): New test.
2016-06-12 23:55:22 +02:00
Ludovic Courtès 4d4c3614c8
profiles: Make sure hook derivations fail upon error.
Reported at
<https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00368.html>.

* guix/profiles.scm (info-dir-file)[build]: Add explicit call to
'exit'.
* guix/profiles.scm (ghc-package-cache-file)[build]: Likewise.
* guix/profiles.scm (xdg-desktop-database)[build]: Likewise.
* guix/profiles.scm (xdg-mime-database)[build]: Likewise.
2016-06-12 23:54:00 +02:00
宋文武 963521a380
profiles: manifest-lookup-package: Correctly handle package entries.
* guix/profiles.scm (manifest-lookup-package): Consider the package entry
in addition to its 'package-transitive-inputs'.
2016-06-11 11:05:18 +08:00
宋文武 359f06aac8
profiles: xdg-mime-database: Union the "share/mime/packages" directory.
* guix/profiles.scm (xdg-mime-database): Call 'union-build' for the
"share/mime/packages" directory of inputs.
2016-06-11 11:03:31 +08:00
Ludovic Courtès e4c7a5f7c8
publish: Add '--ttl'.
* guix/scripts/publish.scm (show-help, %options): Add --ttl.
(render-narinfo): Add #:ttl and honor it.
(make-request-handler): Add #:narinfo-ttl and honor it.
(run-publish-server): Likewise.
(guix-publish): Honor --ttl, pass it to 'run-publish-server'.
2016-06-09 23:34:56 +02:00
Ludovic Courtès 638c5b7939
ui: 'string->duration' supports hours and seconds.
* guix/ui.scm (string->duration): Add seconds and hours.
* tests/ui.scm ("duration, 1 second"): New test.
2016-06-09 23:34:56 +02:00
Ludovic Courtès 93961f0298
publish: Encore URIs that appear in narinfos.
Fixes <http://bugs.gnu.org/21888>.
Reported by iyzsong@member.fsf.org (宋文武).

* guix/scripts/publish.scm (narinfo-string): Use
'encode-and-join-uri-path' instead of 'string-append' to compute URL.
* tests/publish.scm ("/*.narinfo with properly encoded '+' sign"):
("/nar/ with properly encoded '+' sign"): New tests.
2016-06-08 19:07:58 +02:00
Ludovic Courtès dc794a7238
gnu-maintenance: Replace 'find-packages' with 'find-package' (singular).
Fixes <http://bugs.gnu.org/23718>.
Reported by Efraim Flashner <efraim@flashner.co.il>.

* guix/gnu-maintenance.scm (find-packages): Remove.
(find-package): New procedure.
* guix/import/gnu.scm (gnu->guix-package): Use 'find-package' instead of
'find-packages' and adjust accordingly.
2016-06-08 19:07:58 +02:00
Ludovic Courtès aeafff536f
Merge branch 'master' into core-updates 2016-06-07 11:54:03 +02:00
Ludovic Courtès f82c58539e
bournish: Allow compilation of multiple expressions.
* guix/build/bournish.scm (%bournish-language): Add a joiner to SCHEME.
Compile only to Scheme.
* tests/bournish.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
2016-06-06 18:14:52 +02:00
Ludovic Courtès 8bebe00a76
bournish: Handle EOF in the reader.
* guix/build/bournish.scm (read-bournish): Add case for EOF.
2016-06-06 18:14:52 +02:00
Ludovic Courtès 40d71e44f5
profiles: 'profile-derivation' now honors #:system.
Fixes <http://bugs.gnu.org/23682>.
Reported by Ander GM <anthk@openmailbox.org>.

* guix/profiles.scm (profile-derivation): Pass #:system to
'gexp->derivation'.
* tests/guix-environment.sh: Add 'guix environment -s' test.
2016-06-05 00:05:38 +02:00
Ludovic Courtès 405d043ddd
import: github: Tiny cosmetic change.
* guix/import/github.scm (find-extension): Use a one-argument lambda.
2016-05-31 23:38:51 +02:00
Efraim Flashner b93efac026
import github: Add to extension list.
* guix/import/github.scm (find-extension): Add '.tgz' extension.
2016-05-31 22:05:44 +03:00
Ludovic Courtès 0a40626fd2
offload: Use (guix build syscalls).
This is a followup to 4e0ea3eb28.

* guix/scripts/offload.scm: Use (guix build syscalls).
2016-05-31 18:22:14 +02:00
Efraim Flashner 552ffa021c
download: Update CPAN mirrors.
* guix/download.scm (mirrors)[cpan]: Add to mirror list.
2016-05-31 00:05:54 +03:00
David Thompson 578b96af69 build: emacs: Handle sources that are a single elisp file.
* guix/build/emacs-build-system.scm (gnu:unpack)
(store-file->elisp-source-file, unpack): New procedures.
(%standard-phases): Use the new unpack procedure.
2016-05-30 10:48:44 -04:00
Efraim Flashner 321dc4dfe4
download: Update Sourceforge mirrors.
* guix/download.scm (mirrors)[sourceforge]: Update mirror list.
2016-05-30 12:09:13 +03:00
Ludovic Courtès 870bf71eb0
cve: Use a more compact format for the list of package/versions.
On a warm cache, "guix lint -c cve vorbis-tools" goes down
from 6.5s to 2.4s.

* guix/cve.scm (cpe->package-name): Change to return two values instead
of a pair.
(cpe->product-alist): New procedure.
(%parse-vulnerability-feed): Use it instead of 'filter-map'.
(fetch-vulnerabilities): Bump sexp format version to 1.
(vulnerabilities->lookup-proc): Adjust accordingly.  When #:version is
omitted, return a list of vulnerabilities instead of a list of
version/vulnerability pairs.
* tests/cve.scm (%expected-vulnerabilities)
("vulnerabilities->lookup-proc): Adjust accordingly.
2016-05-28 01:07:12 +02:00
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 bc73a84398
Merge branch 'master' into core-updates 2016-05-23 15:02:26 +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
Leo Famulari eb74eb4199
Merge branch 'master' into core-updates 2016-05-13 02:08:11 -04: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
Mathieu Lirzin c3052d6bcd Merge branch 'master' into core-updates 2016-05-02 17:53:40 +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
宋文武 6c06b1fdac profiles: Add xdg-mime-database hook.
* guix/profiles.scm (xdg-mime-database): New function.
(%default-profile-hooks): Add it.
2016-05-02 22:06:46 +08:00
宋文武 842cb82097 profiles: Add xdg-desktop-database hook.
* guix/profiles.scm (xdg-desktop-database): New function.
(%default-profile-hooks): Add it.
2016-05-02 22:06:46 +08:00
Ludovic Courtès 29d457c209 syscalls: Add 'tcgetattr' and 'tcsetattr' bindings.
* guix/build/syscalls.scm (bits->symbols-body, define-bits)
(local-flags): New macros.
(TCSANOW, TCSADRAIN, TCSAFLUSH): New variables.
(<termios>): New record type.
(%termios): New C structure.
(tcgetattr, tcsetattr): New procedures.
* tests/syscalls.scm ("tcgetattr ENOTTY", "tcgetattr")
("tcsetattr"): New tests.
2016-05-02 22:05:54 +08:00
Ludovic Courtès ba369abe58 syscalls: Implement arrays in 'define-c-struct' and use it.
* guix/build/syscalls.scm (sizeof*, alignof*, write-type, read-type):
Add support for (array ...) forms.
* guix/build/syscalls.scm (<file-system>)[spare0, spare1]: Remove.
[spare]: New field.
* guix/build/syscalls.scm (%statfs)[identifier]: Change to (array int 2).
[spare0, spare1]: Remove.
[spare]: New field.
2016-05-02 22:05:54 +08:00
Ludovic Courtès 07857052db syscalls: 'statfs' explicitly binds 'statfs64'.
* guix/build/syscalls.scm (statfs): Explicitly bind "statfs64".
2016-05-02 22:05:52 +08:00
Ludovic Courtès e19eb93b85 syscalls: statfs: Add missing 'mount-flags' field of 'struct statfs'.
* guix/build/syscalls.scm (<file-system>)[mount-flags]: New field.
[spare2]: Remove.
(%statfs): Likewise.
2016-05-02 22:05:52 +08:00
Ludovic Courtès ae4ff9f359
syscalls: Add 'tcgetattr' and 'tcsetattr' bindings.
* guix/build/syscalls.scm (bits->symbols-body, define-bits)
(local-flags): New macros.
(TCSANOW, TCSADRAIN, TCSAFLUSH): New variables.
(<termios>): New record type.
(%termios): New C structure.
(tcgetattr, tcsetattr): New procedures.
* tests/syscalls.scm ("tcgetattr ENOTTY", "tcgetattr")
("tcsetattr"): New tests.
2016-05-02 00:05:36 +02:00
Ludovic Courtès 00cd41974e
syscalls: Implement arrays in 'define-c-struct' and use it.
* guix/build/syscalls.scm (sizeof*, alignof*, write-type, read-type):
Add support for (array ...) forms.
* guix/build/syscalls.scm (<file-system>)[spare0, spare1]: Remove.
[spare]: New field.
* guix/build/syscalls.scm (%statfs)[identifier]: Change to (array int 2).
[spare0, spare1]: Remove.
[spare]: New field.
2016-05-02 00:05:36 +02:00
Ludovic Courtès 96f2a432bf
syscalls: 'statfs' explicitly binds 'statfs64'.
* guix/build/syscalls.scm (statfs): Explicitly bind "statfs64".
2016-04-30 23:40:42 +02:00
Ludovic Courtès 200dac0654
syscalls: statfs: Add missing 'mount-flags' field of 'struct statfs'.
* guix/build/syscalls.scm (<file-system>)[mount-flags]: New field.
[spare2]: Remove.
(%statfs): Likewise.
2016-04-30 23:40:42 +02:00
Ludovic Courtès 4c0416ae17
guix system: Reduce size of image produced for 'vm' action.
This reduces the size of the image produced by 'guix system vm' from
26 MiB to 9 MiB.

* gnu/system/vm.scm (system-qemu-image/shared-store):
(system-qemu-image/shared-store-script): Change the default
value of #:disk-image-size to 30 MiB when not FULL-BOOT?.
* guix/scripts/system.scm (system-derivation-for-action): Likewise for
the 'vm' action.
2016-04-29 18:05:44 +02:00
Ludovic Courtès 5c6a062d48
lint: 'check-vulnerabilities' follows package replacements.
* guix/scripts/lint.scm (check-vulnerabilities): Check the replacement
of PACKAGE.
* tests/lint.scm ("cve: patched vulnerability in replacement"): New test.
2016-04-28 18:03:01 +02:00
Ludovic Courtès a17417a812
challenge: Use exit code 2 when discrepancies are found.
Suggested by John Darrington <john@darrington.wattle.id.au>.

* guix/scripts/challenge.scm (guix-challenge): Exit with 2 when MISSING
is not empty.
* doc/guix.texi (Invoking guix challenge): Document it.
2016-04-27 23:35:39 +02:00
Ludovic Courtès 20be23c3b6
lint: Report synopses/descriptions that are not strings.
Suggested by John Darrington.

* guix/scripts/lint.scm (check-description-style): Emit a warning when
DESCRIPTION is not a string.
(check-synopsis-style): Likewise.
(check-gnu-synopsis+description): Likewise.
* tests/lint.scm ("description: not a string", "synopsis: not a
string"): New tests.
2016-04-27 11:57:48 +02:00
Eric Bavier b77d17d023 import: cpan: check version bounds on core modules.
Modules may be removed from Perl's core, so we must check for a removal
version.

* guix/import/cpan.scm (cpan-module->sexp)[core-module?]: Also check
version upper bound.
2016-04-25 18:31:45 -05:00
Ludovic Courtès 5cd25aad3c
syscalls: 'terminal-columns' catches EINVAL on the TIOCGWINSZ ioctl.
Reported by Mark H Weaver <mhw@netris.org>.

* guix/build/syscalls.scm (terminal-columns): Tolerate EINVAL.
* tests/syscalls.scm ("terminal-window-size ENOTTY"): Likewise.
2016-04-25 23:34:20 +02:00
Ludovic Courtès 0054e47036
guix gc: Add '--free-space'.
* guix/scripts/gc.scm (show-help, %options): Add '--free-space'.
(guix-gc)[ensure-free-space]: New procedure.
Handle '--free-space'.
2016-04-25 23:27:09 +02:00
Ludovic Courtès a1f708787d
syscalls: Add 'statfs'.
* guix/build/syscalls.scm (<file-system>): New record type.
(fsword): New macro.
(%statfs): New C struct.
(statfs): New procedure.
2016-04-25 23:27:09 +02:00
Ludovic Courtès 785cfa8791
syscalls: 'define-c-struct' computes the struct size.
* guix/build/syscalls.scm (struct-alignment, struct-size): New macros.
(define-c-struct): Add 'size' parameter and honor it.
(sockaddr-in, sockaddr-in6, ifaddrs, winsize): Adjust accordingly.
(%struct-ifaddrs-type, %sizeof-ifaddrs, winsize-struct): Remove.
(terminal-window-size): Use 'make-bytevector' instead of 'make-c-struct'.
2016-04-25 23:27:09 +02:00
Ludovic Courtès f77863a09e
syscalls: Second argument of packed-struct read is now optional.
* guix/build/syscalls.scm (define-c-struct)[read]: OFFSET defaults to 0.
(unfold-interface-list): Remove second argument to 'read-ifaddrs'.
(terminal-window-size): Remove second argument to 'read-winsize'.
2016-04-25 23:27:09 +02:00
Ludovic Courtès 73f38d5ff3
syscalls: Move code around [NFC].
* guix/build/syscalls.scm: Move packed structure handling to the top.
2016-04-25 23:27:09 +02:00
Mathieu Lirzin 03d0e2d2b9 build: Move 'Makefile' fragments to subdirectories.
This follows a convention used by some other GNU packages like Autoconf,
Bison, Coreutils, and Gnulib.

* doc.am: Rename to ...
* doc/local.mk: ... this.
* emacs.am: Rename to ...
* emacs/local.mk: ... this.
* gnu-system.am: Rename to ...
* gnu/local.mk: ... this.
* daemon.am: Rename to ...
* nix/local.mk: ... this.
* Makefile.am: Adapt to them.
* doc/guix.texi (Porting to a New Platform): Adapt documentation.
* guix/config.scm.in (%state-directory, %config-directory): Adapt comments.
* emacs/guix-config.el.in (guix-config-state-directory): Likewise.
2016-04-21 18:47:50 +02:00
Ludovic Courtès 85fc958d9b substitute: Sanitize the client-provided column number.
* guix/scripts/substitute.scm (client-terminal-columns): Sanitize the
client's column number.
2016-04-20 23:21:49 +02:00
Ludovic Courtès 38f50f49f3 substitute: Install the client's locale.
* guix/store.scm (set-build-options): Add #:locale parameter and honor
it.
* guix/scripts/substitute.scm (guix-substitute): Install the client's
locale.
2016-04-20 23:16:47 +02:00
Ludovic Courtès f954c9b5da substitute: Internationalize signature and download messages.
* guix/scripts/substitute.scm (assert-valid-narinfo): Use gettext for
messages.
2016-04-20 23:16:02 +02:00
Ludovic Courtès cf5e58297d substitute: Better abbreviate substitute URL in progress report.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>.

* guix/build/download.scm (nar-uri-abbreviation): New procedure.
* guix/scripts/substitute.scm (process-substitution): Use it instead of
'store-path-abbreviation'.
2016-04-20 23:01:41 +02:00
Ludovic Courtès 3e31ec827a download: 'uri-abbreviation' can abbreviate the URI's basename.
* guix/build/download.scm (uri-abbreviation): Use 'ellipsis' instead of
"...".  Abbreviate the basename of PATH if needed.
2016-04-20 22:52:35 +02:00
Ludovic Courtès 967ee481e8 download: Add "%COMPAT" to the priority string.
Fixes <http://bugs.gnu.org/23311>.

* guix/build/download.scm (tls-wrap): Add 'set-session-priorities!' call.
2016-04-20 13:17:52 +02:00
Mark H Weaver 4f8cede062 syscalls: If a syscall is not available, defer the error.
* guix/build/syscalls.scm (syscall->procedure): New procedure.
  (mount, umount, swapon, swapoff, clone, pivot-root): Use it.
  (clone): Add case for nonexistent syscall id.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-04-18 19:36:31 +02:00
Ludovic Courtès dd1d09f7e4 utils: 'cache-directory' gracefully deals with unset 'HOME'.
Fixes <http://bugs.gnu.org/23165>.

* guix/utils.scm (cache-directory): Use 'getpwuid' when 'HOME' is unset.
2016-04-18 19:26:34 +02:00
Ludovic Courtès 6d2b43915f syscalls: 'terminal-columns' ignores non-file ports.
* guix/build/syscalls.scm (terminal-columns): Call
'terminal-window-size' only when PORT is a file port.
* tests/syscalls.scm ("terminal-columns non-file port"): New test.
2016-04-16 00:52:19 +02:00
Ludovic Courtès b0a6a97130 substitute: Honor the number of columns of the client terminal.
* guix/store.scm (set-build-options): Add #:terminal-columns parameter
and honor it.
* guix/scripts/substitute.scm (client-terminal-columns): New procedure.
(guix-substitute): Use it to parameterize 'current-terminal-columns'.
2016-04-15 00:32:18 +02:00
Ludovic Courtès cc44fbb8d9 guix download: Honor the number of columns of the terminal.
* guix/scripts/download.scm (guix-download): Parameterize
'current-terminal-columns'.
2016-04-15 00:32:18 +02:00
Ludovic Courtès 9703fef415 ui: Use 'terminal-columns'.
* guix/ui.scm (%text-width): Default to (terminal-columns).
2016-04-15 00:32:18 +02:00
Ludovic Courtès 069d43a765 ui: 'package->recutils' accurately honors the number of columns.
* guix/ui.scm (package->recutils)[width*]: New variable.  Use it instead
of WIDTH.
2016-04-15 00:32:18 +02:00
Ludovic Courtès 29ff6d9fcc syscalls: Add TIOCGWINSZ bindings.
* guix/build/syscalls.scm (TIOCGWINSZ): New macro.
(<window-size>): New record type.
(winsize): New C struct.
(winsize-struct): New variable.
(terminal-window-size, terminal-columns): New procedures.
2016-04-15 00:32:18 +02:00
Ludovic Courtès 4d276c6403 download: Add 'current-terminal-columns' parameter.
* guix/build/download.scm (current-terminal-columns): New variable.
(progress-proc): Use it instead of the hard-coded "80".
2016-04-15 00:32:18 +02:00
Ludovic Courtès 8a2154fefa download: Send an ANSI erase-in-line sequence in addition to CR.
Partly fixes <http://bugs.gnu.org/22536>.
Reported by Danny Milosavljevic <dannym@scratchpost.org>.

* guix/build/download.scm (progress-proc): Send an ANSI erase-in-line
sequence.
2016-04-15 00:32:18 +02:00
Ludovic Courtès 63e8bb12a4 gnu-maintenance: Move FTP directory info to 'properties' fields.
* guix/gnu-maintenance.scm (ftp-server/directory): Rewrite to honor
PACKAGE's properties.  Remove list of quirks.
(releases): Add #:server and #:directory parameters.  Remove call
to 'ftp-server/directory'.
(latest-release): Likewise.
(latest-release*): Add call to 'ftp-server/directory'.  Honor
'upstream-name' property of PACKAGE.
* gnu/packages/fonts.scm (font-gnu-freefont-ttf): Add 'properties'
field.
* gnu/packages/gnupg.scm (libgpg-error, libgcrypt, libassuan):
(libksba, gnupg): Likewise.
* gnu/packages/gnuzilla.scm (icecat): Likewise.
* gnu/packages/package-management.scm (guix-0.10.0): Likewise.
* gnu/packages/pretty-print.scm (source-highlight): Likewise.
* gnu/packages/scheme.scm (mit-scheme): Likewise.
* gnu/packages/telephony.scm (ucommon): Likewise.
* gnu/packages/tls.scm (gnutls): Likewise.
2016-04-15 00:32:18 +02:00
Ludovic Courtès 444bb0d857 gnu-maintenance: Recognize source tarball with "-src" in their name.
* guix/gnu-maintenance.scm (tarball->version): Add special case for
tarball names containing "-src".
2016-04-15 00:32:18 +02:00
Ludovic Courtès 7d27a0259b upstream: Pass a package object to updaters.
* guix/upstream.scm (package-update-path): Pass PACKAGE to
'latest-release'.
* guix/gnu-maintenance.scm (latest-release*)
(latest-gnome-release, latest-xorg-release): Adjust accordingly.
* guix/import/cran.scm (latest-cran-release):
(latest-bioconductor-release): Likewise.
* guix/import/elpa.scm (latest-release): Likewise.
* guix/import/gem.scm (latest-release): Likewise.
* guix/import/github.scm (latest-release): Likewise.
* guix/import/hackage.scm (latest-release): Likewise.
* guix/import/pypi.scm (latest-release): Likewise.
2016-04-15 00:32:18 +02:00
Danny Milosavljevic 013c3fb8c7 lint: Emit an ANSI erase-in-line sequence.
* guix/scripts/lint.scm (run-checkers): Add '\x1b[K' to progress
messages and after 'for-each'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-04-14 10:20:14 +02:00
Alex Kost 82fd23b81f download: Follow HTTP 307 "Temporary Redirection".
Fixes <http://bugs.gnu.org/23275>.
Reported by Albin Söderqvist <albin@fripost.org>.

* guix/build/download.scm (http-fetch): Follow redirections upon 307.
  This is what 'binaries.openttd.org' does.
2016-04-14 10:34:37 +03:00
宋文武 2b8e9d9ed4 gnu-maintenance: update-package-source: Only update the desired package.
Fixes <http://bugs.gnu.org/22693>.
Suggested by Andy Wingo.

* guix/upstream.scm (update-package-source): Rewrite in terms of 'edit-expression'.
2016-04-13 09:17:01 +08:00
宋文武 f7df1e3efb utils: Add 'location->source-properties'.
* guix/utils (location-source->properties): New procedure.
2016-04-13 09:17:01 +08:00
宋文武 50a3d59473 utils: Add 'edit-expression'.
* guix/utils.scm (edit-expression): New procedure.
* tests/utils.scm (edit-expression): New test.
2016-04-13 09:16:54 +08:00
David Thompson fe463dbcf7 environment: container: Work around read-only /etc/resolv.conf issue.
* guix/scripts/environment.scm (launch-environment/container): Mount
/etc/resolv.conf as a writable file.
2016-04-07 11:48:31 -04:00
Ludovic Courtès 7cffaeb604 challenge: Really exit with non-zero upon hash mismatch.
Reported by John Darrington.

* guix/scripts/challenge.scm (guix-challenge): Add an explicit 'exit'
call when ISSUES is empty.
* scripts/guix.in: Add comment about 'exit'.
* doc/guix.texi (Invoking guix challenge): Mention the behavior and exit
code.
2016-04-06 23:21:26 +02:00
Ludovic Courtès 933d2fe4cf Merge branch 'master' into core-updates 2016-04-06 12:00:29 +02:00
Alex Kost 5f2928456b emacs: Use 'build-and-use-profile' from (guix scripts package).
* guix/scripts/package.scm: Export 'build-and-use-profile'.
* emacs/guix-main.scm (process-package-actions): Use it.
2016-04-04 20:11:22 +03:00
Ludovic Courtès 8463d1345e graph: Edges are colored based on their source node.
* guix/graph.scm (%colors): New variable.
(pop-color): New procedure.
(emit-edge): Use it.
2016-04-02 22:40:18 +02:00
Ludovic Courtès f4033fb5da cvs: Disable compression.
Reported by Jan Nieuwenhuizen <janneke@gnu.org>.

* guix/build/cvs.scm (cvs-fetch): Use -z0.
2016-04-01 00:05:42 +02:00
Jan Nieuwenhuizen ab83105bbe cvs: Allow checkouts when /tmp is a different device.
* guix/build/cvs.scm (cvs-fetch): Use 'copy-recursively' instead of
'rename-file'.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2016-04-01 00:05:42 +02:00
Ludovic Courtès 97425486ee profiles: Use the right 'package-name->name+version'.
* guix/profiles.scm: Use 'package-name->name+version' from (guix build
utils).  Fixes 'find-among-store-items' in 'gtk-icon-themes'.
2016-04-01 00:05:42 +02:00
Ricardo Wurmus 9941e0812e ant-build-system: Keep jar manifest.
* guix/build/ant-build-system.scm (default-build.xml): Generate default
manifest.
(strip-jar-timestamps): Repack jar archive with zip.
2016-03-31 15:47:39 +02:00
Ricardo Wurmus ab50bba9f6 build-system/ant: Add zip.
* guix/build-system/ant.scm (default-zip): New variable.
(lower): Add zip to native inputs.
2016-03-31 15:47:32 +02:00
Ricardo Wurmus cb6ce89e21 build-system/r: Support "substitutable?" flag.
* guix/build-system/r.scm (r-build): Support the "substitutable?" flag.
2016-03-31 15:47:19 +02:00
Leo Famulari dcd19c0af8 licenses: Add the nmap license.
* guix/licenses.scm (nmap): New variable.
2016-03-31 01:40:30 -04:00
Eric Bavier 42efe27a30 import: Add Hackage updater.
* guix/import/hackage.scm (guix-package->hackage-name, hackage-package?)
  (latest-release): New procedures.
  (%hackage-updater): New variable.
* guix/scripts/refresh.scm (%updaters): Add it.
* doc/guix.texi (Invoking guix refresh): Mention it.
2016-03-30 23:19:24 -05:00
Eric Bavier 2ae9c63f15 import: hackage: Silence download output.
* guix/import/hackage.scm (hackage-fetch): Use http-fetch to avoid
  progress output from url-fetch.
2016-03-30 23:19:24 -05:00
Eric Bavier f9ea74ad04 import: hackage: Factorize url synthesis.
* guix/import/hackage.scm (hackage-source-url, hackage-cabal-url): New
  procedures.
  (hackage-fetch, hackage-module->sexp): Use them.
2016-03-30 23:19:24 -05:00
Ludovic Courtès 3bd9672c85 ui: Add comment on the translation of "current".
* guix/ui.scm (display-generation): Add "TRANSLATORS" comment.
2016-03-30 23:39:47 +02:00
David Thompson aa2a0d4bb8 environment: Set a default value for PS1.
* guix/scripts/environment.scm (launch-environment/container): Set PS1
  during container initialization.
2016-03-30 09:09:40 -04:00
Ludovic Courtès 7f949db03e guix system: Warn against missing 'guix pull'.
Suggested by Leo Famulari and others.

* guix/scripts/system.scm (maybe-suggest-running-guix-pull): New
procedure.
(perform-action): Call it when ACTION is 'reconfigure.
2016-03-28 22:50:25 +02:00
Ludovic Courtès d70533cbe9 store: Prepend mirror.hydra.gnu.org to %DEFAULT-SUBSTITUTE-URLS.
This allows GuixSD to default to the right list of URLs, with
mirror.hydra.gnu.org coming first.

Reported by Chris Marusich <cmmarusich@gmail.com>.

* guix/store.scm (%default-substitute-urls): Prepend
"mirror.hydra.gnu.org."
2016-03-28 22:25:42 +02:00
David Thompson 13bc8d5e4f environment: Properly handle SIGINT.
Switching to execlp means that the process spawned in a container is PID
1, which obsoleted one of the 'guix environment --container' tests
because the init process can't be killed in the usual manner.

* guix/scripts/environment.scm (launch-environment/fork): New procedure.
(launch-environment): Switch from system* to execlp.  Add handler for
SIGINT.
(guix-environment): Use launch-environment/fork.
* tests/guix-environment-container.sh: Replace abnormal exit test with
one that works now that the spawned process is PID 1.
2016-03-27 15:09:21 -04:00
David Thompson a01ad63893 environment: container: Create dummy home directory and /etc/passwd.
* guix/scripts/environment.scm (launch-environment/container): Change
$HOME to the current user's home directory instead of
/homeless-shelter.  Create a dummy /etc/passwd with a single entry for
the current user.
* doc/guix.texi ("invoking guix environment"): Add a note about the
dummy home directory and /etc/passwd.
2016-03-26 09:38:27 -04:00
Ludovic Courtès 001dae0d74 syscalls: <interface> printer correctly handles lack of sockaddr.
Reported by Danny Milosavljevic <dannym@scratchpost.org>
in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22612#16>.

* guix/build/syscalls.scm (write-interface): Check whether ADDRESS is
true.
2016-03-25 17:24:47 +01:00
Ludovic Courtès 9a2a20052a guix build: '--with-source' correctly matches versioned file names.
* guix/scripts/build.scm: Use the right 'package-name->name+version'
procedure.  Fixes a regression introduced in
1b846da8c3.
* tests/scripts-build.scm ("options->transformation, with-source, with
version"): New test.
2016-03-23 23:43:50 +01:00
Ludovic Courtès d26e19671e derivations: Raise an error when a module file is not found.
Suggested by Jookia.

* guix/derivations.scm (&file-search-error): New error condition.
(search-path*): Raise it when 'search-path' returns #f.
* guix/gexp.scm (search-path*): Remove.
* guix/ui.scm (call-with-error-handling): Add case for
'file-search-error?'.
* tests/derivations.scm ("build-expression->derivation and invalid
module name"): New test.
2016-03-23 00:23:12 +01:00
Ludovic Courtès 6985335faa derivations: Add 'module->source-file-name'.
* guix/derivations.scm (module->source-file-name): New procedure.
(%imported-modules): Use it.
* guix/gexp.scm (imported-modules): Likewise.
2016-03-23 00:23:12 +01:00
Ludovic Courtès 8c321299c5 substitute: Gracefully handle TLS errors.
* guix/scripts/substitute.scm (with-networking): Use 'match-lambda*' and
add case for 'gnutls-error'.
2016-03-23 00:23:12 +01:00
Ricardo Wurmus b98293ebed import: cran: Accept single URL in addition to single URL.
* guix/import/cran.scm (package->upstream-name): Match single URL in
  addition to list of URLs.
2016-03-22 17:57:40 +01:00
Leo Famulari 09ec508a4c Merge branch 'master' into core-updates 2016-03-21 12:22:31 -04:00
Ludovic Courtès 55e1f25d89 build-system/gnu: Add #:disallowed-references.
* guix/build-system/gnu.scm (gnu-build): Add #:disallowed-references and
honor it.
(gnu-cross-build): Likewise.
2016-03-20 22:46:45 +01:00
Ludovic Courtès 3f4ecf3229 gexp: Add #:disallowed-references.
* guix/gexp.scm (gexp->derivation): Add #:disallowed-references and
honor it.
* tests/gexp.scm ("gexp->derivation #:disallowed-references, allowed")
("gexp->derivation #:disallowed-references"): New tests.
* doc/guix.texi (G-Expressions): Adjust accordingly.
2016-03-20 22:46:14 +01:00
Ludovic Courtès 35b5ca7869 derivations: Add #:disallowed-references.
* guix/derivations.scm (derivation): Add #:disallowed-references.
[user+system-env-vars]: Honor it.
(build-expression->derivation): Likewise.
* tests/derivations.scm ("derivation #:disallowed-references, ok")
("derivation #:disallowed-references, not ok"): New tests.
* doc/guix.texi (Derivations): Adjust accordingly.
2016-03-20 22:45:35 +01:00
Ludovic Courtès 522773b700 import: pypi: Emit 'pypi-uri' only when it yields the right URL.
Fixes <http://bugs.gnu.org/23062>.
Reported by Danny Milosavljevic <dannym@scratchpost.org>.

* guix/import/pypi.scm (make-pypi-sexp): Check whether 'pypi-uri'
returns SOURCE-URL and fall back to the full URL otherwise.
* tests/pypi.scm ("pypi->guix-package"): Adjust expected URI
accordingly.

Co-authored-by: Danny Milosavljevic <dannym@scratchpost.org>
2016-03-19 23:54:19 +01:00
Ludovic Courtès b879b3e848 substitute: Do not leak file descriptors for TLS connections.
Partially fixes <http://bugs.gnu.org/20145>.

* guix/scripts/substitute.scm (fetch, download-cache-info):
(http-multiple-get, fetch-narinfos, progress-report-port): Use
'close-connection' instead of 'close-port'.
2016-03-17 23:53:53 +01:00
Ludovic Courtès 958fb14cdb substitute: Cache transient HTTP errors for 10mn.
* guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]:
Cache transient errors for 10mn.
(%narinfo-transient-error-ttl): New variable.
2016-03-17 23:53:53 +01:00
Ludovic Courtès 14d6ca3e4d lint: Do not leak file descriptors for TLS connections.
Partially fixes <http://bugs.gnu.org/20145>.

* guix/scripts/lint.scm (probe-uri): Use 'close-connection' instead of
'close-port'.
2016-03-17 23:53:53 +01:00
Ludovic Courtès 097a951e96 download: Add 'close-connection'.
Partially fixes <http://bugs.gnu.org/20145>.

* guix/build/download.scm (add-weak-reference): Remove.
(%tls-ports): New variable.
(register-tls-record-port): New procedure.
(tls-wrap): Use it instead of 'add-weak-reference'.
(close-connection): New procedure.
2016-03-17 23:53:53 +01:00
Ludovic Courtès fc3ea24bf4 substitute: Update progress for responses different from 200/404.
* guix/scripts/substitute.scm (fetch-narinfos)[handle-narinfo-response]:
Add missing call to 'update-progress!'.
2016-03-17 23:53:53 +01:00
Roel Janssen f88ce395e6 licenses: Add Apache Software License 1.1.
* guix/licenses.scm (asl1.1): New variables.

Signed-off-by: Leo Famulari <leo@famulari.name>
2016-03-17 00:49:30 -04:00
Ludovic Courtès 71e2065a38 substitute: Honor client-provided empty URL list.
Before that, 'guix build --substitute-urls=""' would lead to using the
daemon's own URL list instead of the empty list.  The 'or*' hack, which
is to blame, had become unnecessary since commit
fb4bf72be3.

Reported by Mark H Weaver <mhw@netris.org>.

* guix/scripts/substitute.scm (or*): Remove.
(%cache-urls): Use 'or' instead of 'or*'.
* tests/store.scm ("substitute query, alternating URLs"): Add test with
empty URL list.
* doc/guix.texi (Common Build Options): Mention the empty string.
2016-03-16 18:34:53 +01:00
Ludovic Courtès 23d60ba65c substitute: Honor the 'max-age' of 'Cache-Control' headers.
This allows substitute servers to tell 'guix substitute' how long they
can cache narinfo lookups.

* guix/scripts/substitute.scm (cache-narinfo!): Add 'ttl' parameter.
[cache-entry]: Honor it.
(fetch-narinfos)[handle-narinfo-response]: Check the 'Cache-Control'
header of RESPONSE and pass its 'max-age' value to 'cache-narinfo!'.
2016-03-16 15:57:47 +01:00
Ludovic Courtès 1cf7e31898 substitute: Make room for a 'ttl' field in cached entries.
* guix/scripts/substitute.scm (cached-narinfo): Expect 'narinfo' sexp
version 2 with a 'ttl' field.
(cache-narinfo!)[cache-entry]: Produce 'narinfo' sexp version 2 with a
'ttl' field.
(remove-expired-cached-narinfos)[expired?]: Read 'narinfo' sexp version 2.
2016-03-16 15:57:47 +01:00
Ludovic Courtès df061d079b build: Default to "https://mirror.hydra.gnu.org/" for substitutes.
* config-daemon.ac: Check for (gnutls) and define 'GUIX_SUBSTITUTE_URLS'.
* nix/nix-daemon/guix-daemon.cc (main): Use GUIX_SUBSTITUTE_URLS.
* guix/store.scm (%default-substitute-urls): Use 'https' when (gnutls)
is available.
* doc/guix.texi (Binary Installation): Mention mirrors
(Invoking guix-daemon): Mention mirror.hydra.gnu.org.
(Substitutes): Mention mirrors.
(Invoking guix archive): Show https URLs.
2016-03-16 11:27:37 +01:00
Ludovic Courtès 409e4ac6e3 http-client: No 'setvbuf' for non-file ports.
* guix/http-client.scm (http-fetch): Do not call 'setvbuf' on non-file
ports.
2016-03-16 11:27:37 +01:00
Ludovic Courtès 264fdedb40 grafts: Update the narinfo cache before building a derivation.
* guix/grafts.scm (references-oracle)[references*]: Add call to
'substitution-oracle'.
2016-03-14 23:34:33 +01:00
Ludovic Courtès 026ca50fa4 substitute: Keep the initial connection alive.
The connection used to fetch /nix-cache-info is now reused for the
subsequent narinfo requests.

* guix/scripts/substitute.scm (download-cache-info)[download]: Remove.
[uri, read-cache-info]: New variables.
Rewrite in terms of 'http-fetch' instead of 'fetch'.  Return an open
port in addition to a <cache-info>.
* guix/scripts/substitute.scm (http-multiple-get): Add #:port parameter
and honor it.
(fetch-narinfos)[do-fetch]: Add 'port' parameter.
Adjust to new 'download-cache-info' and 'do-fetch' signatures.
2016-03-14 23:34:33 +01:00
Ludovic Courtès d262a0f36b http-client: Add #:keep-alive? parameter.
* guix/http-client.scm (http-fetch): Add #:keep-alive? parameter and
pass it to 'http-get' or 'http-get*'.
2016-03-14 23:34:33 +01:00
Ludovic Courtès cc27dbcf4a substitute: Remove dead code.
This parameter became unused with the switch to HTTP pipelining in
commit d3a652037e.

* guix/scripts/substitute.scm (fetch): Remove #:quiet-404? and adjust
accordingly.
2016-03-14 23:34:33 +01:00
Ludovic Courtès f09aea1b58 store: 'references/substitutes' caches its results.
* guix/store.scm (%reference-cache): New variable.
(references/substitutes): Use it.
2016-03-14 23:34:33 +01:00
Ludovic Courtès 3667bb6cb0 size: Disable grafts.
* guix/scripts/size.scm (guix-size): Parametrize '%graft?'.
2016-03-14 23:34:33 +01:00
Ricardo Wurmus 5f7a1a4def build: Add Ant build system.
* guix/build-system/ant.scm: New file.
* guix/build/ant-build-system: New file.
* Makefile.am (MODULES): Add new files.
* doc/guix.texi (Build Systems): Document ant-build-system.
2016-03-14 12:36:49 +01:00
Ludovic Courtès 6a25e59514 cve: Read entire CVE databases for the current year and the past year.
The "Modified" database that we were reading is much smaller, but it
only shows CVEs modified over the past week.

* guix/cve.scm (%now, %current-year, %past-year): New variables.
(yearly-feed-uri): New procedure.
(%cve-feed-uri, %ttl): Remove.
(%current-year-ttl, %past-year-ttl): New variables.
(call-with-cve-port): Add 'uri' and 'ttl' parameters and honor them.
Add 'setvbuf' call.
(current-vulnerabilities)[read-vulnerabilities]: New procedure.
Read from both %LAST-YEAR and %CURRENT-YEAR.
2016-03-11 16:33:50 +01:00
Ludovic Courtès cf557afa2e cve: Make CPE patch level part of the version string.
* guix/cve.scm (%cpe-package-rx): Adjust to account for :PATCH-LEVEL.
(cpe->package-name): Likewise.
2016-03-11 16:33:50 +01:00
Ludovic Courtès ec278439f3 substitute: Optimize HTTP pipelining over TLS.
* guix/scripts/substitute.scm (http-multiple-get): Write the requests
to a bytevector output port before sending them.
2016-03-10 13:55:30 +01:00