diff options
author | wiz <wiz@pkgsrc.org> | 2002-06-02 21:52:28 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2002-06-02 21:52:28 +0000 |
commit | 9a3584985fc265bb0379c0678c8e34ff24273fc0 (patch) | |
tree | c12d8165a1d4c4677a7daaa8f1a79f7c2bce853d | |
parent | 7602306f7a2725659fe4194e980e06eba7ee4d58 (diff) | |
download | pkgsrc-9a3584985fc265bb0379c0678c8e34ff24273fc0.tar.gz |
Update to 3.26. Changes:
. sync dewey support with pkg_info
. fix 'elsif' handling (fixes bogus ns-flash warnings)
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 40 |
2 files changed, 37 insertions, 7 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 47529f1112a..e57328cd537 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.129 2002/04/08 13:57:12 wiz Exp $ +# $NetBSD: Makefile,v 1.130 2002/06/02 21:52:28 wiz Exp $ # -DISTNAME= pkglint-3.25 +DISTNAME= pkglint-3.26 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index 7aa732af7d5..9d9f6a91184 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!@PREFIX@/bin/perl -# $NetBSD: lintpkgsrc.pl,v 1.66 2002/03/22 15:57:55 wiz Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.67 2002/06/02 21:52:29 wiz Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -14,6 +14,7 @@ # {qt2-designer>=2.2.4,qt2-designer-kde>=2.3.1nb1} $^W = 1; +use locale; use strict; use Getopt::Std; use File::Find; @@ -340,13 +341,42 @@ sub deweycmp eval "$cmp $test 0"; } +sub convert_to_standard_dewey + { + # According to the current implementation in pkg_install/lib/str.c + # as of 2002/06/02, '_' before a number, '.', and 'pl' get treated as 0, + # while 'rc' gets treated as -1; other characters are converted to lower + # case and then to a number: a->1, b->2, c->3, etc. Numbers stay the same. + # 'nb' is a special case that's already been handled when we are here. + my($elem, $underscore, @temp); + foreach $elem (@_) { + if ($elem =~ /\d+/) { + push(@temp, $elem); + } + elsif ($elem =~ /^pl$/ or $elem =~ /^\.$/) { + push(@temp, 0); + } + elsif ($elem =~ /^_$/) { + push(@temp, 0); + } + elsif ($elem =~ /^rc$/) { + push(@temp, -1); + } + else { + push(@temp, 0); + push(@temp, ord($elem)-ord("a")+1); + } + } + @temp; +} + sub deweycmp_extract { my($match, $val) = @_; my($cmp, @matchlist, @vallist); - @matchlist = split(/\D+/, $match); - @vallist = split(/\D+/, $val); + @matchlist = convert_to_standard_dewey(split(/(\D+)/, lc($match))); + @vallist = convert_to_standard_dewey(split(/(\D+)/, lc($val))); $cmp = 0; while( ! $cmp && (@matchlist || @vallist)) { @@ -594,7 +624,7 @@ sub package_globmatch ($matchpkgname, $test, $matchver) = ($1, $2, $3); - if ($test ne '-' && $matchver !~ /^[\d.]+(nb\d+|)$/ ) + if ($test ne '-' && $matchver !~ /^[\d.]+(pl\d+|p\d+|rc\d+|nb\d+|)*$/ ) { $matchver = "invalid-dewey($test$matchver)"; } elsif (@pkgvers = $pkglist->pkgver($matchpkgname)) { @@ -787,7 +817,7 @@ sub parse_makefile_vars } if (m#^\.else\b# && @if_false) { - $if_false[$#if_false] = $if_false[$#if_false]?0:1; + $if_false[$#if_false] = $if_false[$#if_false] == 1?0:1; debug("$file: .else (@if_false)\n"); next; } |