guix: lint: Warn only if GitHub URI is not same as the package URI.
* guix/scripts/lint.scm (check-github-url): Warn only if the GitHub URI obtained after following redirects is not same as the original URI. * tests/lint.scm ("github-url: already the correct github url"): New test.master
parent
394207c1ee
commit
40fa21c22e
|
@ -8,7 +8,7 @@
|
||||||
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
|
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
|
||||||
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
|
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -820,10 +820,11 @@ descriptions maintained upstream."
|
||||||
(lambda (uri)
|
(lambda (uri)
|
||||||
(and=> (follow-redirects-to-github uri)
|
(and=> (follow-redirects-to-github uri)
|
||||||
(lambda (github-uri)
|
(lambda (github-uri)
|
||||||
|
(unless (string=? github-uri uri)
|
||||||
(emit-warning
|
(emit-warning
|
||||||
package
|
package
|
||||||
(format #f (G_ "URL should be '~a'") github-uri)
|
(format #f (G_ "URL should be '~a'") github-uri)
|
||||||
'source))))
|
'source)))))
|
||||||
(origin-uris origin)))))
|
(origin-uris origin)))))
|
||||||
|
|
||||||
(define (check-derivation package)
|
(define (check-derivation package)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
||||||
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
|
;;; Copyright © 2017 Alex Kost <alezost@gmail.com>
|
||||||
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
|
;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -775,7 +775,16 @@
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (%local-url))
|
(uri (%local-url))
|
||||||
(sha256 %null-sha256))))))))))
|
(sha256 %null-sha256))))))))))
|
||||||
github-url)))
|
github-url))
|
||||||
|
(test-assert "github-url: already the correct github url"
|
||||||
|
(string-null?
|
||||||
|
(with-warnings
|
||||||
|
(check-github-url
|
||||||
|
(dummy-package "x" (source
|
||||||
|
(origin
|
||||||
|
(method url-fetch)
|
||||||
|
(uri github-url)
|
||||||
|
(sha256 %null-sha256)))))))))
|
||||||
|
|
||||||
(test-assert "cve"
|
(test-assert "cve"
|
||||||
(mock ((guix scripts lint) package-vulnerabilities (const '()))
|
(mock ((guix scripts lint) package-vulnerabilities (const '()))
|
||||||
|
|
Loading…
Reference in New Issue