Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint pkgtools/pkglint: update to 20.2.4



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5dd30efaaa63
branches:  trunk
changeset: 436027:5dd30efaaa63
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Thu Jul 23 19:09:10 2020 +0000

description:
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.

diffstat:

 pkgtools/pkglint/Makefile              |  4 ++--
 pkgtools/pkglint/files/buildlink3.go   |  9 +++++++++
 pkgtools/pkglint/files/pkglint_test.go |  5 ++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r aaec18cbb223 -r 5dd30efaaa63 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Thu Jul 23 18:40:41 2020 +0000
+++ b/pkgtools/pkglint/Makefile Thu Jul 23 19:09:10 2020 +0000
@@ -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 -r aaec18cbb223 -r 5dd30efaaa63 pkgtools/pkglint/files/buildlink3.go
--- a/pkgtools/pkglint/files/buildlink3.go      Thu Jul 23 18:40:41 2020 +0000
+++ b/pkgtools/pkglint/files/buildlink3.go      Thu Jul 23 19:09:10 2020 +0000
@@ -281,6 +281,15 @@
                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 -r aaec18cbb223 -r 5dd30efaaa63 pkgtools/pkglint/files/pkglint_test.go
--- a/pkgtools/pkglint/files/pkglint_test.go    Thu Jul 23 18:40:41 2020 +0000
+++ b/pkgtools/pkglint/files/pkglint_test.go    Thu Jul 23 19:09:10 2020 +0000
@@ -1484,5 +1484,8 @@
                "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.")
 }



Home | Main Index | Thread Index | Old Index