summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2019-01-20 11:43:16 +0200
committerEfraim Flashner <efraim@flashner.co.il>2019-01-20 11:43:28 +0200
commit4e1f9a2f2c242a06221693550b1227b41bb4bd90 (patch)
tree52bedc576244a6b75a2e9ba2a0f1f212b03d654d
parent71f2b4b8f33fe0c0c5450566606992d3bc9f7773 (diff)
downloadguix-4e1f9a2f2c242a06221693550b1227b41bb4bd90.tar.gz
lint: check-source-unstable-tarball: Don't assume uri length.
* guix/scripts/lint.scm (check-source-unstable-tarball): Replace third
with code to make sure there are enough elements to check.
-rw-r--r--guix/scripts/lint.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm
index 0f315a9352..665adcfb8d 100644
--- a/guix/scripts/lint.scm
+++ b/guix/scripts/lint.scm
@@ -758,9 +758,10 @@ descriptions maintained upstream."
   "Emit a warning if PACKAGE's source is an autogenerated tarball."
   (define (check-source-uri uri)
     (when (and (string=? (uri-host (string->uri uri)) "github.com")
-               (string=? (third (split-and-decode-uri-path
-                                   (uri-path (string->uri uri))))
-                     "archive"))
+               (match (split-and-decode-uri-path
+                                   (uri-path (string->uri uri)))
+                      ((_ _ "archive" _ ...) #t)
+                      (_ #f)))
       (emit-warning package
                     (G_ "the source URI should not be an autogenerated tarball")
                     'source)))