pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc Update pkglint to 4.78:
details: https://anonhg.NetBSD.org/pkgsrc/rev/6be5fa25f5d3
branches: trunk
changeset: 531256:6be5fa25f5d3
user: abs <abs%pkgsrc.org@localhost>
date: Thu Jul 26 17:07:59 2007 +0000
description:
Update pkglint to 4.78:
- lintpkgsrc.pl - less brokenly parse the contents of make conditionals
like "if empty(FOO)". Specifically handle the case where FOO
contains a :M modifier or a variable expansion.
Fixes 'lintpkgsrc -r' incorrectly deleting ruby18-base-1.8.6nb1 each time
Mmm... lintpkgsrc.pl needs to die
diffstat:
doc/CHANGES-2007 | 3 +-
pkgtools/pkglint/Makefile | 4 +-
pkgtools/pkglint/files/lintpkgsrc.pl | 43 +++++++++++++++++++++++++----------
3 files changed, 35 insertions(+), 15 deletions(-)
diffs (124 lines):
diff -r fbcf3f3b43bc -r 6be5fa25f5d3 doc/CHANGES-2007
--- a/doc/CHANGES-2007 Thu Jul 26 12:30:30 2007 +0000
+++ b/doc/CHANGES-2007 Thu Jul 26 17:07:59 2007 +0000
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES-2007,v 1.1629 2007/07/26 12:30:30 ghen Exp $
+$NetBSD: CHANGES-2007,v 1.1630 2007/07/26 17:08:42 abs Exp $
Changes to the packages collection and infrastructure in 2007:
@@ -3000,3 +3000,4 @@
Updated sysutils/ipa to 2.0.4 [obache 2007-07-26]
Updated mail/thunderbird to 2.0.0.5 [ghen 2007-07-26]
Updated mail/thunderbird-gtk1 to 2.0.0.5 [ghen 2007-07-26]
+ Updated pkgtools/pkglint to 4.78 [abs 2007-07-26]
diff -r fbcf3f3b43bc -r 6be5fa25f5d3 pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Thu Jul 26 12:30:30 2007 +0000
+++ b/pkgtools/pkglint/Makefile Thu Jul 26 17:07:59 2007 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.361 2007/04/24 15:32:12 tnn Exp $
+# $NetBSD: Makefile,v 1.362 2007/07/26 17:07:59 abs Exp $
#
-DISTNAME= pkglint-4.77
+DISTNAME= pkglint-4.78
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff -r fbcf3f3b43bc -r 6be5fa25f5d3 pkgtools/pkglint/files/lintpkgsrc.pl
--- a/pkgtools/pkglint/files/lintpkgsrc.pl Thu Jul 26 12:30:30 2007 +0000
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl Thu Jul 26 17:07:59 2007 +0000
@@ -1,6 +1,6 @@
#! @PERL@
-# $NetBSD: lintpkgsrc.pl,v 1.113 2006/10/23 09:19:32 abs Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.114 2007/07/26 17:07:59 abs Exp $
# Written by David Brownlee <abs%netbsd.org@localhost>.
#
@@ -476,8 +476,7 @@
$default_vars->{OPSYS},
$default_vars->{OS_VERSION},
$default_vars->{MACHINE}
- )
- = (split);
+ ) = (split);
if ( !$default_vars->{MACHINE} ) {
die('Unable to extract machine from uname');
}
@@ -868,8 +867,7 @@
# invoke make here as a last resort
my ($pkgsrcdir) = ( $file =~ m:(/.*)/: );
- my $pid =
- open3( \*WTR, \*RDR, \*ERR,
+ my $pid = open3( \*WTR, \*RDR, \*ERR,
"cd $pkgsrcdir ; ${conf_make} show-vars VARNAMES=PKGNAME" );
if ( !$pid ) {
warn "$file: Unable to run make: $!";
@@ -1283,7 +1281,7 @@
my ( $false, $test );
$false = 0;
- $test = parse_expand_vars_dumb( $line, $vars );
+ $test = parse_expand_vars_dumb( $line, $vars );
# XXX This is _so_ wrong - need to parse this correctly
$test =~ s/""/\r/g;
@@ -1294,21 +1292,42 @@
# XXX Could do something with target
while ( $test =~ /(target|empty|make|defined|exists)\s*\(([^()]+)\)/ ) {
- my $var = $${vars}{$2};
+ my $testname = $1;
+ my $varname = $2;
+ my $var;
+
+ # Implement (some of) make's :M modifier
+ if ( $varname =~ /^([^:]+):M(.+)$/ ) {
+ $varname = $1;
+ my $match = $2;
+
+ $var = $${vars}{$varname};
+ $var = parse_expand_vars( $var, $vars ) if defined $var;
+
+ $match =~ s/([.+])/\\$1/g;
+ $match =~ s/\*/.*/g;
+ $match =~ s/\?/./g;
+ $match = '^' . $match . '$';
+ $var = ( $var =~ /$match/ ) if defined $var;
+ }
+ else {
+ $var = $${vars}{$varname};
+ $var = parse_expand_vars( $var, $vars ) if defined $var;
+ }
if ( defined $var && $var eq $magic_undefined ) {
$var = undef;
}
- if ( $1 eq 'exists' ) {
- $_ = ( -e $2 ) ? 1 : 0;
+ if ( $testname eq 'exists' ) {
+ $_ = ( -e $varname ) ? 1 : 0;
}
- elsif ( $1 eq 'defined' ) {
+ elsif ( $testname eq 'defined' ) {
$_ = defined($var) ? 1 : 0;
}
- elsif ( $1 eq 'empty' ) {
+ elsif ( $testname eq 'empty' ) {
$_ = ( ( not defined($var) or ( length($var) == 0 ) ) ? 1 : 0 );
}
@@ -1316,7 +1335,7 @@
$_ = 0;
}
- $test =~ s/$1\s*\([^()]+\)/$_/;
+ $test =~ s/$testname\s*\([^()]+\)/$_/;
debug("conditional: update to $test\n");
}
Home |
Main Index |
Thread Index |
Old Index