From 59688fc4b5cfac3e05610195a47795f5cc15f338 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 18 Sep 2013 17:01:40 +0200 Subject: derivations: 'derivation' and related procedures return a single value. * guix/derivations.scm (derivation->output-path, derivation->output-paths): New procedures. (derivation-path->output-path): Use 'derivation->output-path'. (derivation-path->output-paths): Use 'derivation->output-paths'. (derivation): Accept 'derivation?' objects as inputs. Return a single value. (build-derivations): New procedure. (compiled-modules): Use 'derivation->output-paths'. (build-expression->derivation)[source-path]: Add case for when the input matches 'derivation?'. [prologue]: Accept 'derivation?' objects in INPUTS. [mod-dir, go-dir]: Use 'derivation->output-path'. * guix/download.scm (url-fetch): Adjust to the single-value return. * guix/packages.scm (package-output): Use 'derivation->output-path'. * guix/scripts/build.scm (guix-build): When the argument is 'derivation-path?', pass it through 'read-derivation'. Use 'derivation-file-name' to print out the .drv file names, and to register them. Use 'derivation->output-path' instead of 'derivation-path->output-path'. * guix/scripts/package.scm (roll-back): Adjust to the single-value return. (guix-package): Use 'derivation->output-path'. * guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?' objects instead of .drv file names. * gnu/system/grub.scm (grub-configuration-file): Use 'derivation->output-path' instead of 'derivation-path->output-path'. * gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise. * tests/builders.scm, tests/derivations.scm, tests/packages.scm, tests/store.scm, tests/union.scm: Adjust to the new calling convention. * doc/guix.texi (Defining Packages, The Store, Derivations): Adjust accordingly. --- gnu/system/vm.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gnu/system/vm.scm') diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 192ed1d5a3..68d205d82a 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -206,10 +206,10 @@ (define* (qemu-image store #:key (define input->name+derivation (match-lambda ((name (? package? package)) - `(,name . ,(derivation-path->output-path + `(,name . ,(derivation->output-path (package-derivation store package system)))) ((name (? package? package) sub-drv) - `(,name . ,(derivation-path->output-path + `(,name . ,(derivation->output-path (package-derivation store package system) sub-drv))) ((input (and (? string?) (? store-path?) file)) @@ -361,14 +361,14 @@ (define %pam-services (parameterize ((%guile-for-build (package-derivation store guile-final))) (let* ((bash-drv (package-derivation store bash)) - (bash-file (string-append (derivation-path->output-path bash-drv) + (bash-file (string-append (derivation->output-path bash-drv) "/bin/bash")) (accounts (list (vector "root" "" 0 0 "System administrator" "/" bash-file))) (passwd (passwd-file store accounts)) (shadow (passwd-file store accounts #:shadow? #t)) (pam.d-drv (pam-services->directory store %pam-services)) - (pam.d (derivation-path->output-path pam.d-drv)) + (pam.d (derivation->output-path pam.d-drv)) (populate (add-text-to-store store "populate-qemu-image" (object->string @@ -381,11 +381,11 @@ (define %pam-services (symlink ,pam.d "etc/pam.d") (mkdir-p "var/run"))) (list passwd))) - (out (derivation-path->output-path + (out (derivation->output-path (package-derivation store mingetty))) (getty (string-append out "/sbin/mingetty")) (iu-drv (package-derivation store inetutils)) - (syslogd (string-append (derivation-path->output-path iu-drv) + (syslogd (string-append (derivation->output-path iu-drv) "/libexec/syslogd")) (boot (add-text-to-store store "boot" (object->string -- cgit v1.2.3