Changes since 19.3.2:
The rationale for variables like BROKEN, GCC_REQD and for direct
inclusion of builtin.mk files may span multiple lines, and it may end
with an empty comment line.
Changes since 19.3.1:
* Pkglint no longer warns about a missing :Q modifier if there is also
a :D modifier, since the latter hides the original variable value
from the expression value.
* Variable names like .CURDIR are now allowed in the _VARGROUPS section.
* In dependency lines like "${_COOKIE.extract}:", pkglint no longer
warns about the unknown target. No matter whether this is a file name
or even a list of other targets, there's no chance for a typo here.
* If some dependencies are included conditionally, and the package
Makefile and buildlink3.mk disagree, and the conditions depend on
PKG_OPTIONS, pkglint outputs a helpful explanation.
* The check for including builtin.mk directly can be disabled by giving
a reason in a comment at the end of the line.
Changes since 19.3.0:
* In buildlink3.mk files, the package identifier doesn't have to match
the PKGBASE from the package Makefile exactly. The PKGBASE may have a
leading "lib" (for libiconv and libgettext), as well as a trailing
number (for emacs20 and netatalk22).
* GITHUB_RELEASE is added to the variables that should appear in a fixed
order in the package Makefile.
* In the MASTER_SITE URLs, the transport protocol is irrelevant for
matching direct URLs to the predefined MASTER_SITE_* variables.
Changes since 5.7.24:
* There is no need to ask the dummy MAINTAINER from url2pkg whether
committing changes is ok.
* When autofixing a condition like !empty(PKGPATH:Mliteral), don't
generate unnecessary parentheses around ${PKGPATH} == literal.
* In a _VARGROUPS section, the public variables should be listed
before the private variables, to put important things first.
* When pkglint suggests to be run again with the -e, -fs or -F options,
repeat the whole command line, to allow for copy-and-paste.
* The checks for PKGPATH are fixed and enhanced. It is not a relative
path like in ../../category/package, but relative to the pkgsrc root.
* Unintended file globbing in sed commands such as s,.*,any, gets a
warning.
* MASTER_SITES should normally end with a slash, in rare cases an
equals sign or a colon are correct, too.
* Detect redundant directories in INSTALLATION_DIRS.
Changes since 5.7.23:
* Improved the _VARGROUPS check for ignored variables
* Removed wrong warnings for variable expressions like ${VAR:Dyes:Uno}
* Used correct terminology for the :Q modifier (it's not an operator)
Changes since 5.7.22:
* Added a warning for lines that look empty but are actually follow-up
lines from a previous line.
* Added notes for unusual placement of the continuation backslash. It
should always be preceded by a single space or tab, or be in column
73.
* Improved check for needlessly complicated !empty(PKGPATH:Mcat/pkg)
that is transformed into the simpler ${PKGPATH} == cat/pkg, even if
the package name contains hyphens, dots, plus or slashes.
* Added check for the _VARGROUPS section since that section contains
many redundancies that can easily be checked. For example, in
mk/compiler/gcc.mk the _VARGROUPS section is 67 lines long and
contains far more than 100 variables. It's tedious to manually check
this file for internal consistency. That's better left to pkglint.
* The empty variable is no longer flagged as "used but not defined".
It appears in expressions like ${:Ustring}.
* When --source is combined with --explain, don't unnecessarily
repeat the source code for a single line if there are several
diagnostics. Instead, even omit the empty line between the diagnostics
for the same line.
Changes since 5.7.21:
* The files from wip/mk do not belong to the main pkgsrc infrastructure.
Therefore, when loading the package Makefile to look for defined but
unused variables, parsing doesn't stop in these files.
Changes since 5.7.21:
* The files from wip/mk do not belong to the main pkgsrc infrastructure.
Therefore, when loading the package Makefile to look for defined but
unused variables, parsing doesn't stop in these files.
Changes since 5.7.20:
* PKG_OPTIONS that are handled using patterns are correctly identified.
* Simple R packages should follow the canonical variable order.
* Fixed some edge cases for aligning variable assignments.
* Improved detection of allowed values for USE_LANGUAGES.
Changes since 5.7.18:
* The tricky construct for generating case-items from a Make variable
no longer produces parse errors. Example:
case $$expr in ${PATTERNS:@p@ (${p}) action ;; @} esac
Changes since 5.7.16:
* The warnings for doc/CHANGES are only enabled when the -Cglobal option
is given. This is to avoid warnings that are unrelated to the package
that is being checked.
Changes since 5.7.15:
* Completely rewrote the code for aligning multiple variable assignment
lines. It works on the actual lines of the file now instead of the
parsed lines. This provides more exact diagnostics and also makes the
handling of these lines easier so that future requirements can be
implemented more easily.
* Added support for exotic conditions in .if clauses. These conditions
are not seen in the wild though.
* Fixed wrong diagnostics for ALTERNATIVES files that appear
conditionally in the PLIST.
* As always: lots of refactorings and newly added tests.
Changes since 5.7.14:
* Added a check for packages that have been removed from the file system
but not been recorded in doc/CHANGES. This will help produce more
accurate release statistics.
* Small refactorings, as usual.
Changes since 5.7.13:
- Removed the -Cextra command line option since it didn't produce useful
warnings.
- Removed unwarranted warnings about _WRAP_EXTRA_ARGS.CC being used in
packages.
- Cleaned up the canonical order of variables in package Makefiles.
- Added a few commands to those that cannot fail, to reduce the number of
"at the left of the | operator" in shell programs.
- Fixed warnings about "-ggdb" being an unknown shell command.
- Reduced number of warnings about lists being used where a single value
is expected.
- Replaced unreliable check for invalid CFLAGS and LDFLAGS with a more
practical check.
- Renamed "RCS tag" to "CVS tag" to make the diagnostics more modern.
- Added warning when PKGNAME or PKGVERSION is used in MASTER_SITES.
- Reworded warning for missing or superfluous PLIST files.
- Lots of other detail changes, refactorings and automatic tests.
Changes since 5.7.12:
* Fixed a warning in the variable permissions that previously said "this
variable should not be used at load time in this file, it would be ok
in .", with an empty list of alternative files.
* Lots of refactoring and new tests.
Changes since 5.7.9:
* Fixed URL checking for MASTER_SITES, especially remove the wrong error
message about URLs of the form ${MASTER_SITE:S,^,-,:=subdir/}.
* Made warnings about invalid filenames, filename patterns, pathnames and
pathname patterns more detailed.
Changes since 5.7.8:
* Buildlink3.mk files are checked for typos in the identifier that is
used for BUILDLINK_TREE, to detect copy-and-paste mistakes.
* Having a rationale is recommended for some variables, especially those
that make a package fail to build or crash at runtime. This check is
only active when -Wextra is given, since it is still actively debated
whether such a check is actually useful.
* Files called Makefile.php can easily be mistaken to be PHP files.
Therefore the recommended naming convention is to have auxiliary files
called *.mk. There are already many more files called *.mk than those
being called Makefile.*.
* The check for unquoted sed substitution commands has been made more
detailed, but since it is completely disabled, there's nothing to see
for now.
* The definitions for MASTER_SITE_* are loaded directly from the pkgsrc
infrastructure instead of hard-coding them in pkglint.
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.
Changes since 5.7.6:
Warn about packages that override user-settable variables. Packages that
define variables with the same value as the default value only get a
note instead of the warning since these definitions do not cause any
confusion.
Do not suppress technical error messages in autofix mode.
Do not warn about the package version being greater than the latest from
doc/CHANGES if the file defining the package version has been modified
locally and is about to be committed.
Changes since 5.7.5:
* The explanation for distfile hashes is only given when the distfiles
actually need to be downloaded. If they are already there, no
explanation is necessary.
* Makefile lines that are commented and have line continuations are
properly parsed. This affects the autofix for variable value
realignment.
* Variable permissions are not checked in hacks.mk since pkgsrc
developers who know about hacks.mk probably know what they are doing.
From hacks.mk files, builtin.mk files may be included directly, for
the same reason.
* Expressions of the form !empty(PKGPATH:Mpattern), when PKGPATH is not
a list variable and pattern has no wildcards, can be written in a
simpler form, and pkglint autofixes this. For example the above
expression is transformed into ${PKGPATH} == pattern. This
transformation reduces the amount of double negations (!empty) in the
code.
* Duplicate warnings about invalid relative ../package have been merged.
* TOOLS_ALIASES are properly resolved. The line USE_TOOLS=ggrep makes
the tools grep, egrep and fgrep known to pkglint, in the same way as
in the pkgsrc infrastructure.
* The diagnostics for missing or unnecessary distinfo files have been
improved to provide some guidance.
* Packages that use MESSAGE_SRC to build the message from multiple files
no longer produce a warning for malformed message files. These files
are simply skipped.
Changes since 5.7.4:
* Warn about invalid variable uses in directives like
.if and .for
* Do not warn when a package-settable variable is assigned using the ?=
operator before including bsd.prefs.mk. This warning only makes sense
for user-settable and system-provided variables.
* The parser for variable uses like ${VAR:@v@${v:Q}} is more robust now,
which reduces the number of parse errors and leads to more appropriate
diagnostics, in cases like ${URL:Mftp://*}, which should really be
${URL:Mftp\://*}.
* The valid values for OPSYS are now determined by the files in
mk/platform instead of allowing arbitrary identifiers. This catches a
few instances where "Solaris" is used instead of the correct "SunOS".
* Setting USE_LANGUAGES only has an effect if mk/compiler.mk has not yet
been included. In all other cases, pkglint warns now.
* Missing entries in doc/CHANGES produce a note now. This will lead to
more accurate statistics for the release notes.
Changes since 5.7.3:
* Warn about dependency patterns that are missing a version number,
such as ${PYPKGPREFIX}-sqlite3:../../databases/py-sqlite3.
* Suggest to replace the := assignment operator with the :sh modifier,
in some cases where the variable is not obviously used at load time.
Changes since 5.7.2:
PLIST files are checked for non-ASCII characters. Even though pkgsrc
sets up the environment with LC_ALL=C, there are still some cases
of encoding errors. The case discussed on the tech-pkg mailing list
was lang/go112.
The checks for variable permissions ("may not be set in this file")
have been reworked completely. Many of the variable permissions had
different rules for Makefile and Makefile.common. These different
rules tried to prevent accidental overwriting of variables. Starting
in July 2018, pkglint got a check for redundant variables that is
far more accurate than the previous variable permissions. Therefore
these fine-grained permissions are no longer necessary. This removes
a few hundred wrong warnings about insufficient permissions.
The check that adds missing SHA512 hashes to distinfo files has been
fixed to work correctly in DIST_SUBDIR cases.
Improved the checks regarding tools that are used by a package but
not added to USE_TOOLS. For example, the "make" tool is always
available, as are all tools that are added to TOOLS_CREATE.
Lots of small improvements, as always.
Changes since 5.7.1:
* Fixed detection of GNU_CONFIGURE=yes combined with USE_LANGUAGES
missing c. This combination tends to fail in the configure phase.
* When the distinfo doesn't contain all hashes for the downloaded
distfiles (typically SHA512 is missing) and the distfiles are actually
downloaded to ${PKGSRCDIR}/distfiles, pkglint can now add the missing
hashes. It only does this if there is at least one existing hash
and if all existing hashes are correct.
* The check for redundant variables has been improved considerably.
Before there were several situations in which pkglint didn't get the
redundant variable definitions right because its internal model only
mimicked reality. The model has been improved and so have the
diagnostics.
* Pkglint only warns about wrong permissions (for defining or using
a variable) when it knows the type of the variable and the permissions
for the current file. Before, it had also warned if the permissions
for the current file were not explicitly defined.
* CFLAGS and LDFLAGS may be appended in buildlink3.mk files. This
had been disallowed before, for no apparent reason. There are several
places in pkgsrc where especially CFLAGS.${OPSYS} is appended to.
* Cleaned up internal handling of relative paths. Previously pkglint
sometimes resolved relative paths using the wrong base directory,
which led to all kinds of wrong warnings and strange behavior.
* Fixed lots of edge cases when parsing Makefile lines. These cases
don't occur often but experience tells that the most fundamental code
must be as correct as possible (see the handling of relative paths
above).
* Lots of refactoring and housekeeping, as always.
Changes since 5.6.12:
* Many of the -C and -W command line options have been removed since
they are not used in practice. The -Wall and -Call options continue
to work though; these are the only options mentioned in the pkgsrc
guide.
* When a PLIST file contains redundant libtool libraries (.la and the
corresponding .so), there is only a single warning per file.
* Warnings about the package COMMENT are now strictly ordered from left
to right.
* The hashes for all distfiles must now contain the SHA512 hash. This
hash has been added to many distfiles in 2015. It's time now to
enforce it on all other distfiles as well.
* Makefile fragments that are included inside an .elif exists(...)
are not reported as missing.
* The check for redundant variables and accidentally overwritten
variables has been improved. Now the warning occurs at the later
definition. This especially applies to cases where a file is included
and after that, some of its variables are overridden. Variables in
unrelated files are no longer marked as redundant.
* When a package contains multiple definitions of a single variable
(typical for Makefile.common), the later definition overrides the
earlier definition. That way, the location of DISTINFO_FILE and
PATCHDIR is resolved correctly.
Changes since 5.6.11:
* In buildlink3.mk files, print the paths relative
to the line, not to the pkgsrc root.
* When explaining that a variable cannot be set/used because of wrong
permissions, list the permissions. This provides more transparency
than just stating that the desired action is not allowed.
* When pkglint checks a pkgsrc-wip package, don't warn about malformed
lines in doc/CHANGES-* since pkgsrc-wip users typically cannot do
anything about these errors.
* In profiling mode, not only the code coverage and the performance
statistics are dumped, the whole heap is also dumped to see which
parts of pkglint consume the most heap memory. Pkglint now needs
less heap memory than before, which mainly affects full scans.
* The checks for absolute pathnames have gone. They were of questionable
value since pkglint has failed to give proper advice on how to fix
them properly, at least for the last 12 years.
* The check that pkgsrc-wip packages should only use exact CVS Ids
(the unexpanded variant) has been disabled again. It occurred about
16000 times but even fixing it wouldn't improve anything since it
was mostly a formatting issue without any practical consequences.
* Warn about trailing variable modifiers like in ${VAR:S,from,to,extra}.
* Properly parse ${VAR:!command!}.
* Suggest to replace SUBST_SED with SUBST_VARS where possible, even
with complicated shell quoting. Pkglint can autofix most of these
overly verbose cases.
* Load builtin.mk whenever the corresponding buildlink3.mk file is
included. This fixes several warnings about undefined variables
(especially for packages using OpenSSL).
* Parse .for lines like bmake does since 2015, splitting words like
in brk_string.
* Optionally show a warning even if it cannot be autofixed by pkglint.
This is useful for the SUBST_VARS replacement since even when
pkglint cannot automatically replace the code, there are still cases
where it can warn at least.
* As always, several refactorings.
Changes since 5.6.10:
* Improved the wording of several warnings
* Fixed parsing of complicated dependency patterns such as
{ssh{,6}-[0-9]*,openssh-[0-9]*}. Pkglint still doesn't understand
them but at least it doesn't mark them as "unknown" anymore.
* Lots of refactoring, as usual. This is the last part of the big
refactoring, therefore future changes to pkglint are expected to be
smaller than in the previous 3 months.
Changes since 5.6.9:
* ALTERNATIVES files are correctly checked now. Before, pkglint had
suggested to remove the @PREFIX/ from the alternative, which was
wrong and simply didn't work.
* Diagnostics about variable assignments are ordered to report the
left-hand side first and then everything to the right of the
assignment operator.
* The pkglint output is escaped properly to avoid sending unwanted
escape sequences to the terminal.
* The items in .for loops are parsed taking "double" and 'single'
quotes into account since bmake does it in the same way since 2015.
* In DESCR files, overly long lines are only warned about if they
contain a space and therefore can be made shorter.
* In DESCR files, text like ${PREFIX} only gets a note if it refers
to a commonly known pkgsrc variable. This avoids distraction when
a package mentions ${prefix}/bin or ${template.property}.
* Lots of refactorings and small changes.