From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:48103) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOPFC-0005kW-Lo for guix-patches@gnu.org; Tue, 14 Apr 2020 13:21:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOPFA-0007MI-GY for guix-patches@gnu.org; Tue, 14 Apr 2020 13:21:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:51403) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOPF9-0007L3-Cn for guix-patches@gnu.org; Tue, 14 Apr 2020 13:21:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jOPF9-0006bg-9W for guix-patches@gnu.org; Tue, 14 Apr 2020 13:21:03 -0400 Subject: [bug#40629] [PATCH 4/5] scripts/build: options->things-to-build: Handle .json files. Resent-Message-ID: From: Ricardo Wurmus Message-ID: <20200414171959.3428-4-rekado@elephly.net> Date: Tue, 14 Apr 2020 19:19:58 +0200 In-Reply-To: <20200414171959.3428-1-rekado@elephly.net> References: <20200414171959.3428-1-rekado@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 40629@debbugs.gnu.org Cc: Ricardo Wurmus * guix/scripts/build.scm (options->things-to-build): Handle files that end = on .json. --- guix/scripts/build.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 79bd84a1a0..8ff2fd1910 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 = Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2013 Mark H Weaver ;;; Copyright =C2=A9 2020 Marius Bakke +;;; Copyright =C2=A9 2020 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. ;;; @@ -21,6 +22,7 @@ (define-module (guix scripts build) #:use-module (guix ui) #:use-module (guix scripts) + #:use-module (guix import json) #:use-module (guix store) #:use-module (guix derivations) #:use-module (guix packages) @@ -834,7 +836,10 @@ build---packages, gexps, derivations, and so on." (else (list (specification->package spec))))) (('file . file) - (ensure-list (load* file (make-user-module '())))) + (let ((file (or (and (string-suffix? ".json" file) + (json->scheme-file file)) + file))) + (ensure-list (load* file (make-user-module '()))))) (('manifest . manifest) (map manifest-entry-item (manifest-entries --=20 2.25.1