Commit Graph

2087 Commits

Author SHA1 Message Date
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
宋文武 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