mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
lint: Do not assume that a package's source is an origin.
* guix/lint.scm (check-source-file-name): Ensure ORIGIN is an origin. (check-patch-file-names)[patches]: Likewise. (check-source): Likewise.
This commit is contained in:
parent
c11b95af7f
commit
37c3e0bbaf
1 changed files with 5 additions and 4 deletions
|
@ -670,8 +670,9 @@ (define (check-patch-file-names package)
|
|||
(%make-warning package (condition-message c)
|
||||
#:field 'patch-file-names))))
|
||||
(define patches
|
||||
(or (and=> (package-source package) origin-patches)
|
||||
'()))
|
||||
(match (package-source package)
|
||||
((? origin? origin) (origin-patches origin))
|
||||
(_ '())))
|
||||
|
||||
(define (starts-with-package-name? file-name)
|
||||
(and=> (string-contains file-name (package-name package))
|
||||
|
@ -792,7 +793,7 @@ (define (warnings-for-uris uris)
|
|||
(loop rest (cons warning warnings))))))))
|
||||
|
||||
(let ((origin (package-source package)))
|
||||
(if (and origin
|
||||
(if (and (origin? origin)
|
||||
(eqv? (origin-method origin) url-fetch))
|
||||
(let* ((uris (append-map (cut maybe-expand-mirrors <> %mirrors)
|
||||
(map string->uri (origin-uris origin))))
|
||||
|
@ -828,7 +829,7 @@ (define (origin-file-name-valid? origin)
|
|||
(not (string-match (string-append "^v?" version) file-name)))))
|
||||
|
||||
(let ((origin (package-source package)))
|
||||
(if (or (not origin) (origin-file-name-valid? origin))
|
||||
(if (or (not (origin? origin)) (origin-file-name-valid? origin))
|
||||
'()
|
||||
(list
|
||||
(make-warning package
|
||||
|
|
Loading…
Reference in a new issue