pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/pkgtools/pkglint
Module Name: pkgsrc
Committed By: rillig
Date: Sun Apr 28 18:13:53 UTC 2019
Modified Files:
pkgsrc/pkgtools/pkglint: Makefile
pkgsrc/pkgtools/pkglint/files: logging.go mklinechecker.go
mklinechecker_test.go pkgsrc_test.go vardefs.go vartype.go
Log Message:
pkgtools/pkglint: update to 5.7.8
Changes since 5.7.7:
Warn about definitions of NOT_FOR_* and ONLY_FOR_* which are missing a
rationale. When maintaining such packages it helps a lot to know why the
package cannot be built on a particular platform or with a particular
compiler or Python version.
To generate a diff of this commit:
cvs rdiff -u -r1.577 -r1.578 pkgsrc/pkgtools/pkglint/Makefile
cvs rdiff -u -r1.21 -r1.22 pkgsrc/pkgtools/pkglint/files/logging.go
cvs rdiff -u -r1.36 -r1.37 pkgsrc/pkgtools/pkglint/files/mklinechecker.go
cvs rdiff -u -r1.32 -r1.33 \
pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go
cvs rdiff -u -r1.22 -r1.23 pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go
cvs rdiff -u -r1.61 -r1.62 pkgsrc/pkgtools/pkglint/files/vardefs.go
cvs rdiff -u -r1.30 -r1.31 pkgsrc/pkgtools/pkglint/files/vartype.go
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/pkgtools/pkglint/Makefile
diff -u pkgsrc/pkgtools/pkglint/Makefile:1.577 pkgsrc/pkgtools/pkglint/Makefile:1.578
--- pkgsrc/pkgtools/pkglint/Makefile:1.577 Sat Apr 27 19:33:56 2019
+++ pkgsrc/pkgtools/pkglint/Makefile Sun Apr 28 18:13:53 2019
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.577 2019/04/27 19:33:56 rillig Exp $
+# $NetBSD: Makefile,v 1.578 2019/04/28 18:13:53 rillig Exp $
-PKGNAME= pkglint-5.7.7
+PKGNAME= pkglint-5.7.8
CATEGORIES= pkgtools
DISTNAME= tools
MASTER_SITES= ${MASTER_SITE_GITHUB:=golang/}
Index: pkgsrc/pkgtools/pkglint/files/logging.go
diff -u pkgsrc/pkgtools/pkglint/files/logging.go:1.21 pkgsrc/pkgtools/pkglint/files/logging.go:1.22
--- pkgsrc/pkgtools/pkglint/files/logging.go:1.21 Sat Apr 27 19:33:57 2019
+++ pkgsrc/pkgtools/pkglint/files/logging.go Sun Apr 28 18:13:53 2019
@@ -236,9 +236,8 @@ func (l *Logger) Logf(level *LogLevel, f
// Errorf logs a technical error on the error output.
//
-// location must be either an empty string or a slash-separated filename,
-// such as the one in Location.Filename. It may be followed by the usual
-// ":123" for line numbers.
+// location must be a slash-separated filename, such as the one in
+// Location.Filename. It may be followed by the usual ":123" for line numbers.
//
// For diagnostics, use Logf instead.
func (l *Logger) Errorf(location string, format string, args ...interface{}) {
Index: pkgsrc/pkgtools/pkglint/files/mklinechecker.go
diff -u pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.36 pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.37
--- pkgsrc/pkgtools/pkglint/files/mklinechecker.go:1.36 Sat Apr 27 19:33:57 2019
+++ pkgsrc/pkgtools/pkglint/files/mklinechecker.go Sun Apr 28 18:13:53 2019
@@ -402,6 +402,63 @@ func (ck MkLineChecker) explainPermissio
ck.MkLine.Explain(expl...)
}
+func (ck MkLineChecker) checkVarassignLeftRationale() {
+
+ isRationale := func(mkline MkLine) bool {
+ if mkline.IsVarassign() || mkline.IsCommentedVarassign() {
+ return mkline.VarassignComment() != ""
+ }
+ return mkline.IsComment() && !hasPrefix(mkline.Text, "# $")
+ }
+
+ needsRationale := func(mkline MkLine) bool {
+ if !mkline.IsVarassign() && !mkline.IsCommentedVarassign() {
+ return false
+ }
+ vartype := G.Pkgsrc.VariableType(ck.MkLines, mkline.Varname())
+ return vartype != nil && vartype.NeedsRationale()
+ }
+
+ mkline := ck.MkLine
+ if !needsRationale(mkline) {
+ return
+ }
+
+ if mkline.VarassignComment() != "" {
+ return
+ }
+
+ // Check whether there is a comment directly above.
+ for i, other := range ck.MkLines.mklines {
+ if other == mkline && i > 0 {
+ aboveIndex := i - 1
+ for aboveIndex > 0 && needsRationale(ck.MkLines.mklines[aboveIndex]) {
+ aboveIndex--
+ }
+
+ if isRationale(ck.MkLines.mklines[aboveIndex]) {
+ return
+ }
+ }
+ }
+
+ mkline.Warnf("Setting variable %s should have a rationale.", mkline.Varname())
+ mkline.Explain(
+ "Since this variable prevents the package from being built in some situations,",
+ "the reasons for this restriction should be documented.",
+ "Otherwise it becomes too difficult to check whether these restrictions still apply",
+ "when the package is updated by someone else later.",
+ "",
+ "To add the rationale, put it in a comment at the end of this line,",
+ "or in a separate comment in the line above.",
+ "The rationale should try to answer these questions:",
+ "",
+ "* which specific aspects of the package are affected?",
+ "* if it's a dependency, is the dependency too old or too new?",
+ "* in which situations does a crash occur, if any?",
+ "* has it been reported upstream?")
+}
+
// CheckVaruse checks a single use of a variable in a specific context.
func (ck MkLineChecker) CheckVaruse(varuse *MkVarUse, vuc *VarUseContext) {
mkline := ck.MkLine
@@ -932,6 +989,7 @@ func (ck MkLineChecker) checkVarassignLe
if !ck.checkVarassignLeftUserSettable() {
ck.checkVarassignLeftPermissions()
}
+ ck.checkVarassignLeftRationale()
ck.checkTextVarUse(
ck.MkLine.Varname(),
Index: pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go
diff -u pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go:1.32 pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go:1.33
--- pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go:1.32 Sat Apr 27 19:33:57 2019
+++ pkgsrc/pkgtools/pkglint/files/mklinechecker_test.go Sun Apr 28 18:13:53 2019
@@ -736,6 +736,38 @@ func (s *Suite) Test_MkLineChecker_check
t.CheckOutputEmpty()
}
+func (s *Suite) Test_MkLineChecker_checkVarassignLeftRationale(c *check.C) {
+ t := s.Init(c)
+
+ t.SetUpVartypes()
+ mklines := t.NewMkLines("filename.mk",
+ MkRcsID,
+ "ONLY_FOR_PLATFORM=\t*-*-*", // The CVS Id above is not a rationale.
+ "NOT_FOR_PLATFORM=\t*-*-*", // Neither does this line have a rationale.
+ "",
+ "ONLY_FOR_PLATFORM+=\t*-*-* # rationale",
+ "",
+ "# rationale in the line above",
+ "ONLY_FOR_PLATFORM+=\t*-*-*",
+ "",
+ "#VAR=\tvalue", // This comment is not a rationale.
+ "ONLY_FOR_PLATFORM+=\t*-*-*", // Needs a rationale.
+ "",
+ "# rationale",
+ "BROKEN_ON_PLATFORM+=\t*-*-*",
+ "BROKEN_ON_PLATFORM+=\t*-*-*", // The rationale applies to this line, too.
+ "",
+ "PKGNAME=\tpackage-1.0", // Does not need a rationale.
+ "UNKNOWN=\t${UNKNOWN}") // Unknown type, does not need a rationale.
+
+ mklines.Check()
+
+ t.CheckOutputLines(
+ "WARN: filename.mk:2: Setting variable ONLY_FOR_PLATFORM should have a rationale.",
+ "WARN: filename.mk:3: Setting variable NOT_FOR_PLATFORM should have a rationale.",
+ "WARN: filename.mk:11: Setting variable ONLY_FOR_PLATFORM should have a rationale.")
+}
+
func (s *Suite) Test_MkLineChecker_checkVarassignOpShell(c *check.C) {
t := s.Init(c)
@@ -1225,11 +1257,11 @@ func (s *Suite) Test_MkLineChecker_check
t.SetUpVartypes()
mklines := t.NewMkLines("Makefile",
MkRcsID,
- "PYTHON_VERSIONS_ACCEPTED=\t36 __future__",
- "PYTHON_VERSIONS_ACCEPTED=\t36 -13",
- "PYTHON_VERSIONS_ACCEPTED=\t36 ${PKGVERSION_NOREV}",
- "PYTHON_VERSIONS_ACCEPTED=\t36 37",
- "PYTHON_VERSIONS_ACCEPTED=\t37 36 27 25")
+ "PYTHON_VERSIONS_ACCEPTED=\t36 __future__ # rationale",
+ "PYTHON_VERSIONS_ACCEPTED=\t36 -13 # rationale",
+ "PYTHON_VERSIONS_ACCEPTED=\t36 ${PKGVERSION_NOREV} # rationale",
+ "PYTHON_VERSIONS_ACCEPTED=\t36 37 # rationale",
+ "PYTHON_VERSIONS_ACCEPTED=\t37 36 27 25 # rationale")
// TODO: All but the last of the above assignments should be flagged as
// redundant by RedundantScope; as of March 2019, that check is only
Index: pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go
diff -u pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.22 pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.23
--- pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go:1.22 Sat Apr 27 19:33:57 2019
+++ pkgsrc/pkgtools/pkglint/files/pkgsrc_test.go Sun Apr 28 18:13:53 2019
@@ -199,6 +199,12 @@ func (s *Suite) Test_Pkgsrc_loadTools__B
t.CreateFileLines("mk/bsd.pkg.mk",
MkRcsID,
"_BUILD_DEFS+=\tPKG_SYSCONFBASEDIR PKG_SYSCONFDIR")
+ t.CreateFileLines("mk/defaults/mk.conf",
+ MkRcsID,
+ "",
+ "VARBASE=\t\t/var/pkg",
+ "PKG_SYSCONFBASEDIR=\t/usr/pkg/etc",
+ "PKG_SYSCONFDIR=\t/usr/pkg/etc")
t.FinishSetUp()
G.Check(pkg)
@@ -206,8 +212,9 @@ func (s *Suite) Test_Pkgsrc_loadTools__B
c.Check(G.Pkgsrc.IsBuildDef("PKG_SYSCONFDIR"), equals, true)
c.Check(G.Pkgsrc.IsBuildDef("VARBASE"), equals, false)
- // FIXME: There should be a warning for VARBASE, but G.Pkgsrc.UserDefinedVars
- // does not contain anything at mklinechecker.go:/UserDefinedVars/.
+ t.CheckOutputLines(
+ "WARN: ~/category/package/Makefile:21: " +
+ "The user-defined variable VARBASE is used but not added to BUILD_DEFS.")
}
func (s *Suite) Test_Pkgsrc_loadDocChanges__not_found(c *check.C) {
Index: pkgsrc/pkgtools/pkglint/files/vardefs.go
diff -u pkgsrc/pkgtools/pkglint/files/vardefs.go:1.61 pkgsrc/pkgtools/pkglint/files/vardefs.go:1.62
--- pkgsrc/pkgtools/pkglint/files/vardefs.go:1.61 Sat Apr 27 19:33:57 2019
+++ pkgsrc/pkgtools/pkglint/files/vardefs.go Sun Apr 28 18:13:53 2019
@@ -124,6 +124,14 @@ func (reg *VarTypeRegistry) Init(src *Pk
"Makefile, Makefile.*, *.mk: default, set, use")
}
+ // Like pkg, but always needs a rationale.
+ pkgrat := func(varname string, basicType *BasicType) {
+ acl(varname, basicType,
+ PackageSettable|NeedsRationale,
+ "buildlink3.mk, builtin.mk: none",
+ "Makefile, Makefile.*, *.mk: default, set, use")
+ }
+
// pkgload is the same as pkg, except that the variable may be accessed at load time.
pkgload := func(varname string, basicType *BasicType) {
acl(varname, basicType,
@@ -145,6 +153,14 @@ func (reg *VarTypeRegistry) Init(src *Pk
"Makefile, Makefile.*, *.mk: default, set, append, use")
}
+ // Like pkglist, but always needs a rationale.
+ pkglistrat := func(varname string, basicType *BasicType) {
+ acllist(varname, basicType,
+ List|PackageSettable|NeedsRationale,
+ "buildlink3.mk, builtin.mk: none",
+ "Makefile, Makefile.*, *.mk: default, set, append, use")
+ }
+
// pkgappend declares a variable that may use the += operator,
// even though it is not a list where each item can be interpreted
// on its own.
@@ -168,6 +184,14 @@ func (reg *VarTypeRegistry) Init(src *Pk
"Makefile, Makefile.*, *.mk: default, set, append, use")
}
+ // Like pkgappend, but always needs a rationale.
+ pkgappendrat := func(varname string, basicType *BasicType) {
+ acl(varname, basicType,
+ PackageSettable|NeedsRationale,
+ "buildlink3.mk, builtin.mk: none",
+ "Makefile, Makefile.*, *.mk: default, set, append, use")
+ }
+
// Some package-defined variables may be modified in buildlink3.mk files.
// These variables are typically related to compiling and linking files
// from C and related languages.
@@ -184,6 +208,13 @@ func (reg *VarTypeRegistry) Init(src *Pk
"Makefile, Makefile.*, *.mk: default, set, append, use")
}
+ // Like pkglistbl3, but always needs a rationale.
+ pkglistbl3rat := func(varname string, basicType *BasicType) {
+ acl(varname, basicType,
+ List|PackageSettable|NeedsRationale,
+ "Makefile, Makefile.*, *.mk: default, set, append, use")
+ }
+
// sys declares a user-defined or system-defined variable that must not
// be modified by packages.
//
@@ -776,10 +807,10 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkglist("BOOTSTRAP_DEPENDS", BtDependencyWithPath)
pkg("BOOTSTRAP_PKG", BtYesNo)
// BROKEN should better be a list of messages instead of a simple string.
- pkgappend("BROKEN", BtMessage)
+ pkgappendrat("BROKEN", BtMessage)
pkg("BROKEN_GETTEXT_DETECTION", BtYesNo)
- pkglist("BROKEN_EXCEPT_ON_PLATFORM", BtMachinePlatformPattern)
- pkglist("BROKEN_ON_PLATFORM", BtMachinePlatformPattern)
+ pkglistrat("BROKEN_EXCEPT_ON_PLATFORM", BtMachinePlatformPattern)
+ pkglistrat("BROKEN_ON_PLATFORM", BtMachinePlatformPattern)
syslist("BSD_MAKE_ENV", BtShellWord)
// TODO: Align the permissions of the various BUILDLINK_*.* variables with each other.
acllist("BUILDLINK_ABI_DEPENDS.*", BtDependency,
@@ -1026,7 +1057,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkglist("EMACS_VERSIONS_ACCEPTED", emacsVersions)
sys("EMACS_VERSION_MAJOR", BtInteger)
sys("EMACS_VERSION_MINOR", BtInteger)
- pkglist("EMACS_VERSION_REQD", emacsVersions)
+ pkglistrat("EMACS_VERSION_REQD", emacsVersions)
sys("EMULDIR", BtPathname)
sys("EMULSUBDIR", BtPathname)
sys("OPSYS_EMULDIR", BtPathname)
@@ -1070,17 +1101,17 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkglist("FILES_SUBST", BtShellWord)
syslist("FILES_SUBST_SED", BtShellWord)
pkglist("FIX_RPATH", BtVariableName)
- pkglist("FLEX_REQD", BtVersion)
+ pkglistrat("FLEX_REQD", BtVersion)
pkglist("FONTS_DIRS.*", BtPathname)
syslist("GAMEDATA_PERMS", BtPerms)
syslist("GAMEDIR_PERMS", BtPerms)
- pkglistbl3("GCC_REQD", BtGccReqd)
+ pkglistbl3rat("GCC_REQD", BtGccReqd)
pkgappend("GENERATE_PLIST", BtShellCommands)
pkg("GITHUB_PROJECT", BtIdentifier)
pkg("GITHUB_TAG", BtIdentifier)
pkg("GITHUB_RELEASE", BtFileName)
pkg("GITHUB_TYPE", enum("tag release"))
- pkg("GMAKE_REQD", BtVersion)
+ pkgrat("GMAKE_REQD", BtVersion)
// Some packages need to set GNU_ARCH.i386 to either i486 or i586.
pkg("GNU_ARCH.*", BtIdentifier)
// GNU_CONFIGURE needs to be tested in some buildlink3.mk files,
@@ -1104,7 +1135,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
PackageSettable,
"*: set, use-loadtime")
sys("IMAKE", BtShellCommand)
- pkglistbl3("INCOMPAT_CURSES", BtMachinePlatformPattern)
+ pkglistbl3rat("INCOMPAT_CURSES", BtMachinePlatformPattern)
sys("INFO_DIR", BtPathname) // relative to PREFIX
pkg("INFO_FILES", BtYes)
sys("INSTALL", BtShellCommand)
@@ -1163,7 +1194,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkglist("LIBS.*", BtLdFlag)
sys("LIBTOOL", BtShellCommand)
pkglist("LIBTOOL_OVERRIDE", BtPathmask)
- pkglist("LIBTOOL_REQD", BtVersion)
+ pkglistrat("LIBTOOL_REQD", BtVersion)
pkgappend("LICENCE", BtLicense)
pkgappend("LICENSE", BtLicense)
pkg("LICENSE_FILE", BtPathname)
@@ -1244,12 +1275,12 @@ func (reg *VarTypeRegistry) Init(src *Pk
sys("NATIVE_CC", BtShellCommand) // See mk/platform/tools.NetBSD.mk (and some others).
sys("NM", BtShellCommand)
sys("NONBINMODE", BtFileMode)
- pkglist("NOT_FOR_COMPILER", compilers)
- pkglist("NOT_FOR_BULK_PLATFORM", BtMachinePlatformPattern)
- pkglist("NOT_FOR_PLATFORM", BtMachinePlatformPattern)
- pkg("NOT_FOR_UNPRIVILEGED", BtYesNo)
- pkglist("NOT_PAX_ASLR_SAFE", BtPathmask)
- pkglist("NOT_PAX_MPROTECT_SAFE", BtPathmask)
+ pkglistrat("NOT_FOR_COMPILER", compilers)
+ pkglistrat("NOT_FOR_BULK_PLATFORM", BtMachinePlatformPattern)
+ pkglistrat("NOT_FOR_PLATFORM", BtMachinePlatformPattern)
+ pkgrat("NOT_FOR_UNPRIVILEGED", BtYesNo)
+ pkglistrat("NOT_PAX_ASLR_SAFE", BtPathmask)
+ pkglistrat("NOT_PAX_MPROTECT_SAFE", BtPathmask)
pkg("NO_BIN_ON_CDROM", BtRestricted)
pkg("NO_BIN_ON_FTP", BtRestricted)
pkgload("NO_BUILD", BtYes)
@@ -1262,9 +1293,9 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkg("NO_SRC_ON_CDROM", BtRestricted)
pkg("NO_SRC_ON_FTP", BtRestricted)
sysload("OBJECT_FMT", enum("COFF ECOFF ELF SOM XCOFF Mach-O PE a.out"))
- pkglist("ONLY_FOR_COMPILER", compilers)
- pkglist("ONLY_FOR_PLATFORM", BtMachinePlatformPattern)
- pkg("ONLY_FOR_UNPRIVILEGED", BtYesNo)
+ pkglistrat("ONLY_FOR_COMPILER", compilers)
+ pkglistrat("ONLY_FOR_PLATFORM", BtMachinePlatformPattern)
+ pkgrat("ONLY_FOR_UNPRIVILEGED", BtYesNo)
sysload("OPSYS", enumFromFiles("mk/platform", `(.*)\.mk$`, "$1",
"Cygwin DragonFly FreeBSD Linux NetBSD SunOS"))
pkglistbl3("OPSYSVARS", BtVariableName)
@@ -1290,7 +1321,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
sys("PAXCTL", BtShellCommand) // See mk/pax.mk.
pkglist("PERL5_PACKLIST", BtPerl5Packlist)
pkg("PERL5_PACKLIST_DIR", BtPathname)
- pkglist("PERL5_REQD", BtVersion)
+ pkglistrat("PERL5_REQD", BtVersion)
sysbl3("PERL5_INSTALLARCHLIB", BtPathname) // See lang/perl5/vars.mk
sysbl3("PERL5_INSTALLSCRIPT", BtPathname)
sysbl3("PERL5_INSTALLVENDORBIN", BtPathname)
@@ -1310,7 +1341,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkg("PERL5_USE_PACKLIST", BtYesNo)
sys("PGSQL_PREFIX", BtPathname)
acllist("PGSQL_VERSIONS_ACCEPTED", pgsqlVersions,
- PackageSettable,
+ PackageSettable|NeedsRationale,
// The "set" is necessary for databases/postgresql-postgis2.
"Makefile, Makefile.*, *.mk: default, set, append, use")
usr("PGSQL_VERSION_DEFAULT", BtVersion)
@@ -1359,7 +1390,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
sys("PKGWILDCARD", BtFileMask)
sysload("PKG_ADMIN", BtShellCommand)
sys("PKG_APACHE", enum("apache24"))
- pkglist("PKG_APACHE_ACCEPTED", enum("apache24"))
+ pkglistrat("PKG_APACHE_ACCEPTED", enum("apache24"))
usr("PKG_APACHE_DEFAULT", enum("apache24"))
sysloadlist("PKG_BUILD_OPTIONS.*", BtOption)
usr("PKG_CONFIG", BtYes)
@@ -1391,7 +1422,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
sys("PKG_INFO", BtShellCommand)
sys("PKG_JAVA_HOME", BtPathname)
sys("PKG_JVM", jvms)
- pkglist("PKG_JVMS_ACCEPTED", jvms)
+ pkglistrat("PKG_JVMS_ACCEPTED", jvms)
pkg("PKG_LIBTOOL", BtPathname)
// begin PKG_OPTIONS section
@@ -1469,8 +1500,8 @@ func (reg *VarTypeRegistry) Init(src *Pk
"*: use, use-loadtime")
// See lang/python/pyversion.mk
pkg("PYTHON_FOR_BUILD_ONLY", enum("yes no test tool YES"))
- pkglist("PYTHON_VERSIONS_ACCEPTED", BtVersion)
- pkglist("PYTHON_VERSIONS_INCOMPATIBLE", BtVersion)
+ pkglistrat("PYTHON_VERSIONS_ACCEPTED", BtVersion)
+ pkglistrat("PYTHON_VERSIONS_INCOMPATIBLE", BtVersion)
usr("PYTHON_VERSION_DEFAULT", BtVersion)
usr("PYTHON_VERSION_REQD", BtVersion)
pkglist("PYTHON_VERSIONED_DEPENDENCIES", BtPythonDependency)
@@ -1568,7 +1599,7 @@ func (reg *VarTypeRegistry) Init(src *Pk
pkglist("TEST_DIRS", BtWrksrcSubdirectory)
pkglist("TEST_ENV", BtShellWord)
pkglist("TEST_TARGET", BtIdentifier)
- pkglist("TEXINFO_REQD", BtVersion)
+ pkglistrat("TEXINFO_REQD", BtVersion)
pkglistbl3("TOOL_DEPENDS", BtDependencyWithPath)
syslist("TOOLS_ALIASES", BtFileName)
syslist("TOOLS_BROKEN", BtTool)
Index: pkgsrc/pkgtools/pkglint/files/vartype.go
diff -u pkgsrc/pkgtools/pkglint/files/vartype.go:1.30 pkgsrc/pkgtools/pkglint/files/vartype.go:1.31
--- pkgsrc/pkgtools/pkglint/files/vartype.go:1.30 Sat Apr 20 17:43:25 2019
+++ pkgsrc/pkgtools/pkglint/files/vartype.go Sun Apr 28 18:13:53 2019
@@ -29,6 +29,11 @@ const (
UserSettable
SystemProvided
CommandLineProvided
+
+ // NeedsRationale marks variables that should always contain a comment
+ // describing why they are set. Typical examples are NOT_FOR_* variables.
+ NeedsRationale
+
NoVartypeOptions = 0
)
@@ -87,6 +92,7 @@ func (vt *Vartype) PackageSettable() boo
func (vt *Vartype) UserSettable() bool { return vt.options&UserSettable != 0 }
func (vt *Vartype) SystemProvided() bool { return vt.options&SystemProvided != 0 }
func (vt *Vartype) CommandLineProvided() bool { return vt.options&CommandLineProvided != 0 }
+func (vt *Vartype) NeedsRationale() bool { return vt.options&NeedsRationale != 0 }
func (vt *Vartype) EffectivePermissions(basename string) ACLPermissions {
for _, aclEntry := range vt.aclEntries {
Home |
Main Index |
Thread Index |
Old Index