This change includes all the things I thought of during the freeze of
2006Q2.
Some variables have disappeared from pkgsrc without notice. Marked them
deprecated to help the package authors at least a bit.
Renamed some ACL abbreviations in makevars.map and adjusted the variable
definitions.
Added the command line options -Dtrace, -Dunchecked and -Dunused.
Some variables may contain unexpected white-space and therefore should
not be used in .for loops.
The -Dmisc option replaces the --verbose option (and the log_info
subroutine), which does not exist any longer. This eliminates all
instances of "OK:" from the output, which I didn't like from the
beginning. The -Dmisc option also takes over many warnings that have
been issued by --debug before.
Improved the check for absolute pathnames. Especially, everything that
follows ${DESTDIR} or $(DESTDIR) in a Makefile is considered an absolute
pathname. This reveals many wrong uses of DESTDIR (as defined by the GNU
coding standards), for example $(DESTDIR)/$(prefix), which should be
$(DESTDIR)$(prefix) instead.
Almost every use of a make(1) variable is checked for spelling mistakes.
Before, only the definitions of variables have been checked.
Restricted the use of variables to specific files, which are defined in
makevars.map. This catches especially buildlink3.mk files with
unexpected side effects.
In shell commands, neither "echo" nor "echo -n" or "${ECHO} -n" should
be used. Since the INSTALL_*_DIR commands can only handle one directory
at a time, suggest to use INSTALLATION_DIRS instead.
Greatly improved the checks for dependency specifications, especially to
find foo-*, which should rather be foo-[0-9]*.
Fixed the incorrect handling of LICENSE_FILE (now using $line->text
instead of $line).
Improved the wording of the "plural names" warnings, so that for known
variables it is "The += operator should only be used with lists." now.
In buildlink3.mk files the uppercase and lowercase names of the package
should correspond with the package name. This catches many
copy-and-paste mistakes. Fixed many null pointer exceptions as well. In
addition, every buildlink3.mk file needs a definition of
BUILDLINK_API_DEPENDS.
In patch files, absolute pathnames and unportable macro names are
checked not only in added lines, but also in the context lines.
In the pkgsrc root directory and the category directories, the Makefiles
are checked like every other Makefile, too.
Fixed the place where the global variables for the package context are
defined and later undefined.
Variables that are mentioned in EVAL_PREFIX may be used in the current
file and are not flagged as "used but not defined".
When parsing shell words in Makefiles, recognize $<, $@, $^ and $/.
(The latter is used extensively by openoffice to represent a directory
separator.)
Fixed some minor bugs:
* $makevar had been defined unintentionally by using the -> operator.
affect the build process but are of more stylistic nature.
- Enabled the warnings on missing explanatory comments for patch files when
-Wstyle is enabled.
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.
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.
- 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.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.
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.
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.
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().
- Removed all references to the build-time pkgsrc directory, ${PKGSRCDIR}.
This makes the binary package independent of the build location.
Fixes PR 32006.
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.
therefore renamed it to -Wplist-sort. This option is disabled by default
to avoid excessive warnings. Apart from an unfounded suggestion
somewhere in the past, I don't see a reason why PLIST files should be
sorted. Remember: The option is still available, it's just disabled by
default.
- Renamed PORTSDIR to PKGSRCDIR
- Added warning option -Wno-workdir
- Fixed some places where absolute and relative pathnames had
been used incorrectly.
Clean up Makefile.
- added options for enabling/disabling specific checks
- added options for enabling/disabling specific warnings
- improved the --help message
and corresponding man page updates.
From Roland Illig with slight fixes by me.
Major changes: .include lines are honoured now, and FILESDIR, PATCHESDIR,
PKGDIR, SCRIPTSDIR, MD5_FILE, and PATCH_SUM_FILE aren't hardcoded anymore,
but the corresponding Makefile variables are used.
Adapt lintpkgsrc to the changes.
Step to 2.20 to mark the occasion.
Reviewed by hubertf.
(fixed up to work a little better).
lintpkgsrc can:
-d : Check each Makefile's 'DEPENDS' matches current pkgsrc versions.
-i : Check versions of installed packages against pkgsrc.
-l : Run pkglint on every package in pkgsrc.
-m : Report md5 mismatches for files in 'distfiles'.
-o : Report old/obsolete 'distfiles' (not referenced by any md5).
-r : Remove any 'bad' distfiles (Without -m or -o, implies both).
rename portlint to pkglint, and keep the sources right under files.
This makes it much easier to maintain and keep up with changes to out
package system.