pkgsrc-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 21.2.3
details: https://anonhg.NetBSD.org/pkgsrc/rev/366924dc757c
branches: trunk
changeset: 456946:366924dc757c
user: rillig <rillig%pkgsrc.org@localhost>
date: Thu Aug 12 05:29:41 2021 +0000
description:
pkgtools/pkglint: update to 21.2.3
Changes since 21.2.2:
Temporarily disable the warning about Meson and gmake. It led to a
false positive in x11/libxkbcommon, where pkglint wrongly assumed that
the package would use gmake.
For packages using Meson, do not warn if an included package uses
CONFIGURE_ARGS.
diffstat:
pkgtools/pkglint/Makefile | 5 +--
pkgtools/pkglint/files/package.go | 19 ++++++++++++-----
pkgtools/pkglint/files/package_test.go | 35 +++++++++++++++++++++++++++++++++-
3 files changed, 49 insertions(+), 10 deletions(-)
diffs (109 lines):
diff -r 1a27c549985e -r 366924dc757c pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Thu Aug 12 04:20:11 2021 +0000
+++ b/pkgtools/pkglint/Makefile Thu Aug 12 05:29:41 2021 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.693 2021/08/11 19:35:10 bsiegert Exp $
+# $NetBSD: Makefile,v 1.694 2021/08/12 05:29:41 rillig Exp $
-PKGNAME= pkglint-21.2.2
-PKGREVISION= 1
+PKGNAME= pkglint-21.2.3
CATEGORIES= pkgtools
DISTNAME= tools
MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/}
diff -r 1a27c549985e -r 366924dc757c pkgtools/pkglint/files/package.go
--- a/pkgtools/pkglint/files/package.go Thu Aug 12 04:20:11 2021 +0000
+++ b/pkgtools/pkglint/files/package.go Thu Aug 12 05:29:41 2021 +0000
@@ -1194,7 +1194,7 @@
func (pkg *Package) checkMesonGnuMake(mklines *MkLines) {
gmake := mklines.Tools.ByName("gmake")
- if gmake != nil && gmake.UsableAtRunTime() {
+ if G.Experimental && gmake != nil && gmake.UsableAtRunTime() {
mkline := NewLineWhole(pkg.File("."))
mkline.Warnf("Meson packages usually don't need GNU make.")
mkline.Explain(
@@ -1204,12 +1204,19 @@
}
func (pkg *Package) checkMesonConfigureArgs() {
- if mkline := pkg.vars.FirstDefinition("CONFIGURE_ARGS"); mkline != nil {
- mkline.Warnf("Meson packages usually don't need CONFIGURE_ARGS.")
- mkline.Explain(
- "After migrating a package from GNU make to Meson,",
- "CONFIGURE_ARGS are typically not needed anymore.")
+ mkline := pkg.vars.FirstDefinition("CONFIGURE_ARGS")
+ if mkline == nil {
+ return
}
+
+ if pkg.Rel(mkline.Location.Filename).HasPrefixPath("..") {
+ return
+ }
+
+ mkline.Warnf("Meson packages usually don't need CONFIGURE_ARGS.")
+ mkline.Explain(
+ "After migrating a package from GNU make to Meson,",
+ "CONFIGURE_ARGS are typically not needed anymore.")
}
func (pkg *Package) checkMesonPython(mklines *MkLines) {
diff -r 1a27c549985e -r 366924dc757c pkgtools/pkglint/files/package_test.go
--- a/pkgtools/pkglint/files/package_test.go Thu Aug 12 04:20:11 2021 +0000
+++ b/pkgtools/pkglint/files/package_test.go Thu Aug 12 05:29:41 2021 +0000
@@ -2619,6 +2619,14 @@
}
func (s *Suite) Test_Package_checkMesonGnuMake(c *check.C) {
+
+ // False positive in x11/libxkbcommon, 2021-08-12.
+ //
+ // It seems that the Tools registry is not initialized properly since
+ // x11/libxkbcommon does not mention gmake at all, and 'bmake show-all'
+ // also does not contain 'gmake'.
+ G.Experimental = true
+
t := s.Init(c)
t.CreateFileLines("devel/meson/build.mk")
@@ -2632,7 +2640,9 @@
G.Check(".")
- // XXX: Giving the line number would be nice.
+ // XXX: Giving the line number where gmake is actually used by the
+ // package would be nice. Without that information, it is unclear why
+ // the package uses gmake at all.
t.CheckOutputLines(
"WARN: Meson packages usually don't need GNU make.")
}
@@ -2654,6 +2664,29 @@
"WARN: Makefile:20: Meson packages usually don't need CONFIGURE_ARGS.")
}
+func (s *Suite) Test_Package_checkMesonConfigureArgs__include(c *check.C) {
+ t := s.Init(c)
+
+ t.CreateFileLines("devel/meson/build.mk")
+ t.CreateFileLines("devel/libcommon/use.mk",
+ MkCvsID,
+ "",
+ "CONFIGURE_ARGS+=\t--enable-feature")
+ t.SetUpPackage("category/package",
+ ".include \"../../devel/libcommon/use.mk\"",
+ ".include \"../../devel/meson/build.mk\"")
+ t.Chdir("category/package")
+ t.FinishSetUp()
+
+ G.Check(".")
+
+ // When checking the package x11/libxkbcommon, do not warn that
+ // converters/libiconv/builtin.mk defines CONFIGURE_ARGS, since that
+ // file may be used by other packages as well, or the relevant section
+ // may be guarded by '.if ${HAS_CONFIGURE}'.
+ t.CheckOutputEmpty()
+}
+
func (s *Suite) Test_Package_checkMesonPython(c *check.C) {
t := s.Init(c)
Home |
Main Index |
Thread Index |
Old Index