[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/12: scripts/package: Handle JSON files.
From: |
guix-commits |
Subject: |
05/12: scripts/package: Handle JSON files. |
Date: |
Thu, 16 Apr 2020 17:43:20 -0400 (EDT) |
rekado pushed a commit to branch master
in repository guix.
commit 4f353c485dea4b549a0aabd1c87b0dd03fef4f1e
Author: Ricardo Wurmus <address@hidden>
AuthorDate: Tue Apr 14 18:02:26 2020 +0200
scripts/package: Handle JSON files.
* guix/scripts/package.scm (%options): Support loading from JSON files when
"install-from-file" is used.
---
guix/scripts/package.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index badb1dc..4044583 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2016 Benz Schenk <address@hidden>
;;; Copyright © 2016 Chris Marusich <address@hidden>
;;; Copyright © 2019 Tobias Geerinckx-Rice <address@hidden>
+;;; Copyright © 2020 Ricardo Wurmus <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -33,6 +34,7 @@
#:use-module (guix packages)
#:use-module (guix profiles)
#:use-module (guix search-paths)
+ #:use-module (guix import json)
#:use-module (guix monads)
#:use-module (guix utils)
#:use-module (guix config)
@@ -418,7 +420,10 @@ Install, remove, or upgrade packages in a single
transaction.\n"))
(option '(#\f "install-from-file") #t #f
(lambda (opt name arg result arg-handler)
(values (alist-cons 'install
- (load* arg (make-user-module '()))
+ (let ((file (or (and (string-suffix?
".json" arg)
+ (json->scheme-file
arg))
+ arg)))
+ (load* file (make-user-module '())))
result)
#f)))
(option '(#\r "remove") #f #t
- branch master updated (7b2cb1b -> c9f321e), guix-commits, 2020/04/16
- 01/12: import/print: Return license with prefix., guix-commits, 2020/04/16
- 03/12: import/json: Add json->scheme-file., guix-commits, 2020/04/16
- 07/12: import/print: package->code: Wrap S-expression in definition., guix-commits, 2020/04/16
- 12/12: doc: Document building and installing from JSON files., guix-commits, 2020/04/16
- 05/12: scripts/package: Handle JSON files.,
guix-commits <=
- 10/12: import/utils: alist->package: Include arguments., guix-commits, 2020/04/16
- 02/12: import/print: package->code: Wrap build system value in module reference., guix-commits, 2020/04/16
- 09/12: import/json: json->code: Handle files with more than one definition., guix-commits, 2020/04/16
- 04/12: scripts/build: options->things-to-build: Handle .json files., guix-commits, 2020/04/16
- 06/12: import/json: Use json->code., guix-commits, 2020/04/16
- 11/12: import/print: Don't factorize URI if there's no version match., guix-commits, 2020/04/16
- 08/12: import/utils: alist->package: Ignore known inputs., guix-commits, 2020/04/16