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.
This commit is contained in:
parent
71f2b4b8f3
commit
4e1f9a2f2c
|
@ -758,9 +758,10 @@ (define (check-source-unstable-tarball package)
|
||||||
"Emit a warning if PACKAGE's source is an autogenerated tarball."
|
"Emit a warning if PACKAGE's source is an autogenerated tarball."
|
||||||
(define (check-source-uri uri)
|
(define (check-source-uri uri)
|
||||||
(when (and (string=? (uri-host (string->uri uri)) "github.com")
|
(when (and (string=? (uri-host (string->uri uri)) "github.com")
|
||||||
(string=? (third (split-and-decode-uri-path
|
(match (split-and-decode-uri-path
|
||||||
(uri-path (string->uri uri))))
|
(uri-path (string->uri uri)))
|
||||||
"archive"))
|
((_ _ "archive" _ ...) #t)
|
||||||
|
(_ #f)))
|
||||||
(emit-warning package
|
(emit-warning package
|
||||||
(G_ "the source URI should not be an autogenerated tarball")
|
(G_ "the source URI should not be an autogenerated tarball")
|
||||||
'source)))
|
'source)))
|
||||||
|
|
Loading…
Reference in a new issue