summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authoratatat <atatat>2003-03-27 05:16:11 +0000
committeratatat <atatat>2003-03-27 05:16:11 +0000
commit2d75fc6c25b24a726ebcd387db46cb876a75a67d (patch)
tree673d0aa102f43e26f329be66a58e0af9f487009d /pkgtools
parent30a9a06a47e4b142fdc61a764688602588b2bb17 (diff)
downloadpkgsrc-2d75fc6c25b24a726ebcd387db46cb876a75a67d.tar.gz
Fill in default values for DESTDIR (empty), LOCALBASE ("/usr/pkg"),
and X11BASE ("/usr/X11R6"), which, while they might not be right for *every* system, are certainly more right than UNDEFINED. Give lang/python/pyversion.mk a little help by stuffing the material from PYTHON_VERSIONS_ACCEPTED into the two places it expects it (since lintpkgsrc doesn't do .for loops), add support for the ${FOO:S/foo/&/} construction, and tweak the .if handling for && and || bits. This has the following effect on the -g output (as a simple measure): % grep -c UNDEFINED before after before:58 after:1 Jump to 3.47.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rwxr-xr-xpkgtools/pkglint/files/lintpkgsrc.pl38
2 files changed, 32 insertions, 10 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 0acb2f5f180..a6838b38027 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.152 2003/01/28 22:44:00 abs Exp $
+# $NetBSD: Makefile,v 1.153 2003/03/27 05:16:11 atatat Exp $
#
-DISTNAME= pkglint-3.46
+DISTNAME= pkglint-3.47
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl
index 4e906dbd405..bcd81d9b294 100755
--- a/pkgtools/pkglint/files/lintpkgsrc.pl
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl
@@ -1,14 +1,14 @@
#!@PREFIX@/bin/perl
-# $NetBSD: lintpkgsrc.pl,v 1.75 2003/01/24 15:00:41 atatat Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.76 2003/03/27 05:16:12 atatat Exp $
# Written by David Brownlee <abs@netbsd.org>.
#
# Caveats:
-# The 'Makefile parsing' algorithym used to obtain package versions
-# and DEPENDS information is geared towards speed rather than perfection,
-# though it has got somewhat better over time, it only parses the
-# simplest Makefile conditionals. (a == b, no && etc).
+# The 'Makefile parsing' algorithm used to obtain package versions and
+# DEPENDS information is geared towards speed rather than perfection,
+# though it has gotten somewhat better over time, it only parses the
+# simpler Makefile conditionals.
#
# TODO: Handle fun DEPENDS like avifile-devel with
# {qt2-designer>=2.2.4,qt2-designer-kde>=2.3.1nb1}
@@ -425,6 +425,10 @@ sub get_default_makefile_vars
else
{ $default_vars->{PKGSRCDIR} = '/usr/pkgsrc'; }
+ $default_vars->{DESTDIR} = '';
+ $default_vars->{LOCALBASE} = '/usr/pkg';
+ $default_vars->{X11BASE} = '/usr/X11R6';
+
my($vars);
if (-f '/etc/mk.conf' && ($vars = parse_makefile_vars('/etc/mk.conf')))
{
@@ -852,7 +856,10 @@ sub parse_makefile_vars
if (m#^\.include\s+"([^"]+)"#)
{
$_ = $1;
- if (! m#/mk/bsd#)
+ debug("$file: .include \"$_\"\n");
+ if (m#/mk/bsd#)
+ { debug("$file: .include skipped\n"); }
+ else
{
my($incfile) = ($_);
@@ -885,12 +892,26 @@ sub parse_makefile_vars
$key = $1;
$plus = $2;
$value = $3;
+ debug("assignment: $key$plus=[$value]\n");
if ($plus eq ':')
{ $vars{$key} = parse_expand_vars($value, \%vars); }
elsif ($plus eq '+' && defined $vars{$key} )
{ $vars{$key} .= " $value"; }
elsif ($plus ne '?' || !defined $vars{$key} )
{ $vars{$key} = $value; }
+
+ # Give python a little hand (XXX - do we wanna consider actually
+ # implementing make .for loops, etc?
+ #
+ if ($key eq "PYTHON_VERSIONS_ACCEPTED")
+ {
+ my($pv);
+ foreach $pv (split(/\s+/, $vars{PYTHON_VERSIONS_ACCEPTED}))
+ {
+ $vars{"_PYTHON_VERSION_FIRSTACCEPTED"} ||= $pv;
+ $vars{"_PYTHON_VERSION_${pv}_OK"} = "yes";
+ }
+ }
}
}
@@ -939,6 +960,7 @@ sub parse_makefile_vars
if ($how eq 'S') # Limited substitution - keep ^ and $
{ $from =~ s/([?.{}\]\[*+])/\\$1/g; }
$to =~ s/\\(\d)/\$$1/g; # Change \1 etc to $1
+ $to =~ s/\&/\$&/g; # Change & to $1
my($notfirst);
if ($global =~ s/1//)
@@ -1009,13 +1031,13 @@ sub parse_eval_make_false
{ $_ = 0; }
$test =~ s/$1\s*\([^()]+\)/$_/;
}
- while ( $test =~ /([^\s()]+)\s+(!=|==)\s+([^\s()]+)/ )
+ while ( $test =~ /([^\s()\|\&]+)\s+(!=|==)\s+([^\s()]+)/ )
{
if ($2 eq '==')
{ $_ = ($1 eq $3) ?1 :0; }
else
{ $_ = ($1 ne $3) ?1 :0; }
- $test =~ s/[^\s()]+\s+(!=|==)\s+[^\s()]+/$_/;
+ $test =~ s/[^\s()\|\&]+\s+(!=|==)\s+[^\s()]+/$_/;
}
if ($test !~ /[^<>\d()\s&|.]/ )
{