Changes since 20.2.0:
Don't warn about a possibly redundant PKGNAME=${DISTNAME} assignment if
PKGNAME is defined somewhere else in the package Makefile.
Warn if NO_CONFIGURE=yes and REPLACE_* are combined.
Suggest to replace ${VAR:@l@-l${l}@} with the simpler ${VAR:S,^,-l,},
as well as ${VAR:@l@${l}suffix@} with the simpler ${VAR:=suffix}.
Allow lua in CATEGORIES.
Changes since 20.1.17:
Fixed the algorithm for checking whether two patterns overlap, such as
MACHINE_PLATFORM:MNetBSD-[0-9].*-*.
Fixed wrong warning about foreign variable in SUBST block, as seen in
geography/qgis.
Changes since 20.1.15:
When a package adds an additional version requirement for another
package, it must do so using BUILDLINK_API_DEPENDS instead of
BUILDLINK_ABI_DEPENDS. Most packages already do this.
When a values is appended to an undefined variable using the += operator,
bmake does not add a space before, and pkglint caught up to do the same.
This change has no practical consequences though.
As always, a bit of refactoring. The method names of MkAssignChecker
contained the redundant word "varassign".
Changes since 20.1.14:
Fix confusing wording of diagnostic "should contain text". It's more
precise to say "this line should consist of this text". Otherwise it's
too easy to interpret it as "the text should occur somewhere in the
line".
Allow BUILDLINK_PREFIX.* to be used in helper files. Especially for
programming language packages, files like plugin.mk often include
buildlink3.mk and therefore may refer to the BUILDLINK_PREFIX of this
package.
Warn about redundant BUILDLINK_API_VERSION restrictions. Previously, the
check had only been enabled if the operators from the default dependency
pattern (buildlink3.mk) and the additional dependency pattern (package)
used the same operators, which already covered most practical cases.
Determine SuSE versions from the pkgsrc tree.
Changes since 20.1.13:
Packages that don't define DISTNAME probably don't download any files
and thus may not need a distinfo file. (There are several other
conditions involved in this, though.)
When reporting wrong distinfo hashes, always report them in the order in
which they appear in the distinfo file, not by hashmap order.
Fix panic when parsing the Makefile line "./=value", which according to
bmake is a variable assignment. This is not used in practice though.
Disallow a leading hyphen in package option names. There are only very
few packages that wrongly use these option selectors in
PKG_SUGGESTED_OPTIONS.
Distinguish between a tool dependency (USE_TOOLS) and a plain tool name
(TOOLS_NOOP, TOOLS_BROKEN, TOOLS_FAIL). Allow packages to add arbitrary
tools to these lists.
Changes since 20.1.11:
The file bsd.pkg.mk must only ever be included by package Makefiles
directly, not by other Makefile fragments. Seen in www/w3m.
The variable BUILDLINK_PREFIX.* should only be used for packages that
have actually been included by the package. This catches the use of
BUILDLINK_PREFIX.libiconv, which should have been iconv instead.
Allow comments before line 3 in buildlink3.mk files. This is necessary
for mariadb55-client since its buildlink identifier is mysql-client,
which is so non-obvious that it needs to be documented.
Changes since 20.1.10:
PKG_SYSCONFDIR and VARBASE must not appear in INSTALLATION_DIRS.
Patch files in which the line number have been edited manually are marked
with notes.
Changes since 20.1.8:
Recognize SUBST_NOOP_OK and SUBST_SHOW_DIFF.
Allow plain -Wl,-R and -Wl,-rpath in BUILDLINK_TRANSFORM, when they are
used to remove compiler options.
Recognize ggrep and other platform tools as valid tool names. Seen in
lang/rust.
Changes since 20.1.7:
There are about 300 cases where a package defines a PLIST conditional in
PLIST_VARS but none of its PLIST files actually uses that condition.
These cases get a warning.
Changes since 20.1.5:
Category Makefiles must only list subdirectories in SUBDIR that actually
contain a package. There is no need to mention the other directories.
This is the same as in the top-level Makefile, where mk/ and regress/ are
not listed.
Packages from pkgsrc-wip may have a COMMIT_MSG file with a suggested
commit message for importing the package into main pkgsrc.
Changes since 20.1.4:
No more wrong warnings about the Solaris /bin/sh. These warnings had been
there for 14 years, preventing pkgsrc developers from using the $$(...)
command substitution and negation in shell conditions.
https://mail-index.netbsd.org/pkgsrc-changes/2020/05/01/msg212194.html
Changes since 20.1.3:
For patches that patch a single file, the filename of the patch should
correspond to the patched file. There are a few different naming schemes
in action, therefore the check is relatively loose. Patches that are
called patch-[a-z][a-z] continue to be allowed for historic reasons.
Patches that are called patch-CVE-* are also allowed.
The entries in doc/CHANGES-* are checked for consistency. For example,
it doesn't make sense to add a package twice or "update" a package from
version 1.0 to version 1.0. All version numbers in these entries must
be valid pkgsrc versions, i.e. start with a digit and only use
characters from -.0-9A-Z_a-z.
Changes since 20.1.2:
Stricter check for Python version numbers. Before, 25 and 26 had not
been marked as wrong.
In assignments like PKGNAME=${DISTNAME:S,from,to,}, modifiers that don't
have any effect generate a note. Most of these modifiers are redundant
or outdated.
Patches must not add well-known absolute paths like /usr/pkg, /var and
/etc since these must be overridable by the pkgsrc user. Other absolute
paths continue to be allowed.
Changes since 20.1.1:
Ensure that relative paths to other packages have the canonical form
../../category/package.
Add notes about pathname patters that mention ${WRKSRC} even though they
are already defined to be relative to WRKSRC.
Fix check for redundantly added categories. The check had previously
reported that the included file would be redundant, which was wrong.
It's always the including file that provides the redundancy.
Changes since 20.1.0:
In UNLIMIT_RESOURCES, the recently added virtualsize is allowed.
Packages that have distfiles without any digit in their name should
define DIST_SUBDIR to avoid polluting the global namespace. The
top-level distfiles directory should only contain versioned filenames.
Changes since 19.4.13:
It is an error to have TODO lines in DESCR files. These are typically
generated by url2pkg and should be replaced with proper text before
committing the package.
Changes since 19.4.12:
Files that are mentioned redundantly in PLIST files generate an error.
Missing DESCR files generate an error.
Hard-coded /usr/pkg in patches generates an error.
Changes since 19.4.11:
Redundant additions to BUILDLINK_API_DEPENDS and BUILDLINK_ABI_DEPENDS
get warnings since they may have been needed in the past but the
dependent package has increased its required version numbers over time.
Changes since 19.4.10:
The use of PKG_OPTIONS and PKG_BUILD_OPTIONS in buildlink3.mk and other
files is checked for common mistakes.
Checking the indentation of a continuation line no longer crashes in edge
cases.
Changes since 19.4.9:
In continuation lines with long values, pkglint no longer suggests to
move the continuation backslash in the middle of the variable value, as
that would be impossible.
Warn when a shell command is assigned to a variable that only takes
pathnames. Shell commands can contain command line options, and these
are not pathnames.
The TOOLS_PLATFORM.tool variables are not defined on every platform.
When these variables are used outside an OPSYS check, a warning lists
the platforms where the tool is undefined or only defined conditionally.
Changes since 19.4.8:
Packages that include omf-scrollkeeper.mk even though their PLIST doesn't
contain any .omf files will generate an error message, suggesting that
the .include line be removed.
Changes since 19.4.7:
The diagnostic for homepages using FTP is simpler now.
When running pkglint recursively on the top-level directory, the
inter-package checks (distfile hashes, unused licenses) are enabled
implicitly. This way, the only effect of the -Cglobal option is now
whether the pkgsrc infrastructure files are checked as well.
The check for removed packages that have not been recorded in
doc/CHANGES prints the correct lines when pkglint is run with the
--source option.
Fatal technical errors are no longer treated as diagnostics since they
are none. That was an early conceptual mistake, but since these fatal
error didn't happen often, it didn't matter.
In diagnostics, when referring to other lines, the previously used words
before/after have been replaced with above/below to avoid any confusion
whether space or time is meant.
In CONF_FILES, spaces and quotes are allowed.
See https://gnats.netbsd.org/42191.
Fixed unintended side-effects when running pkglint --autofix --only.
Before, all fixes were applied to the file, whether or not they matched
the --only option.
Fixed resolution of relative paths of the form ../../category/package
when they appeared in an infrastructure file.
Lots of refactorings and housekeeping, as usual.
Changes since 19.4.6:
HOMEPAGE definitions that use http no longer get a warning that they
should migrate to https. Those that could be migrated have been migrated,
and the remaining homepages are not yet ready, so there's no benefit in
having this warning by default. Only in --network mode and when the https
site is indeed reachable, the warning is shown.
In long continued lines, the continuation backslash should be preceded by
a single space. Pkglint had wrongly removed that space in a few cases
before.
Changes since 19.4.5:
Added the --network option, which allows pkglint to use HTTP calls for
determining whether the homepage of a package is reachable.
Added migration from http URLs to the corresponding https URLs. This is
only done if the https URL is indeed reachable or well-known to support
https.
Added migration from https SourceForge URLs back to http URLs since a
previous pkglint run had migrated URLs to non-working https URLs. See
https://mail-index.netbsd.org/pkgsrc-changes/2020/01/18/msg205146.html.
Added a warning for HOMEPAGE that uses ftp:// since that is not
user-friendly. In the same way, download-only host names on SourceForge
are not suitable as a homepage since they usually only generate a 404.
Changes since 19.4.4:
Fixed automatic replacement from http SourceForge URLs to their https
counterparts. According to their official documentation, the https URLs
are not on the same hosts as before, but on *.sourceforge.io.
Changes since 19.4.2:
PLIST_VARS identifiers must not contain characters that are interpreted
specially in regular expressions.
All pkgsrc text files except for doc/pkgsrc.{html,txt} must use the
default CVS keyword substitution.
Changes since 19.4.1:
Fixed variable resolution. Before, variables that had not been defined
in an included file could still end up in the scope of the package,
which made many of the pkglint checks unreliable.
Each condition that is used in the PLIST should be defined somewhere in
the package Makefile or its included files.
When loading a package Makefile, hacks.mk is loaded implicitly at the
end, just as the pkgsrc infrastructure does in mk/bsd.hacks.mk.
Changes since 19.4.0:
The notes for inserting an empty line have been changed from "insert
after this line" to "insert before this line" to make the line numbers
in the diagnostics contiguous. There had been several places where the
diagnostics went from line 1 to line 2 and then back to line 1, which
was confusing.
The lines in ALTERNATIVES files are checked for trailing whitespace.
This is only for consistency with the other checks. In the whole pkgsrc
tree all ALTERNATIVES files are already fine.
The diagnostics for comments in .endif/.endfor lines that don't
correspond to their .if/.elif/.for counterparts now includes the exact
line number of the corresponding condition, to make the warning easier
to fix.
The diagnostics for wrong variable value alignment now mention the
current column in addition to the desired column, to make it easier to
see by how much and in which direction the indentation should be fixed.
Variables that are used in conditions before they are actually defined
need the :U modifier.
Changes since 19.3.19:
Empty PLIST files now generate an error instead of a warning since there
is no reason for having these empty files.
If a follow-up line in a Makefile is completely empty, there is no note
about trailing whitespace anymore since the warning about the misleading
empty line already covers this case.
The remaining code changes are only refactorings.
Changes since 19.3.18:
Small improvements to edge cases in SUBST blocks.
Small improvements to edge cases in variable assignment and alignment
of the continuation backslashes.
The --source option shows the changes from autofix, even when the
--show-autofix option is not given. This is a welcome side-effect of
making the autofix logging simpler and more predictable.
Changes since 19.3.17:
The SUBST check has been completely rewritten. It can handle several
SUBST classes at the same time now. This reduces the number of wrong
warnings.
Changes since 19.3.16:
Pkglint now handles SUBST blocks correctly, even those in which some of
the variables are defined conditionally. It correctly reports those that
are missing in at least one of the possible branches.
PKG_JVM is no longer marked as deprecated. It was once package-settable.
Since 2002 it is system-provided, and the package-settable counterpart
is PKG_JVM_DEFAULT. This does not fit into pkglint's simple model of
deprecating variables since the variable name is still valid, it should
just not be defined by packages anymore.
The alignment of variable assignments has been fixed in some edge cases.
In continuation lines where the backslash is beyond column 72, the
whitespace before the continuation backslash is fixed to a single space.
Changes since 19.3.15:
When a package-settable variable gets a default value using the ?=
operator, pkglint no longer suggests to include bsd.prefs.mk, since that
doesn't make sense. Including bsd.prefs.mk only defines user-settable
and system-provided variables.
User and group names may be a single character only. While not widely
used, it's syntactically valid and there's no reason to prevent this.
In variable assignments, when pkglint removes unnecessary whitespace
between the variable name and the operator, it keeps the indentation of
the variable value the same as before. Previously, the indentation had
been changed, which required another run of pkglint --autofix.
PREFIX can only be used as a replacement for LOCALBASE after the whole
package Makefile has been loaded. This is because PREFIX is defined
very late, by bsd.pkg.mk. Therefore, don't suggest to replace LOCALBASE
with PREFIX in .if conditions.
When pkglint suggests to replace INSTALL_DATA_DIR commands with setting
INSTALLATION_DIRS instead, paths with a trailing slash are correctly
looked up in the PLIST. This suggests to use AUTO_MKDIRS more often.
Changes since 19.3.14:
Invalid lines in PLIST files are now reported as errors instead of
warnings. If pkglint doesn't know about it, it must be an error.
In PLIST files, all paths are validated to be canonical. That is, no
dotdot components, no absolute paths, no extra slashes, no intermediate
dot components.
Fewer notes for unexpanded variable expressions in DESCR files. Before,
the text $@ was reported as possible Makefile variable even though it
was just a Perl expression.
README files are allowed again in pkgsrc package directories. There was
no convincing argument why these should be forbidden.
A few diagnostics have been changed from NOTE to WARNING or from WARNING
to ERROR, to match their wording.
When pkglint suggests to replace :M with ==, the wording is now "can be
made" instead of "should".
Changes since 19.3.13:
When pkglint suggests to replace !empty(VARNAME:Mfixed) with ${VARNAME}
== fixed, the exact suggested expression is now part of the diagnostic.
The check and the autofix have been improved. They now apply only to the
last modifier in the whole chain, everything else was a bug in pkglint.
Pkglint now knows the scope of variables better than before. It knows
the difference between variables from <sys.mk> like MACHINE_ARCH, which
are always in scope, and those from mk/defaults/mk.conf, which only come
into scope later, after bsd.prefs.mk has been included. It warns when
variables are used too early, for example in .if conditions.
The pathnames in ALTERNATIVES files are now checked for absolute
pathnames. This mistake doesn't happen in practice, but the code for
converting the different path types internally made it necessary to add
these checks. At least this prevents typos.
The special check for obsolete licenses has been removed since their
license files have been removed and that is checked as well.
Variables named *_AWK may be appended to.
The variables _PKG_SILENT and _PKG_DEBUG are no longer deprecated, they
are obsolete now. They are not used in main pkgsrc and pkgsrc-wip
anymore.
When a package sets a default value for a user-settable variable (which
is something that should not happen anyway), it should .include
bsd.prefs.mk before, in order to not accidentally overwrite the
user-specified value.
Variable modifiers of the form :from=to are now parsed like in bmake.
They are greedy and eat up any following colons as well. This means that
${VAR:.c=.o:Q} replaces source.c with source.o:Q, instead of quoting it.
Pkglint now warns about such cases.
The handling of relative paths in diagnostics is now consistent. All
paths that are part of a diagnostic are relative to the line that issues
the diagnostic.
Fatal errors are no longer suppressed in --autofix mode.
Plus lots of refactoring, to prevent accidental mixing of incompatible
relative paths.
Changes since 19.3.12:
The command line option -Wspace has been removed. Warnings and notes
about whitespace are now generated by default and cannot be switched
off. This is to ensure a consistent visual appearance of the package
Makefiles.
Shell programs that are indented unnecessarily deep generate a note by
default now. Before, the option -Wall was necessary to get these notes.
The check for unintended comments in multi-line shell programs is now
enabled again. It had been disabled some time ago as byproduct of a bug
fix in the shell parser.
The check for unique buildlink3 package identifiers now also works if
pkglint is run from a package directory instead of the pkgsrc root
directory.
Changes since 19.3.11:
The command line option -Wstyle has been removed since it didn't have
any effect.
License names may contain underscores. This fixes 3 parse errors and 2
wrong notes about seemingly unused licenses.
The parser for Makefile variables has been improved for some edge cases.
The :M and :N modifiers behave surprisingly when they contain unbalanced
parentheses or braces. Pkglint now parses them in the same way as bmake,
but doesn't warn since these cases are not actually used in pkgsrc.