GNU bug report logs -
#37322
[PATCH 1/2] adds the capability of importing a specified version to the crate importer
Previous Next
Reported by: Martin Becze <mjbecze <at> riseup.net>
Date: Fri, 6 Sep 2019 15:33:02 UTC
Severity: normal
Tags: patch
Merged with 37323
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Tue, 10 Sep 2019 00:38:50 +0200
with message-id <877e6hxfgl.fsf <at> gnu.org>
and subject line Re: [bug#37322] [PATCH v2 1/2] added versoining to crate import
has caused the debbugs.gnu.org bug report #37322,
regarding [PATCH 1/2] adds the capability of importing a specified version to the crate importer
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
37322: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=37322
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
---
guix/import/crate.scm | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index f6057dbf8b..3266ebdfec 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 David Craven <david <at> craven.ch>
;;; Copyright © 2019 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2019 Martin Becze <mjbecze <at> riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -181,8 +182,8 @@ and LICENSE."
;; This regexp matches that.
(make-regexp "^(.*) OR (.*)$"))
-(define (crate->guix-package crate-name)
- "Fetch the metadata for CRATE-NAME from crates.io, and return the
+(define (crate->guix-package crate-name <at> version)
+ "Fetch the metadata for CRATE-NAME <at> VERSION from crates.io, and return the
`package' s-expression corresponding to that package, or #f on failure."
(define (string->license string)
(match (regexp-exec %dual-license-rx string)
@@ -193,13 +194,29 @@ and LICENSE."
(define (normal-dependency? dependency)
(eq? (crate-dependency-kind dependency) 'normal))
+ (define crate-name-version-list
+ (let ((lnv (string-split crate-name <at> version #\@)))
+ (if (= 1 (length lnv))
+ (append lnv '(#f))
+ lnv)))
+
+ (define crate-name
+ (car crate-name-version-list))
+
+
(define crate
(lookup-crate crate-name))
+ (define crate-version-string
+ (let ((version (cadr crate-name-version-list)))
+ (if version
+ version
+ (crate-latest-version crate))))
+
(and crate
(let* ((version (find (lambda (version)
(string=? (crate-version-number version)
- (crate-latest-version crate)))
+ crate-version-string))
(crate-versions crate)))
(dependencies (crate-version-dependencies version))
(dep-crates (filter normal-dependency? dependencies))
--
2.23.0
[Message part 3 (message/rfc822, inline)]
Hi Martin,
Martin Becze <mjbecze <at> riseup.net> skribis:
> ---
> guix/import/crate.scm | 12 +++++++++---
> guix/scripts/import/crate.scm | 10 +++++++++-
> 2 files changed, 18 insertions(+), 4 deletions(-)
Pushed as fd63ecbe050bf8fa7c8ff0a003d56cce97b6ded1. I tweaked quite a
few things, mostly for cosmetic reasons, and added a commit log that
follows our conventions. Please take a look!
Thank you,
Ludo’.
This bug report was last modified 5 years and 335 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.