pkgtools/pkglint. If a newer version is available, it outputs a note.
If the pkgtools/pkglint version is older than the currently running one,
it outputs an error, since it is not a good idea to check and old tree
with a new pkglint. Suggested by Alistair.
Changes since 4.57:
- New parser for patch files.
- New command line options -Wplist-depr and -Wstyle.
- Variable assignments are no longer allowed in variables that should only
contain identifiers.
- builtin.mk files must not be included directly.
- Better checks for sed commands.
- Some commands like ktrace should never appear in Makefiles.
- The package version is compared to the requested update in file doc/TODO.
affect the build process but are of more stylistic nature.
- Enabled the warnings on missing explanatory comments for patch files when
-Wstyle is enabled.
like *DIR, *PATH, *FILE, PKGNAME will never contain one of the $\"'`
characters. With greetings to Alistair, who convinced me that pkglint
need not be the most pedantic tool. (It will stay _very_ pedantic,
though. :))
- Be stricter when checking for Identifiers (e.g. BUILD_TARGET).
Variable assignments are not allowed here and should go to
BUILD_MAKE_FLAGS.
- Check for quoting in assignments to list variables.
- gettext-lib/builtin.mk must not be included directly.
- .orig files should not be in the PLIST.
context diffs as well as unified diffs and report much better warnings.
However, most of the warnings are currently disabled, as they are just
too many. It cannot parse ed diffs, but produces warnings for them.
- When listing binary packages with '-l', simplify logic and ensure if
a dependency is missing the package which required it is shown. Also
list all missing packages rather than stopping after the first
- If -n is given with -u do not
-
warnings are shown for this, as this would produce more than 20000 new
warnings for the current pkgsrc tree. You need to specify -Wplist-depr
(new) to see them. Of course, -Wall will work, too.
- Updated the documentation and cleaned it up.
it is checking is used in list context or in scalar context -- just
like in Perl.
- The :Q operator should only be used in list context or in shell commands.
Changes since 4.56:
- Added warnings for variables that are defined, but not used. This is a
simple spell-checker.
- Variables that appear as a single shell word should be quoted unless they
have the type "List of something".
- Many small enhancements.
quote even ${CC} and ${CXX}, which is wrong. The warning is not
printed for the other TOOLS, but that is only because the tool
variables have not been assigned proper types.
- Reduced the number of negations in a condition.
mode and very verbose mode are activated. Currently unused, but it's
handy to have it defined.
- Removed two subroutine calls that had resulted in duplicate warnings.
- Variables whose names end in _VAR may appear inside double quotes.
- add MAKEROOT_HOOKS, a whitespace separated list of functions
or external scripts to be executed after the sandbox is created,
- be more verbose about hooks execution,
- run hooks only when they are defined.
ok <jmmv>
Changes since 4.55:
- Avoided false positive warnings about bsd.prefs.mk being required before
using buildlink3.mk files.
- Restricted the files that are checked for absolute pathnames in patch
files.
- Some tools that are often used as ${TOOLNAME} need to be explicitly
added to the USE_TOOLS variable. When complaning about their direct
use, add a proper advice.
- Readded all the deprecated variables. The warnings will have to stay
longer than just three months.
force the developers to learn all pkgsrc changes every three months, so
it's better to keep the warnings for a much longer time. I don't know
yet what "much longer" exactly means.
assigned using the "?=" operator, since these variables are not meant to
be set by the user.
- Restricted the files that are checked for absolute pathnames in patch
files.
Changes since 4.54:
- -Wvarorder works now as expected.
- distinfo files are checked more strictly.
- Reduced the number of false positives.
- Make(1) variables of the form $(...) are detected properly.
${TOOL.${t}}. They just extend up to, but not including the next space or
quote character.
- log_debug() is used for printing debugging info, not log_error().
- Even if NO_CHECKSUM is set, distinfo files may exist if the package has
patches. Noted by salo.
- Added PkgLint::String::match_all.
- Make(1) variables of the form $(...) are detected properly.
- The shellword parser's state is printed in --debug mode.
- In double quoted strings, normal text is processed faster.
- The proof of concept for match_all is done with finding absolute
pathnames in patch files.
- Added PkgLint::Match, which represents the result of matching a regular
expression against a PkgLint::String.
- Fixed the arguments to substr in PkgLint::String::substring.
- Added PkgLint::String::match.
- Added a proof of concept in checkfile_patch, in the warning about RCS
tags. Run pkglint -s --klickibunti to see it.
Makefile is read in are logged to give further aid in debugging.
- Warnings about PKGNAME and DISTNAME are anchored at line numbers instead
of the package Makefile.
for the sake of compatibility tests in pkg_add.
E.g. DragonFly versions like
1.4.0-RELEASE
are reduced to
1.4.0
This code is currently enabled for DragonFly only.
- Fixed GCC 4.x build warning (which would have resulted in an error
with future GCC versions).
- Depend on newer version of "rpm" package to fix build under Mac OS X.
"extract" script for extraction. Many cases where a custom EXTRACT_CMD
simply copied the distfile into the work directory are no longer
needed. The extract script also hides differences between pax and
tar behind a common command-line interface, so we no longer need code
that's conditional on whether EXTRACT_USING is tar or pax.
Changes since 4.53:
- Added about 50 new variables to be type-checked.
- For unknown variables, the type is guessed from the variable name.
- In patch files that patch Makefiles, added lines are checked for
absolute pathnames.
- Replaced the -Wdebug option with --debug, so that the debugging warnings
don't show up when using -Wall.
- Many minor improvements.
latter has been removed.
- Added -Wvarorder (default: disabled) to check the ordering of variables
in simple packages.
- Using ${WRKSRC}/.. is only considered a warning, not an error, because
there are packages that work nevertheless. Using this construct remains
discouraged.
- Replaced most of the TODOs in the source code with code that prints
a warning in --debug mode.
- The characters '.' and '+' are allowed in BuildlinkPackages.
- Variables *_FLAGS and *_ARGS that have their type guessed based on the
name don't have to be assigned using the += operator.
- Variables that are assigned using the != operator are not checked for
type compliance.
- README files are not marked as unknown when they appear in a package
directory.
precision in checkfile_patch for the warning for context diffs.
- The --source option produces more condensed output than before.
- The diagnostics with character-wise precision are colored using
ANSI/VT100 color sequences. Support for other output formats will be
added later.
with the change from December 2005, when using this feature, care should
be taken for variables that are pre-quoted.
- In patch files that patch Makefiles, added lines are checked for
absolute pathnames.
- Added some variable types.
- For unknown variables, the type is guessed from the variable name.
- Added more checks for relative pathnames.
- Improved the shell parser once more.
When using non-native X11, xpkgwedge could be installed before imake
and host.def en up with just the xpkgwedge.def include. This means
that ProjectRoot as set by xorg's host.def is not used and wrong
path names are used. This run time dependency is the easiest way to
ensure proper order, but isn't perfect. Just providing a fixed host.def
and a secondary include file for Lesstif to modify breaks with
USE_XPKGWEDGE=NO, so keep the old approach.
Discussed with jlam@
Changes since 4.52:
- New warning categories "debug", "space", "quoting" that can be selected
independently.
- Improved the parsers for shell commands and shell words.
- Added warning for using $(...) in shell programs, as the Solaris /bin/sh
doesn't support it.
- Added some warnings about quoting.
- Some other minor changes.
obsolete synonym for the pipe operator "|", so you must protect it with
quotes''. (Kernighan/Pike, The UNIX Programming Environment, 1984.)
- $@ is another well-known shell variable.
- All substitution arguments to ${SED} and ${PAX} should be quoted whether
they contain special characters or not.
are only shown in -Wdebug mode, as the diagnostic messages are too
cryptic.
- Added detection for the $(...) replacement for backticks, as the Solaris
/bin/sh cannot handle them.
Changes since 4.51:
- The occurence of a symlink other than work* inside the pkgsrc tree is
not an error, just a warning.
- SUBST_MESSAGE should not be quoted.
- If -Wextra is enabled, all make variables that are used in shell commands
are checked for proper quoting.
- Improved the parser for shell commands.
- Some other minor changes.
remove the quoting from the definitions in the Makefiles.
- When checking with -Wall, print warnings about possibly misquoted
variables in the various states of the shell word parser.
Fix libkver support for pkg_comp's build, auto and install targets,
Reported broken and fix tested by salo@.
Also ensure libkver is built, if needed, even before digest.
Approved by jmmv@
- if you have > db1 the probably you have db_185.h which means
that dbopen is really __db185_open, and we'll prefer that.
- else if you have db1, then you have db1/db.h and dbopen
- else if you have db.h, then this is either the one from db1 and it will
work with -ldb having dbopen, or it will not.
Note that the compatibility option on __db185_open() will actually not create
or update db1.85/1.86 files, but it will use the current format of the db
library. This compatibility layer is source code only.
Changes since 4.50:
- Extended the quoting checks for make variables to shell commands.
- Added a check for unquoted shell variables (only with -Wextra).
- Some other minor changes.
- Added warnings for imperfect quoting style inside double quotes.
- All shell commands are checked for correct quoting of make(1) variables
in shell assignments like --prefix=${PREFIX:Q} and TMPDIR=${WRKSRC:Q}.
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.
- Rewrote the message formatting.
- The indentation of explanations is changed to be always a tabulator
character instead of depending on the last message.
- In verbose mode, statistics about the frequency of the individual
messages are printed before exiting.
- The command line option -Wextra enables additional warnings that are
not enabled by default because I have been told that Alistair would kill
me for them. :)
- Improved the shell tokenizer by recognizing parentheses.
- Improved checking of pkgsrc-internal files (mostly in pkgsrc/mk).
- Added a (trivial) spellchecker.
- Added checks for shell code that ignores the exitcode of commands.
- Added checks for CFLAGS, CPPFLAGS and CXXFLAGS.
- Avoided false positive warnings for absolute filenames in AWK code.
- Added checks for .for variables.
- Pkglint can check single files in directories that are three levels deep.
This is mostly useful for checking patch files.
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.
a "$" in the modifier part, as long as they don't contain references to
other variables.
- Removed checkline_mk_direct_tool_use().
- Renamed checkline_mk_shellcmd() to checkline_mk_shelltext(). This sub-
routine is also used for checking the right hand side of variable assign-
ments.
- Renamed direct_tools_ok_vars to non_shellcode_vars, which is more
appropriate. Added some variables to it that produced false positive
warnings.
checklines_package_Makefile(). Then, renamed
checklines_package_Makefile() to checklines_mk(), as it not only
applies to the main package Makefile.
- Fixed the regular expression for detecting ambiguous variables like
$f, which could mean either ${f} or $$f.
- When checking for deprecated variables, also mention the ones that
don't have modifiers.
- Moved the whole complicated code from checklines_package_Makefile() to
checkline_mk_shellcmd() and checkline_mk_varassign().
- Reenabled the -Wdirectcmd options by default.
- Added specialized subroutines for checking a single line.
- Removed checklines_Makefile_varuse().
- Removed checklines_direct_tools(), which has been replaced by the
specialized routines mentioned above.
disabled by default, as I am currently working on it, and neither the
current nor the previous version is good enough for the end user.
- Pkglint can now distinguish the two kinds of tools: The ones that
should be used like ${TOOL} and the ones that are provided in the
.tools/bin directory. The list of the first kind of tools is extracted
from the mk/tools/ directory instead of being hard-coded. This adds
a whole lot of new warnings.
- Rewrote the code for loading the deprecated.map file. It is only
loaded once now. The code that checks for use of deprecated variables
can handle multiple variables in a single line now.
for directories starting with %D.
- Converted load_make_vars_typemap() to the common form of caching
subroutine. This makes pkglint about 10 percent faster.
- Added explanations for the :Q and the :M*:Q operators in Makefiles.
a single character. Seen in some package versions like "pkg-200211??".
- Allow the "," and the "@" in filenames.
- Allow the "gopher" scheme in URLs.
- Don't warn for unexpected PERL5_PACKLIST, bases on PKGNAME, if the latter
contains references to other variables.
- When PKGNAME is equal to DISTNAME, this is not a warning, only a note.