Skip to content

Commit

Permalink
Add pkglint to git for offline hacking, as of:
Browse files Browse the repository at this point in the history
PatchSet 1404
Date: 2013/01/23 12:47:15
Author: wiz
Branch: HEAD
Tag: (none)
Log:
Fix typo in variable name.

Members:
	files/makevars.map:1.229->1.230
  • Loading branch information
schmonz committed Feb 28, 2013
0 parents commit 65098a8
Show file tree
Hide file tree
Showing 24 changed files with 11,439 additions and 0 deletions.
7 changes: 7 additions & 0 deletions DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pkglint is for pkgsrc packages what lint(1) is for C files. It checks
for various things that the used languages cannot detect, for example
application-specific restrictions on certain variables.

Before importing a new package or making changes to an existing package,
pkglint should be run in the package's directory to check for common
errors.
75 changes: 75 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# $NetBSD: Makefile,v 1.424 2013/01/19 22:51:11 schmonz Exp $

# Note: if you update the version number, please have a look at the
# changes between the CVS tag "pkglint_current" and HEAD.
# After updating, please re-set the CVS tag to HEAD.
DISTNAME= pkglint-4.127
CATEGORIES= pkgtools
MASTER_SITES= # none
DISTFILES= # none

OWNER= wiz@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/docs/pkgsrc/
COMMENT= Verifier for NetBSD packages

DEPENDS+= p5-Digest-SHA1-[0-9]*:../../security/p5-Digest-SHA1
DEPENDS+= p5-enum>=1.016:../../devel/p5-enum
DEPENDS+= p5-pkgsrc-Dewey>=1.0:../../pkgtools/p5-pkgsrc-Dewey

BUILD_DEPENDS+= p5-Test-Trap-[0-9]*:../../devel/p5-Test-Trap

PKG_INSTALLATION_TYPES= overwrite pkgviews

WRKSRC= ${WRKDIR}
NO_CHECKSUM= yes
NO_BUILD= yes
USE_LANGUAGES= # none
AUTO_MKDIRS= yes

.include "../../mk/bsd.prefs.mk"

