Changes since 4.49:
- Added checks for shell commands whose exitcodes are ignored.
- Added checks for CFLAGS, CPPFLAGS and CXXFLAGS.
- Improved diagnostics.
- Various bugfixes.
Changes to lintpkgsrc:
- Avoided double occurrence of pkg_install.
Changes since 4.48:
- Added a check for .include lines in all Makefiles and *.mk files to make
sure that only existant files are referenced and that pkgsrc packages do
not contain references to packages in pkgsrc-wip.
- Extended the --autofix option to all Makefile* and *.mk files. Before, only the
package Makefile could be fixed.
- Rewrote the detection of direct use of tool names.
- Append-only lists may be initialized using the "?=" operator.
- The typical form of ShellWords for CONFIGURE_ARGS, --foo=${FOODIR}, is checked for
quoting errors.
- All PKG_OPTIONs are checked whether they are documented in mk/defaults/\
options.description.
- Many small fixes and improvements.
Changes since 4.46:
- Made the --explain command line option work.
- Added many explanations for existing diagnostics.
- Improved the diagnostics.
- In --autofix mode, no backup files are created anymore.
- Temporarily disabled the check for direct use of tool names.
- Fixed some false positive warnings.
- Added a check for the use of absolute pathnames in shell commands.
- Added the $line->replace() method for a convenient way to achieve simple
autofix tasks.
- When autofixing, no backup file is created (it had been created before).
1. Usually "cvs diff" is available.
2. All current autofixed changes are trivial.
3. The fixed file is first written to disk in a new file and then renamed
to the original file, greatly reducing the risk of data loss.
- Fixed a bug in checkdir_package(): In the call to load_package_Makefile(),
the last parameter had not been passed by reference, but by value.
Luckily this had not influenced any other part of pkglint.
- While there, I noticed that it is not necessary to pass some subroutines
the lines of all included Makefiles, so I removed that parameter.
Changes since 4.45:
- Added the type ShellWord.
- Added quoting checks for variables that are appended to a
List of ShellWord.
- Multiple -v increase the verbosity.
- The --autofix option is no longer undocumented, but still experimental,
as this is the only part of pkglint that can modify external files.
- Added an --explain option that provides additional help for the
diagnostics.
- Added checks for unportable CPP macro names in patches.
- Updated the documentation.
- Added detection of redirection operators and comments to the
regex_shellword constant.
- Changed the naming conventions for list data types. Now List simply
means a list. List+ means a list that should only be modified using
"+=", not "=". List! means an internal list. And List!+ is the
combination of both.
The distinction is necessary because of the introduction of
redirection operators in the regex_shellword. When checking the data
type of list elements, the lists are split up into shell words instead
of simply using split(). This leads to much better results.
- When splitting a variable value or shell command into words, anchor the
regular expression at the beginning of the string.
- Removed log_subinfo().
- Added log_debug().
- Multiple -v command line options increase the verbosity.
- Added the regex_shellword constant that will allow better parsing of
shell commands. Currently it is only producing debugging information.
- Long [info] messages have been changed to [debug] messages.
- Added a new type ShellWord that is used for MAKE_ENV and the like to
check for invalid FOO="${VALUE}" additions. They really should be
FOO=${VALUE:Q}, as they may already contain embedded quotes. This is
especially important for CPPFLAGS and CFLAGS.
- Fixed perl -T warnings:
- Replaced $#{@{$lines}} with $#{$lines}.
- Avoided calls to external programs (sed and digest).
- Removed redundant warning if DISTNAME is set to an invalid package name
and PKGNAME is not defined.
- Changed dependency from pkgtools/digest to security/p5-Digest-SHA1.
Changes since 4.43:
- Removed the remaining code that had been imported from FreeBSD's
portlint.
- Removed the (undocumented) -Wvague option.
- Removed the -Wexec and -Wparen options. The latter had no effect at all,
and the former cannot lead to false positives, so it is always enabled.
- Variable names starting with an underscore are reserved for internal
pkgsrc use.
- Added some more type checks.
- Renamed the type Dependency to DependencyWithPath.
- Added new types Dependency, PlatformTuple and RelativePkgDir.
- Added some of the common variables to the list of typed variables.
Changes since 4.42:
- Reduced the number of duplicate diagnostics when checking multiple files.
Only diagnostics concerning the current package are printed.
- Added checks for EXTRACT_SUFX and PKG_INSTALLATION_TYPES.
- Added a work-around for the PHP patches warnings.
- PERL5_PACKLIST should not contain references to other variables.
- Added the -s|--source command line option to show the code along with the
diagnostics.
- Fixed a bug in get_logical_line(); logical lines have not had their
physical lines attached.
- Deprecated variables are not only checked when they are defined but also
when they are used.
- Added a check that PERL5_PACKLIST does not contain references to other
variables. Some packages have ${PERL5_SITEARCH} in it, which results in
a double slash, and the CHECK_FILES framework cannot handle this.
Changes since 4.41:
- In .mk files, line continuations are properly handled.
- An open bracket is allowed in variable and tool names.
- Added checks for ALTERNATIVES and INSTALL/DEINSTALL files.
- By default, don't check files in ${FILESDIR}.
- Warn about unknown file and directory names.
- Documented the --recursive option.
- Added an option -Cmk for checking .mk files besides buildlink3.mk.
- pkglint can handle individual files on the command line, not only
packages. (experimental)
- Replaced checkfile_buildlink3_mk() with checkfile_mk().
- Factored out the checkfile() subroutine from checkdir_package().
since the pkglint Makefile sets MANINSTALL but shouldn't, as this
variable is intended to be user-defined. This is only a work-around,
which needs to be addressed properly for the other packages setting
MANINSTALL, too.
- Removed all references to the build-time pkgsrc directory, ${PKGSRCDIR}.
This makes the binary package independent of the build location.
Fixes PR 32006.
Changes since 4.38:
- Disabled the check on Makefile variable order, as the discussion on
tech-pkg has not finished yet.
- Improved detection of valid tool names.
- Improved detection of direct use of tool names. (Less false positives.)
- Improved the diagnostics for direct use of tool names.
- pkglint(1) does not use the hard-coded PKGSRCDIR anymore.
This fix is related to PR 32006, but doesn't fix it, since the PR is
about lintpkgsrc(1), not pkglint(1).
- It is an error if packages define a variable whose name starts with an
underscore.
- Removed the (vague) "wip" check, as it has been replaced by special checks for
DEPENDS and .include directives.
- Disabled the check for variable ordering until the discussion on tech-pkg
has led to any results.
- PKGNAME is checked for being a valid package name.
- PLIST files should not contain filenames that match */CVS/*.
- Completely rewrote the check for variable ordering. The new code
operates on a data structure that's easily understandable and
extendable (see the source for an example). It also generates greatly
improved diagnostics. As the old code had been enabled only when
checking with -Wvague or -Wall, it has been seldom used anyway.
- Removed the hard-coded values for valid tool names.
The detection is good enough.
- Make sure that the domain part NetBSD.org is written like this
in mail addresses.
- Added checks for TOOL_* variables.
- Added {pre,do,post}-extract to the list of valid stages.
- Fixed the regular expression for detecting tool names.
- Added a check for invalid syntax in tool names.
- Improved the diagnostic for enumerations.
- Added many of the variables found in pkgsrc/mk/* to makevars.map.
- Added the function log_fatal, whose output goes to stderr instead of
stdout.
- All files in pkgsrc/mk/ are excluded from checking, as they may use
private variables and do other questionable things.
- Removed the Language type, as it is a simple enumeration.
- Added the Userdefined type to distinguish user-definable and read-only
variables.
Implemented checking for enumeration types. Added new types Filemask,
Filename, Language, Option, Pathmask, Pathname, Stage, Varname and
WrksrcSubdirectory. Made the check for URLs stricter. Added some
variables to the makevars.map file.
Removed the -Wworkdir option. Added an --import option that replaces
-Wworkdir. Changed the warning about uncleaned work* directories into an
error. Updated the man page.
Fixed the --autofix handling of category Makefiles. Added an --import
option that helps importing packages from pkgsrc-wip. When checked with
--import, the package is checked as if it weren't part of pkgsrc-wip.
Fixed undefined behavior when reading a file that ends in a continuation
line. Any use of ${WRKSRC}/.. is considered an error, as ${WRKSRC} is
meant to point to the top of the build directories. A proper combination
of WRKSRC, CONFIGURE_DIRS and BUILD_DIRS should be used instead. Sorted
the makevars.map file and added SUBST_CLASSES.
The --autofix support has been rewritten to be more easily usable.
Automatic fixes are currently restricted to the sort order of SUBDIR
entries in category Makefiles. It had been the complete category
Makefile before. Added a new diagnostic, prefixed with "NOTE:", that is
used for important informational diagnostics, for example autofixed
files.
possible and base all other checks on the logical lines. The physical
source lines are saved literally to make implementing the --autofix
option easier.
Changed the names of the datatypes (Yes_Or_Undefined => Yes, Boolean =>
YesNo, Integer => PkgRevision) in makevars.map. It is now an error if
PKGREVISION appears outside a package Makefile. Improved detection of
Makefile.common. Improved wording of the warning for relative
directories in the form ../package.
Rewrote the typechecking code for Makefile variables. The variable
definitions are extracted from logical lines instead of physical lines,
comments are separated from actual values, for Lists of something, each
something is checked. All URLs are subject to MASTER_SITES expansion.
MASTER_SITES is checked to be a List of URLs.