diff options
author | rillig <rillig@pkgsrc.org> | 2020-07-23 19:09:10 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2020-07-23 19:09:10 +0000 |
commit | b848b905eb8066e57866116867ce9b8a1c842fa0 (patch) | |
tree | 764dce6ea3320fc301dfc85485f23378547dd04f | |
parent | 5522883bd05453d86a5b773a7aaac9f188f3d0a6 (diff) | |
download | pkgsrc-b848b905eb8066e57866116867ce9b8a1c842fa0.tar.gz |
pkgtools/pkglint: update to 20.2.4
Changes since 20.2.3:
Complain about buildlink3.mk files that accidentally set their own
BUILDLINK_PKGSRCDIR variable to a different directory than their own.
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rw-r--r-- | pkgtools/pkglint/files/buildlink3.go | 9 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint_test.go | 5 |
3 files changed, 15 insertions, 3 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index bbe465252d1..73eb7b42806 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.664 2020/07/23 18:40:41 rillig Exp $ +# $NetBSD: Makefile,v 1.665 2020/07/23 19:09:10 rillig Exp $ -PKGNAME= pkglint-20.2.3 +PKGNAME= pkglint-20.2.4 CATEGORIES= pkgtools DISTNAME= tools MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/} diff --git a/pkgtools/pkglint/files/buildlink3.go b/pkgtools/pkglint/files/buildlink3.go index fd4693e9fcc..25f3586c1e9 100644 --- a/pkgtools/pkglint/files/buildlink3.go +++ b/pkgtools/pkglint/files/buildlink3.go @@ -281,6 +281,15 @@ func (ck *Buildlink3Checker) checkVarassign(mkline *MkLine, pkgbase string) { mkline.Errorf("A buildlink3.mk file must only query its own PKG_BUILD_OPTIONS.%s, not PKG_BUILD_OPTIONS.%s.", ck.pkgbase, value) } + + if varname == "BUILDLINK_PKGSRCDIR."+pkgbase { + pkgdir := mkline.Filename().Dir() + expected := "../../" + G.Pkgsrc.Rel(pkgdir).String() + if value != expected { + mkline.Errorf("%s must be set to the package's own path (%s), not %s.", + varname, expected, value) + } + } } func (ck *Buildlink3Checker) checkVaruseInPkgbase(pkgbaseLine *MkLine) { diff --git a/pkgtools/pkglint/files/pkglint_test.go b/pkgtools/pkglint/files/pkglint_test.go index f1d979bab8b..f73c397b698 100644 --- a/pkgtools/pkglint/files/pkglint_test.go +++ b/pkgtools/pkglint/files/pkglint_test.go @@ -1484,5 +1484,8 @@ func (s *Suite) Test_InterPackage_Bl3__same_identifier(c *check.C) { "NOTE: category/package2/Makefile:4: The modifier \"@v@${v}@\" "+ "can be replaced with the simpler \"=\".", "ERROR: category/package2/buildlink3.mk:3: Duplicate package identifier "+ - "\"package1\" already appeared in ../../category/package1/buildlink3.mk:3.") + "\"package1\" already appeared in ../../category/package1/buildlink3.mk:3.", + "ERROR: category/package2/buildlink3.mk:9: "+ + "BUILDLINK_PKGSRCDIR.package1 must be set to the package's own path "+ + "(../../category/package2), not ../../category/package1.") } |