mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
lint: 'check-vulnerabilities' follows package replacements.
* guix/scripts/lint.scm (check-vulnerabilities): Check the replacement of PACKAGE. * tests/lint.scm ("cve: patched vulnerability in replacement"): New test.
This commit is contained in:
parent
158f5734cf
commit
5c6a062d48
2 changed files with 21 additions and 1 deletions
|
@ -644,7 +644,8 @@ (define (check-vulnerabilities package)
|
|||
(()
|
||||
#t)
|
||||
((vulnerabilities ...)
|
||||
(let* ((patches (filter-map patch-file-name
|
||||
(let* ((package (or (package-replacement package) package))
|
||||
(patches (filter-map patch-file-name
|
||||
(or (and=> (package-source package)
|
||||
origin-patches)
|
||||
'())))
|
||||
|
|
|
@ -559,6 +559,25 @@ (define-syntax-rule (with-warnings body ...)
|
|||
(patches
|
||||
(list "/a/b/pi-CVE-2015-1234.patch"))))))))))
|
||||
|
||||
(test-assert "cve: patched vulnerability in replacement"
|
||||
(mock ((guix scripts lint) package-vulnerabilities
|
||||
(lambda (package)
|
||||
(list (make-struct (@@ (guix cve) <vulnerability>) 0
|
||||
"CVE-2015-1234"
|
||||
(list (cons (package-name package)
|
||||
(package-version package)))))))
|
||||
(string-null?
|
||||
(with-warnings
|
||||
(check-vulnerabilities
|
||||
(dummy-package
|
||||
"pi" (version "3.14") (source (dummy-origin))
|
||||
(replacement (dummy-package
|
||||
"pi" (version "3.14")
|
||||
(source
|
||||
(dummy-origin
|
||||
(patches
|
||||
(list "/a/b/pi-CVE-2015-1234.patch"))))))))))))
|
||||
|
||||
(test-assert "formatting: lonely parentheses"
|
||||
(string-contains
|
||||
(with-warnings
|
||||
|
|
Loading…
Reference in a new issue