GNU bug report logs -
#26772
[PATCH 0/3] Fix guix refresh errors.
Previous Next
Reported by: Mathieu Othacehe <m.othacehe <at> gmail.com>
Date: Thu, 4 May 2017 10:06:01 UTC
Severity: normal
Tags: patch
Done: Mathieu Othacehe <m.othacehe <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 26772 <at> debbugs.gnu.org (full text, mbox):
Mathieu Othacehe <m.othacehe <at> gmail.com> skribis:
> * guix/import/cran.scm (package->upstream-name): Return #f if url
> start and end index could not be determined.
> (cran-package?): Check if the upstream-name can be extracted from
> given package.
[...]
> @@ -374,7 +375,8 @@ dependencies."
> (start (string-rindex url #\/)))
> ;; The URL ends on
> ;; (string-append "/" name "_" version ".tar.gz")
> - (substring url (+ start 1) end)))
> + (if (and start end)
> + (substring url (+ start 1) end) #f)))
This can be written as:
(and start end (substring url …))
> @@ -415,6 +417,9 @@ dependencies."
> (define (cran-package? package)
> "Return true if PACKAGE is an R package from CRAN."
> (and (string-prefix? "r-" (package-name package))
> + ;; Check if the upstream name can be extracted from package uri.
> + (package->upstream-name package)
> + ;; Check if package uri(s) are prefixed by "mirror://cran".
> (match (and=> (package-source package) origin-uri)
> ((? string? uri)
> (string-prefix? "mirror://cran" uri))
OK!
Do you think you could add this specific case (r-minimal) as a test case
for ‘cran-package?’ in tests/cran.scm? That would be awesome.
Otherwise LGTM, thanks!
Ludo’.
This bug report was last modified 8 years and 103 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.