diff options
author | abs <abs@pkgsrc.org> | 2000-02-03 12:05:20 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2000-02-03 12:05:20 +0000 |
commit | eb043280a1d7a1a723ec4eb031c36c53a8e0c359 (patch) | |
tree | a2ab79e63214707fba40399c0fa8dff13825b808 /pkgtools/pkglint | |
parent | 64a456d27ff8c796124bb133f5dff72b8a1fe944 (diff) | |
download | pkgsrc-eb043280a1d7a1a723ec4eb031c36c53a8e0c359.tar.gz |
Update to 2.01 - extend deweydecimal compare to handle nb<N> suffixes
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 22 |
2 files changed, 21 insertions, 5 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 22de45188dd..d01cbd23bd8 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.41 2000/01/26 15:25:25 abs Exp $ +# $NetBSD: Makefile,v 1.42 2000/02/03 12:05:20 abs Exp $ # -DISTNAME= pkglint-2.00 +DISTNAME= pkglint-2.01 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index aa20645079f..da627905d9a 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# $NetBSD: lintpkgsrc.pl,v 1.20 2000/01/26 15:25:26 abs Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.21 2000/02/03 12:05:21 abs Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -166,14 +166,28 @@ sub check_prebuilt_packages } # Dewey decimal verson number matching - or thereabouts +# Also handles 'nb<N>' suffix (checked iff values otherwise identical) # sub dewey_cmp { my($match, $test, $val) = @_; - my($cmp, @matchlist, @vallist); + my($cmp, @matchlist, @vallist, $match_nb, $val_nb); + $match_nb = $val_nb = 0; + if ($match =~ /(.*)nb(\d+)/) # Handle nb<N> suffix + { + $match = $1; + $match_nb = $2; + } @matchlist = split(/\D+/, $match); + + if ($val =~ /(.*)nb(\d+)/) # Handle nb<N> suffix + { + $val = $1; + $val_nb = $2; + } @vallist = split(/\D+/, $val); + $cmp = 0; while( ! $cmp && (@matchlist || @vallist)) { @@ -184,6 +198,8 @@ sub dewey_cmp else { $cmp = (shift @matchlist <=> shift @vallist) } } + if (!$cmp) # Iff otherwise identical, check nb suffix + { $cmp = $match_nb <=> $val_nb; } eval "$cmp $test 0"; } @@ -333,7 +349,7 @@ sub package_globmatch ($pkg, $test, $matchver) = ($1, $2, $3); - if ($matchver =~ /[^\d.]/ ) + if ($matchver !~ /^[\d.]+(nb\d+|)$/ ) { $matchver = "invalid-dewey($test$matchver)"; } elsif (defined($ver = $pkg2ver{$pkg})) { |