summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/egg.scm12
-rw-r--r--guix/import/launchpad.scm15
2 files changed, 17 insertions, 10 deletions
diff --git a/guix/import/egg.scm b/guix/import/egg.scm
index 26f8364732..107894ddcf 100644
--- a/guix/import/egg.scm
+++ b/guix/import/egg.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -173,10 +174,13 @@ return the package metadata in FILE."
;;;
(define* (egg->guix-package name #:key (file #f) (source #f))
- "Import CHICKEN egg NAME from and return a <package> record type for the
-egg, or #f on failure. FILE is the filepath to the NAME.egg file. SOURCE is
-the a ``file-like'' object containing the source code corresonding to the egg.
-If SOURCE is not specified, the tarball for the egg will be downloaded.
+ "Import a CHICKEN egg called NAME from either the given .egg FILE, or from
+the latest NAME metadata downloaded from the official repository if FILE is #f.
+Return a <package> record or #f on failure.
+
+SOURCE is a ``file-like'' object containing the source code corresponding to
+the egg. If SOURCE is not specified, the latest tarball for egg NAME will be
+downloaded.
Specifying the SOURCE argument is mainly useful for developing a CHICKEN egg
locally. Note that if FILE and SOURCE are specified, recursive import will
diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm
index a52b39a085..aeb447b0a5 100644
--- a/guix/import/launchpad.scm
+++ b/guix/import/launchpad.scm
@@ -1,5 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019, 2020 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
+;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -100,8 +102,8 @@ URL of the form
(match (string-split (uri-path (string->uri url)) #\/)
((_ repo . rest) repo)))
-(define (latest-released-version package-name)
- "Return a string of the newest released version name given the PACKAGE-NAME,
+(define (latest-released-version repository)
+ "Return a string of the newest released version name given the REPOSITORY,
for example, 'linuxdcpp'. Return #f if there is no releases."
(define (pre-release? x)
;; Versions containing anything other than digit characters and "." (for
@@ -112,7 +114,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
(match (json-fetch
(string-append "https://api.launchpad.net/1.0/"
- package-name "/releases"))
+ repository "/releases"))
(#f #f) ;404 or similar
(json
(assoc-ref
@@ -121,15 +123,16 @@ for example, 'linuxdcpp'. Return #f if there is no releases."
(define (latest-release pkg)
"Return an <upstream-source> for the latest release of PKG."
- (define (origin-github-uri origin)
+ (define (origin-launchpad-uri origin)
(match (origin-uri origin)
((? string? url) url) ; surely a Launchpad URL
((urls ...)
(find (cut string-contains <> "launchpad.net") urls))))
- (let* ((source-uri (origin-github-uri (package-source pkg)))
+ (let* ((source-uri (origin-launchpad-uri (package-source pkg)))
(name (package-name pkg))
- (newest-version (latest-released-version name)))
+ (repository (launchpad-repository source-uri))
+ (newest-version (latest-released-version repository)))
(if newest-version
(upstream-source
(package name)