GNU bug report logs - #26373
Various improvements to the CRAN importer

Previous Next

Package: guix-patches;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Wed, 5 Apr 2017 16:41:01 UTC

Severity: normal

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 26373 <at> debbugs.gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: bug#26373: [PATCH 5/6] import cran: Ensure substring indices are valid.
Date: Wed,  5 Apr 2017 18:42:09 +0200
* guix/import/cran.scm (package->upstream-name): Check that "start" and "end"
are valid before using them as substring indices.
---
 guix/import/cran.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 423835637..557d694ad 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -384,9 +384,10 @@ dependencies."
              ((or (? string? url) (url _ ...))
               (let ((end   (string-rindex url #\_))
                     (start (string-rindex url #\/)))
-                ;; The URL ends on
-                ;; (string-append "/" name "_" version ".tar.gz")
-                (substring url (+ start 1) end)))
+                (and start end
+                     ;; The URL ends on
+                     ;; (string-append "/" name "_" version ".tar.gz")
+                     (substring url (+ start 1) end))))
              (_ #f)))
           (_ #f)))))
 
-- 
2.12.2






This bug report was last modified 8 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.