summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2006-05-10 17:14:08 +0000
committerrillig <rillig>2006-05-10 17:14:08 +0000
commit19c7f55f346580b52cc01ec1cfcb86d8b41695a2 (patch)
treef67b035aa45f3bcd29c40ca4070fca29c0e5c17e /pkgtools
parent8ab7b859582516e85cde7525460aea2a576784bd (diff)
downloadpkgsrc-19c7f55f346580b52cc01ec1cfcb86d8b41695a2.tar.gz
- ACL subjects may contain * as a placeholder.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/doc/chap.types.xml9
-rw-r--r--pkgtools/pkglint/files/makevars.map32
-rw-r--r--pkgtools/pkglint/files/pkglint.pl13
3 files changed, 30 insertions, 24 deletions
diff --git a/pkgtools/pkglint/files/doc/chap.types.xml b/pkgtools/pkglint/files/doc/chap.types.xml
index bc882e58cff..b0f44203123 100644
--- a/pkgtools/pkglint/files/doc/chap.types.xml
+++ b/pkgtools/pkglint/files/doc/chap.types.xml
@@ -1,4 +1,4 @@
-<!-- $NetBSD: chap.types.xml,v 1.7 2006/05/10 17:01:44 rillig Exp $ -->
+<!-- $NetBSD: chap.types.xml,v 1.8 2006/05/10 17:14:08 rillig Exp $ -->
<chapter id="types">
<title>The &pkglint; type system</title>
@@ -100,7 +100,9 @@
<filename>buildlink3.mk</filename> are valid ACL subjects. Since
some names occur over an over in pkgsrc, these can be
abbreviated as shown in <xref linkend="types.acl.subjects.abbr"
- />. The possible actions on a variable are shown in <xref
+ />. The character <literal>*</literal> is a placeholder for zero
+ or more arbitrary characters, like in the shell. The possible
+ actions on a variable are shown in <xref
linkend="types.acl.perms" />.</para>
<table id="types.acl.subjects.abbr">
@@ -113,8 +115,7 @@
<row><entry><filename>buildlink3.mk</filename></entry><entry>b</entry></row>
<row><entry><filename>hacks.mk</filename></entry><entry>h</entry></row>
<row><entry><filename>options.mk</filename></entry><entry>o</entry></row>
- <row><entry><filename>*.mk</filename></entry><entry>k</entry></row>
- <row><entry>any file</entry><entry>_</entry></row>
+ <row><entry>any file</entry><entry>*</entry></row>
</tbody>
</tgroup>
</table>
diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map
index ef16ec161c0..d8fbbd1ae69 100644
--- a/pkgtools/pkglint/files/makevars.map
+++ b/pkgtools/pkglint/files/makevars.map
@@ -1,4 +1,4 @@
-# $NetBSD: makevars.map,v 1.87 2006/05/10 15:31:41 rillig Exp $
+# $NetBSD: makevars.map,v 1.88 2006/05/10 17:14:08 rillig Exp $
#
# This file contains the guessed type of some variables, according to
@@ -99,7 +99,7 @@ ALL_ENV List of ShellWord
ALTERNATIVES_FILE Filename
ALTERNATIVES_SRC List of Pathname
APACHE_MODULE Yes
-AUTOCONF_REQD List of Version [_:a]
+AUTOCONF_REQD List of Version [*:a]
AUTOMAKE_OVERRIDE List of Pathmask
BDB185_DEFAULT Unchecked []
BDBBASE Unchecked []
@@ -117,7 +117,7 @@ BUILDLINK_CONTENTS_FILTER List of ShellWord
BUILDLINK_CFLAGS List of CFlag
BUILDLINK_CPPFLAGS List of CFlag
BUILDLINK_DEPENDS InternalList of Dependency [b:a]
-BUILDLINK_DEPMETHOD BuildlinkDepmethod [b:d,m:as,c:a]
+BUILDLINK_DEPMETHOD BuildlinkDepmethod [b:d,m:as,c:a,*.mk:a]
BUILDLINK_DEPTH BuildlinkDepth [b:s]
BUILDLINK_FILES List of Pathmask [b:a, builtin.mk:a]
BUILDLINK_FILES_CMD List of ShellWord
@@ -137,9 +137,9 @@ BUILDLINK_RPATHDIRS List of Pathname
BUILDLINK_TARGETS List of Identifier
BUILDLINK_TRANSFORM List of WrapperTransform [m:a,builtin.mk:a,h:a,b:a]
BUILD_DEFS List of Varname [m:a,c:a,o:a]
-BUILD_DEPENDS InternalList of DependencyWithPath [c:a,m:a,o:a]
+BUILD_DEPENDS InternalList of DependencyWithPath [c:a,m:a,o:a,*.mk:a]
BUILD_DIRS List of WrksrcSubdirectory [m:as,c:as]
-BUILD_ENV List of ShellWord [_:a]
+BUILD_ENV List of ShellWord [*:a]
BUILD_TARGET List of Identifier [m:as,c:as]
BUILD_USES_MSGFMT Yes
BUILTIN_PKG Identifier [builtin.mk:s]
@@ -161,7 +161,7 @@ CHECK_WRKREF_SKIP List of Pathmask [m:a,c:a]
COMMENT Comment [m:as,c:as] # m:a?, c:a?
CONFIGURE_ARGS List of ShellWord [c:a,m:a,o:a,h:a,builtin.mk:a]
CONFIGURE_DIRS List of WrksrcSubdirectory [m:s,c:s]
-CONFIGURE_ENV List of ShellWord [_:a]
+CONFIGURE_ENV List of ShellWord [*:a]
CONFIGURE_HAS_INFODIR YesNo
CONFIGURE_HAS_MANDIR YesNo [m:s]
CONFIGURE_SCRIPT Pathname [m:s]
@@ -180,13 +180,13 @@ CXXFLAGS List of CFlag [m:a,c:a,o:a,h:a]
DEINSTALL_FILE Pathname [m:s]
DEINSTALL_SRC List of Pathname [m:s,c:ds]
DEINSTALL_TEMPLATE List of Pathname
-DEPENDS InternalList of DependencyWithPath [_:a]
+DEPENDS InternalList of DependencyWithPath [*:a]
DESCR_SRC List of Pathname [m:s,c:ds]
DEVOSSAUDIO Pathname
DEVOSSSOUND Pathname
DISTFILES List of Filename [m:as,c:ads]
DISTINFO_FILE RelativePkgPath [m:s,c:ds]
-DISTNAME Filename [m:s,c:ads]
+DISTNAME Filename [m:s,c:ads, Makefile.*:s]
DIST_SUBDIR Filename [m:s,c:ds]
DJB_BUILD_TARGETS List of Identifier
DJB_CONFIG_CMDS List of ShellWord
@@ -234,10 +234,10 @@ FAM_DEFAULT Unchecked []
FAM_TYPE Unchecked []
FETCH_BEFORE_ARGS List of ShellWord [m:as]
FILESDIR RelativePkgPath [m:s,c:ds]
-FILES_SUBST List of ShellWord [m:a,c:a]
+FILES_SUBST List of ShellWord [*:a]
FILES_SUBST_SED List of ShellWord
FONTS_DIRS List of Pathname [m:as,c:a]
-GCC_REQD List of Version [_:a]
+GCC_REQD List of Version [*:a]
GENERATE_PLIST List of ShellWord [m:a,c:a]
# ^^ List of Shellcommand, terminated with a semicolon
GNU_ARCH { mips }
@@ -262,7 +262,7 @@ INSTALL_GAME ShellCommand []
INSTALL_GAME_DATA ShellCommand []
INSTALL_LIB ShellCommand []
INSTALL_LIB_DIR ShellCommand []
-INSTALL_MAKE_FLAGS List of ShellWord [m:as,_:a]
+INSTALL_MAKE_FLAGS List of ShellWord [m:as,*:a]
INSTALL_MAN ShellCommand []
INSTALL_MAN_DIR ShellCommand []
INSTALL_PROGRAM ShellCommand []
@@ -297,8 +297,8 @@ MAKEFLAGS List of ShellWord [m:a,c:a,b:a,h:a]
MAKEVARS List of Varname [builtin.mk:a,b:a]
MAKE_DIRS List of Pathname
MAKE_DIRS_PERMS List of ShellWord
-MAKE_ENV List of ShellWord [_:a]
-MAKE_FLAGS List of ShellWord [_:a]
+MAKE_ENV List of ShellWord [*:a]
+MAKE_FLAGS List of ShellWord [*:a]
MANCOMPRESSED YesNo [m:s,c:ds]
MANCOMPRESSED_IF_MANZ Yes [m:s,c:ds]
MASTER_SITES List of URL [c:ads,m:as]
@@ -380,7 +380,7 @@ PKG_APACHE_ACCEPTED List of { apache13 apache2 }
PKG_APACHE_DEFAULT Unchecked []
PKG_DEBUG_LEVEL Unchecked []
PKG_DEFAULT_OPTIONS Unchecked []
-PKG_FAIL_REASON List of ShellWord [_:a]
+PKG_FAIL_REASON List of ShellWord [*:a]
PKG_GECOS Unchecked [m:s]
PKG_GID Unchecked [m:s]
PKG_GROUPS List of ShellWord [m:as]
@@ -419,7 +419,7 @@ PLIST_SRC List of RelativePkgPath [m:as,o:a,c:ads]
PLIST_SUBST List of ShellWord [c:a,o:a,m:a]
PLIST_TYPE { dynamic static }
PREPEND_PATH List of Pathname
-PRINT_PLIST_AWK AwkCommand [_:a]
+PRINT_PLIST_AWK AwkCommand [*:a]
PTHREAD_AUTO_VARS YesNo [m:s]
PTHREAD_OPTS List of { native optional require } [m:as,c:a,b:a]
PTHREAD_TYPE Unchecked []
@@ -451,7 +451,7 @@ TEST_ENV List of ShellWord
TEST_TARGET List of Identifier [m:s]
TEX_ACCEPTED List of { teTeX1 teTeX2 teTeX3 } [m:s,c:s]
TEX_DEPMETHOD { build run } [m:s,c:s]
-TEXINFO_REQD List of Version [_:a]
+TEXINFO_REQD List of Version [*:a]
TOOLS_ALIASES List of Filename
TOOLS_BROKEN List of Tool
TOOLS_CREATE List of Tool
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index daa4825fd84..abff408908e 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.576 2006/05/10 15:31:41 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.577 2006/05/10 17:14:08 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -1627,7 +1627,8 @@ sub get_vartypes_map() {
$acltext = "";
$acls = undef;
}
- while ($acltext =~ s,^([\w.]+|_):([adpsu]*)(?:\,\s*|$),,) {
+
+ while ($acltext =~ s,^([\w.*]+|_):([adpsu]*)(?:\,\s*|$),,) {
my ($subject, $perms) = ($1, $2);
use constant ACL_shortcuts => {
@@ -1640,7 +1641,11 @@ sub get_vartypes_map() {
"_" => qr".*",
};
- push(@{$acls}, [exists(ACL_shortcuts->{$subject}) ? ACL_shortcuts->{$subject} : qr"(?:^|/)\Q${subject}\E$", $perms]);
+ # Transform $subject to a regular expression.
+ $subject =~ s/\./[.]/g;
+ $subject =~ s/\*/.*/g;
+
+ push(@{$acls}, [exists(ACL_shortcuts->{$subject}) ? ACL_shortcuts->{$subject} : qr"(?:^|/)${subject}$", $perms]);
}
if ($acltext ne "") {
$line->log_fatal("Invalid ACL: ${acltext}.");
@@ -3129,7 +3134,7 @@ sub checkline_mk_vartype_basic($$$$$$$) {
if (ref($type) eq "HASH") {
if (!exists($type->{$value})) {
- $line->log_warning("\"${value}\" is not valid for ${varname}. Use one of ".join(" ", keys(%{$type}))." instead.");
+ $line->log_warning("\"${value}\" is not valid for ${varname}. Use one of ".join(" ", sort(keys(%{$type})))." instead.");
}
} elsif ($type eq "AwkCommand") {