SUBST_CLASSES+= pkglint
SUBST_STAGE.pkglint= post-configure
SUBST_FILES.pkglint+= pkglint.pl pkglint.t
SUBST_FILES.pkglint+= plist-clash.pl
.if defined(BATCH)
SUBST_SED.pkglint+= -e s\|@PKGSRCDIR@\|/usr/pkgsrc\|g
.else
SUBST_SED.pkglint+= -e s\|@PKGSRCDIR@\|${PKGSRCDIR}\|g
.endif
SUBST_SED.pkglint+= -e s\|@PREFIX@\|${PREFIX}\|g
SUBST_SED.pkglint+= -e s\|@DISTVER@\|${DISTNAME:S/pkglint-//}\|g
SUBST_SED.pkglint+= -e s\|@MAKE@\|${MAKE:Q}\|g
SUBST_SED.pkglint+= -e s\|@PERL@\|${PERL5:Q}\|g
SUBST_SED.pkglint+= -e s\|@DATADIR@\|${PREFIX}/share/pkglint\|g
#SUBST_SED.pkglint+= -e s\|@DATADIR@\|/usr/pkgsrc/pkgtools/pkglint/files\|g

# Note: This target is only intended for use by the pkglint author.
.PHONY: quick-install
quick-install:
${RM} -rf ${WRKSRC}
${MKDIR} ${WRKSRC}
${MAKE} do-extract subst-pkglint do-install selftest clean

do-extract:
cd ${FILESDIR} && ${CP} pkglint.0 pkglint.1 pkglint.pl pkglint.t plist-clash.pl ${WRKSRC}

do-test:
cd ${WRKSRC} && prove pkglint.t

do-install:
${INSTALL_SCRIPT} ${WRKSRC}/pkglint.pl ${DESTDIR}${PREFIX}/bin/pkglint
${INSTALL_SCRIPT} ${WRKSRC}/plist-clash.pl ${DESTDIR}${PREFIX}/bin/plist-clash
.if !empty(MANINSTALL:Mcatinstall)
${INSTALL_MAN} ${WRKSRC}/pkglint.0 ${DESTDIR}${PREFIX}/${PKGMANDIR}/cat1
.endif
.if !empty(MANINSTALL:Mmaninstall)
${INSTALL_MAN} ${WRKSRC}/pkglint.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.endif
${INSTALL_DATA} ${FILESDIR}/makevars.map ${DESTDIR}${PREFIX}/share/pkglint/
${INSTALL_DATA} ${FILESDIR}/deprecated.map ${DESTDIR}${PREFIX}/share/pkglint/

selftest: .PHONY
${PREFIX}/bin/pkglint

.include "../../mk/bsd.pkg.mk"
7 changes: 7 additions & 0 deletions PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@comment $NetBSD: PLIST,v 1.5 2009/06/14 18:11:03 joerg Exp $
bin/pkglint
bin/plist-clash
man/cat1/pkglint.0
man/man1/pkglint.1
share/pkglint/deprecated.map
share/pkglint/makevars.map
23 changes: 23 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
$NetBSD: README,v 1.4 2006/02/28 23:32:47 rillig Exp $

== Current problems ==

The current pkglint architecture will not scale much further. What is
needed next are parsers for nested, non-context-free languages (make(1),
sh(1), sed(1)). The parsers should be able to recognize partial
structures, as well as structures containing foreign parts. This is
because most of pkgsrc is heavily based on preprocessors:

- The .if and .for directives in Makefiles are preprocessed by make(1)
before building dependencies and shell commands out of the remaining
text.

- make(1) assembles shell commands from literal text and variables like
${PKGNAME}.

- Shell commands often use dynamic evaluation of variables.

All this makes enhancing pkglint non-trivial. If you know of any
academic papers that might be of help in this case, please tell me.

The pkglint source code is much too big for a single file.
60 changes: 60 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
$NetBSD: TODO,v 1.74 2012/09/15 10:55:15 wiz Exp $

Please add your own entries at the bottom of this file. If possible,
include the name of an example package where a warning should occur.

* fix false positive warnings
* warn about the use of ${WRKDIR:=...}, as this construct should only
be used with lists.
* record with each substring its source location to be able to make
even more precise diagnostics
* Many of the checking routines need some context to provide better
warnings. For example, checkline_foo() may need to know what has
happened in the file before that line.
* Add checks for binary packages. See Debian/lintian for ideas.
* Of the user-defined variables, some may be used at load-time and some
don't. Find out how pkglint can distinguish them.
* Make sure that no variable is modified at load-time after it has been
used once. This should at least flag BUILD_DEFS in bsd.pkg.mk.
* Implement unescape_shellword, which is required for the type check for
SedCommand.
* Invent an annotation scheme for files that intentionally define
variables for use in other files.
* ${MACHINE_ARCH}-${LOWER_OPSYS}elf in PLISTs etc. is a NetBSD config.guess
problem ==> use of ${APPEND_ELF}
* Packages including lang/python/extension.mk must follow the Python version
scheme. Enforcing PYPKGPREFIX for those is most likely a good idea.
* Check for parallel files/dirs whose names differ only in case.
* Check for license files that are completely unused.
* If a dependency depends on an option (in options.mk), it should also
depend on the same option in the buildlink3.mk file.
* Complain about ${PKGSRC_COMPILER} == "sunpro", which should be
!empty(PKGSRC_COMPILER:Msunpro).
* If USE_TOOLS has autoconf213, and the package does stuff like
cd ${WRKSRC} && autoconf, then an incorrect warning is issued.
* LOCALBASE should not be used in normal Makefiles
* complain if LICENSE definition is missing

%

mail/mail-notification failed for Thomas, apparently because of an
unexpressed dependency on hicolor-icon-theme. I don't know if it's
possible to add a way to notice that the PLIST contains hicolor files
but that there's no dependency, or perhaps a list of mappings of sets of
PLIST regexes to sets of required packages, or something.

%

* don't complain about "procedure calls", like for pkg-build-options in
the various buildlink3.mk files.

%

if package A conflicts with B, then B should also conflict with A.

%

* When pkglint runs on a case-insensitive filesystem, it should still
point out problems that only occur on case-sensitive filesystems. For
example, devel/p5-Net-LDAP and devel/p5-Net-ldap should be considered
different paths.
159 changes: 159 additions & 0 deletions files/deprecated.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# $NetBSD: deprecated.map,v 1.63 2012/07/09 17:36:30 wiz Exp $
#

# This file contains names of Makefile variables and a short explanation
# what to do to make the warning disappear. Lines should only be removed
# if the explanation changes, in which case the new explanation should
# be added to the current date.

# December 2003
FIX_RPATH It has been removed from pkgsrc in 2003.

# February 2005
ALL_TARGET Use BUILD_TARGET instead.
NO_WRKSUBDIR Use WRKSRC=${WRKDIR} instead.
LIB_DEPENDS Use DEPENDS instead.
MASTER_SITE_SUBDIR Use ${MASTER_SITE_FOO:=subdir/} instead.
PATCH_SITE_SUBDIR Use ${PATCH_SITES_FOO:=subdir/} instead.
ONLY_FOR_ARCHS Use ONLY_FOR_PLATFORM instead.
NOT_FOR_ARCHS Use NOT_FOR_PLATFORM instead.
ONLY_FOR_OPSYS Use ONLY_FOR_PLATFORM instead.
NOT_FOR_OPSYS Use NOT_FOR_PLATFORM instead.

# May 2005
ALL_TARGET Use BUILD_TARGET instead.
DIGEST_FILE Use DISTINFO_FILE instead.
IGNORE Use PKG_FAIL_REASON or PKG_SKIP_REASON instead.
IS_INTERACTIVE Use INTERACTIVE_STAGE instead.
KERBEROS Use the PKG_OPTIONS framework instead.
MASTER_SITE_SUBDIR Use some form of MASTER_SITES instead.
MD5_FILE Use DISTINFO_FILE instead.
MIRROR_DISTFILE Use NO_BIN_ON_FTP and/or NO_SRC_ON_FTP instead.
NO_CDROM Use NO_BIN_ON_CDROM and/or NO_SRC_ON_CDROM instead.
NO_PATCH You can just remove it.
NO_WRKSUBDIR Use WRKSRC=${WRKDIR} instead.
PATCH_SITE_SUBDIR Use some form of PATCHES_SITES instead.
PATCH_SUM_FILE Use DISTINFO_FILE instead.
PKG_JVM Use PKG_DEFAULT_JVM instead.
USE_BUILDLINK2 You can just remove it.
USE_BUILDLINK3 You can just remove it.
USE_CANNA Use the PKG_OPTIONS framework instead.
USE_DB4 Use the PKG_OPTIONS framework instead.
USE_DIRS You can just remove it.
USE_ESOUND Use the PKG_OPTIONS framework instead.
USE_GIF Use the PKG_OPTIONS framework instead.
USE_GMAKE Use USE_TOOLS+=gmake instead.
USE_GNU_TOOLS Use USE_TOOLS instead.
USE_IDEA Use the PKG_OPTIONS framework instead.
USE_LIBCRACK Use the PKG_OPTIONS framework instead.
USE_MMX Use the PKG_OPTIONS framework instead.
USE_PKGLIBTOOL Use USE_LIBTOOL instead.
USE_SSL Include "../../security/openssl/buildlink3.mk" instead.

# July 2005
USE_PERL5 Use USE_TOOLS+=perl or USE_TOOLS+=perl:run instead.

# October 2005
NO_TOOLS You can just remove it.
NO_WRAPPER You can just remove it.

# November 2005
ALLFILES Use CKSUMFILES instead.
DEPENDS_TARGET Use DEPENDS instead.
FETCH_DEPENDS Use DEPENDS instead.
RUN_DEPENDS Use DEPENDS instead.

# December 2005
USE_CUPS Use the PKG_OPTIONS framework (option cups) instead.
USE_I586 Use the PKG_OPTIONS framework (option i586) instead.
USE_INN Use the PKG_OPTIONS framework instead.
USE_OPENLDAP Use the PKG_OPTIONS framework (option openldap) instead.
USE_OSS Use the PKG_OPTIONS framework (option oss) instead.
USE_RSAREF2 Use the PKG_OPTIONS framework (option rsaref) instead.
USE_SASL Use the PKG_OPTIONS framework (option sasl) instead.
USE_SASL2 Use the PKG_OPTIONS framework (option sasl) instead.
USE_SJ3 Use the PKG_OPTIONS framework (option sj3) instead.
USE_SOCKS Use the PKG_OPTIONS framework (socks4 and socks5 options) instead.
USE_WNN4 Use the PKG_OPTIONS framework (option wnn4) instead.
USE_XFACE Use the PKG_OPTIONS framework instead.

# February 2006
TOOLS_DEPMETHOD Use the :build or :run modifiers in USE_TOOLS instead.
MANDIR Please use ${PREFIX}/${PKGMANDIR} instead.
DOWNLOADED_DISTFILE Use the shell variable $$extract_file instead.
DECOMPRESS_CMD Use EXTRACT_CMD instead.

# March 2006
INSTALL_EXTRA_TMPL Use INSTALL_TEMPLATE instead.
DEINSTALL_EXTRA_TMPL Use DEINSTALL_TEMPLATE instead.

# April 2006
RECOMMENDED Use ABI_DEPENDS instead.
BUILD_USES_MSGFMT Use USE_TOOLS+=msgfmt instead.
USE_MSGFMT_PLURALS Use USE_TOOLS+=msgfmt instead.

# May 2006
EXTRACT_USING_PAX Use "EXTRACT_OPTS=-t pax" instead.
NO_EXTRACT It doesn't exist anymore.
_FETCH_MESSAGE Use FETCH_MESSAGE (different format) instead.
BUILDLINK_DEPENDS.* Use BUILDLINK_API_DEPENDS.* instead.
BUILDLINK_RECOMMENDED.* Use BUILDLINK_ABI_DEPENDS.* instead.
SHLIB_HANDLING Use CHECK_SHLIBS_SUPPORTED instead.
USE_RMAN It has been removed.

# June 2006
DEINSTALL_SRC Use the pkginstall framework instead.
INSTALL_SRC Use the pkginstall framework instead.
DEINSTALL_TEMPLATE Use DEINSTALL_TEMPLATES instead.
INSTALL_TEMPLATE Use INSTALL_TEMPLATES instead.
HEADER_TEMPLATE Use HEADER_TEMPLATES instead.
_REPLACE.* Use REPLACE.* instead.
_REPLACE_FILES.* Use REPLACE_FILES.* instead.
MESSAGE Use MESSAGE_SRC instead.
INSTALL_FILE It may only be used internally by pkgsrc.
DEINSTALL_FILE It may only be used internally by pkgsrc.

# July 2006
USE_DIGEST You can just remove it.
LTCONFIG_OVERRIDE You can just remove it.
USE_GNU_GETTEXT You can just remove it.
BUILD_ENV Use PKGSRC_MAKE_ENV instead.
DYNAMIC_MASTER_SITES You can just remove it.

# September 2006
MAKEFILE Use MAKE_FILE instead.

# November 2006
SKIP_PORTABILITY_CHECK Use CHECK_PORTABILITY_SKIP (a list of patterns) instead.
PKG_SKIP_REASON Use PKG_FAIL_REASON instead.

# January 2007
BUILDLINK_TRANSFORM.* Use BUILDLINK_FNAME_TRANSFORM.* instead.

# March 2007
SCRIPTDIR You can just remove it.
NO_PKG_REGISTER You can just remove it.
NO_DEPENDS You can just remove it.

# October 2007
_PKG_SILENT Use RUN (with more error checking) instead.
_PKG_DEBUG Use RUN (with more error checking) instead.
LICENCE Use LICENSE instead.
# The following variable is not yet deprecated, as there has been
# a large disagreement on the proper spelling.
#ACCEPTABLE_LICENCES Use ACCEPTABLE_LICENSES instead.

# November 2007
#USE_NCURSES Include "../../devel/ncurses/buildlink3.mk" instead.

# December 2007
INSTALLATION_DIRS_FROM_PLIST Use AUTO_MKDIRS instead.

# April 2009
NO_PACKAGE It doesn't exist anymore.
NO_MTREE You can just remove it.

# July 2012
SETGIDGAME Use USE_GAMESGROUP instead.
GAMEGRP Use GAMES_GROUP instead.
GAMEOWN Use GAMES_USER instead.
27 changes: 27 additions & 0 deletions files/doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# $NetBSD: Makefile,v 1.3 2006/05/23 08:10:37 rillig Exp $
#

XMLDOCS+= pkglint.xml
XMLDOCS+= chap.intro.xml
XMLDOCS+= chap.defs.xml
XMLDOCS+= chap.types.xml
XMLDOCS+= chap.code.xml
XMLDOCS+= chap.statemachines.xml
XMLDOCS+= chap.future.xml

IMAGES+= statemachine.patch.png
IMAGES+= statemachine.shellcmd.png

.PHONY: all
all: pkglint.html

pkglint.html: ${XMLDOCS} ${IMAGES} stylesheet.xsl
xmlto -m stylesheet.xsl html-nochunks pkglint.xml

.PHONY: clean
clean:
rm -f *.html *.png

.SUFFIXES: .dia .png
.dia.png:
dia -e ${.TARGET:Q} -t png ${.IMPSRC:Q}
Loading

0 comments on commit 65098a8

Please sign in to comment.