unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Craven <david@craven.ch>
To: guix-devel@gnu.org
Subject: [PATCH 01/12] import: Move json-fetch to (guix import utils).
Date: Thu, 22 Sep 2016 15:18:52 +0200	[thread overview]
Message-ID: <20160922131903.1606-1-david@craven.ch> (raw)

* guix/import/utils.scm (json-fetch): Move json-fetch from
  (guix import json).
---
 guix/import/cpan.scm  |  1 -
 guix/import/gem.scm   |  1 -
 guix/import/json.scm  | 32 --------------------------------
 guix/import/pypi.scm  |  1 -
 guix/import/utils.scm | 12 ++++++++++++
 5 files changed, 12 insertions(+), 35 deletions(-)
 delete mode 100644 guix/import/json.scm

diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 5b7c475..0769064 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -31,7 +31,6 @@
   #:use-module (guix base32)
   #:use-module ((guix download) #:select (download-to-store))
   #:use-module (guix import utils)
-  #:use-module (guix import json)
   #:use-module (guix packages)
   #:use-module (guix derivations)
   #:use-module (gnu packages perl)
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index fc06b0d..b3a50ac 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -26,7 +26,6 @@
   #:use-module (web uri)
   #:use-module ((guix download) #:prefix download:)
   #:use-module (guix import utils)
-  #:use-module (guix import json)
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (guix licenses)
diff --git a/guix/import/json.scm b/guix/import/json.scm
deleted file mode 100644
index c3092a5..0000000
--- a/guix/import/json.scm
+++ /dev/null
@@ -1,32 +0,0 @@
-;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 David Thompson <davet@gnu.org>
-;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
-;;;
-;;; This file is part of GNU Guix.
-;;;
-;;; GNU Guix is free software; you can redistribute it and/or modify it
-;;; under the terms of the GNU General Public License as published by
-;;; the Free Software Foundation; either version 3 of the License, or (at
-;;; your option) any later version.
-;;;
-;;; GNU Guix is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;;; GNU General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU General Public License
-;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
-
-(define-module (guix import json)
-  #:use-module (json)
-  #:use-module (guix utils)
-  #:use-module (guix import utils)
-  #:export (json-fetch))
-
-(define (json-fetch url)
-  "Return an alist representation of the JSON resource URL, or #f on failure."
-  (call-with-temporary-output-file
-   (lambda (temp port)
-     (and (url-fetch url temp)
-          (hash-table->alist
-           (call-with-input-file temp json->scm))))))
diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index 343445a..3f24014 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -38,7 +38,6 @@
                            . hyphen-package-name->name+version)))
   #:use-module (guix import utils)
   #:use-module ((guix download) #:prefix download:)
-  #:use-module (guix import json)
   #:use-module (guix packages)
   #:use-module (guix upstream)
   #:use-module (guix licenses)
diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 93cd0f0..d19a6df 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -1,5 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014 David Thompson <davet@gnu.org>
+;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,6 +27,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix utils)
   #:use-module ((guix build download) #:prefix build:)
+  #:use-module (json)
   #:export (factorize-uri
 
             hash-table->alist
@@ -32,6 +35,7 @@
             assoc-ref*
 
             url-fetch
+            json-fetch
             guix-hash-url
 
             string->license
@@ -148,3 +152,11 @@ into a proper sentence and by using two spaces between sentences."
     ;; Use double spacing between sentences
     (regexp-substitute/global #f "\\. \\b"
                               cleaned 'pre ".  " 'post)))
+
+(define (json-fetch url)
+  "Return an alist representation of the JSON resource URL, or #f on failure."
+  (call-with-temporary-output-file
+   (lambda (temp port)
+     (and (url-fetch url temp)
+          (hash-table->alist
+           (call-with-input-file temp json->scm))))))
-- 
2.9.0

             reply	other threads:[~2016-09-22 13:20 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 13:18 David Craven [this message]
2016-09-22 13:18 ` [PATCH 02/12] import: Reorder imports in (guix import utils) David Craven
2016-09-26  9:31   ` Ludovic Courtès
2016-09-22 13:18 ` [PATCH 03/12] import: Move string->license to importers David Craven
2016-09-26  9:32   ` Ludovic Courtès
2016-09-22 13:18 ` [PATCH 04/12] import: utils: Add spdx-string->license David Craven
2016-09-22 14:56   ` Eric Bavier
2016-09-22 15:15     ` David Craven
2016-09-26  9:33   ` Ludovic Courtès
2016-09-22 13:18 ` [PATCH 05/12] import: utils: Refactor license->symbol David Craven
2016-09-26  9:39   ` Ludovic Courtès
2016-09-22 13:18 ` [PATCH 06/12] import: Add importer for rust crates David Craven
2016-09-26 10:02   ` Ludovic Courtès
2016-09-22 13:18 ` [PATCH 07/12] import: crate: Add crate updater David Craven
2016-09-26 10:09   ` Ludovic Courtès
2016-09-22 13:18 ` [PATCH 08/12] build-system: Add cargo build system David Craven
2016-09-26 10:17   ` Ludovic Courtès
2016-09-26 18:01     ` David Craven
2016-09-30 12:13       ` Ludovic Courtès
2016-09-22 13:19 ` [PATCH 09/12] gnu: Add rust-bootstrap-x86_64-1.12.0 David Craven
2016-09-26 10:18   ` Ludovic Courtès
2016-09-22 13:19 ` [PATCH 10/12] gnu: Add rustc-bootstrap David Craven
2016-09-26 10:24   ` Ludovic Courtès
2016-09-22 13:19 ` [PATCH 11/12] gnu: Add cargo-bootstrap David Craven
2016-09-26 10:28   ` Ludovic Courtès
2016-09-22 13:19 ` [PATCH 12/12] gnu: Add rust helper functions David Craven
2016-09-26 10:29   ` Ludovic Courtès
2016-09-22 14:58 ` [PATCH 01/12] import: Move json-fetch to (guix import utils) Eric Bavier
2016-09-22 15:23   ` David Craven
2016-09-22 16:52     ` Eric Bavier
2016-09-22 16:56       ` David Craven
2016-09-24  5:20         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160922131903.1606-1-david@craven.ch \
    --to=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).