From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:45356) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlG9S-0007mZ-Kq for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlG9Q-0003AX-G5 for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55961) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hlG9Q-00039i-3f for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hlG9P-0001DW-UX for guix-patches@gnu.org; Wed, 10 Jul 2019 13:13:03 -0400 Subject: [bug#36578] [PATCH 5/9] derivations: 'map-derivation' uses the new 'derivation' calling convention. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 10 Jul 2019 19:11:24 +0200 Message-Id: <20190710171128.21568-5-ludo@gnu.org> In-Reply-To: <20190710171128.21568-1-ludo@gnu.org> References: <20190710171128.21568-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 36578@debbugs.gnu.org * guix/derivations.scm (map-derivation)[input->output-paths]: Adjust to deal with an argument that's either 'derivation-input?' or a string. [rewritten-input]: Return a or a string. Pass #:inputs and #:sources to 'derivation'. --- guix/derivations.scm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/guix/derivations.scm b/guix/derivations.scm index bd0af320c4..a18478502d 100644 --- a/guix/derivations.scm +++ b/guix/derivations.scm @@ -933,13 +933,10 @@ recursively." (define input->output-paths (match-lambda - (((? derivation? drv)) - (list (derivation->output-path drv))) - (((? derivation? drv) sub-drvs ...) - (map (cut derivation->output-path drv <>) - sub-drvs)) - ((file) - (list file)))) + ((? derivation-input? input) + (derivation-input-output-paths input)) + ((? string? file) + (list file)))) (let ((mapping (fold (lambda (pair result) (match pair @@ -958,11 +955,11 @@ recursively." (($ drv (sub-drvs ...)) (match (vhash-assoc (derivation-file-name drv) mapping) ((_ . (? derivation? replacement)) - (cons replacement sub-drvs)) - ((_ . replacement) - (list replacement)) + (derivation-input replacement sub-drvs)) + ((_ . (? string? source)) + source) (#f - (cons (loop drv) sub-drvs))))))) + (derivation-input (loop drv) sub-drvs))))))) (let loop ((drv drv)) (let* ((inputs (map (cut rewritten-input <> loop) @@ -1001,7 +998,8 @@ recursively." . ,(substitute value initial replacements)))) (derivation-builder-environment-vars drv)) - #:inputs (append (map list sources) inputs) + #:inputs (filter derivation-input? inputs) + #:sources (append sources (filter string? inputs)) #:outputs (derivation-output-names drv) #:hash (match (derivation-outputs drv) ((($ _ algo hash)) -- 2.22.0