pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Get rid of the false positive w...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3c06d0405f9c
branches:  trunk
changeset: 550317:3c06d0405f9c
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Nov 18 19:39:49 2008 +0000

description:
Get rid of the false positive warnings for downgrading, by doing more
magic to the PKGNAME and DISTNAME in the package Makefile. Thanks, wiz,
for insisting on this.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 9f693aefc509 -r 3c06d0405f9c pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue Nov 18 19:21:04 2008 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue Nov 18 19:39:49 2008 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.786 2008/11/18 19:18:51 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.787 2008/11/18 19:39:49 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -6890,6 +6890,13 @@
        # name more often.
        if (defined($distname) && defined($pkgname)) {
                $pkgname =~ s/\$\{DISTNAME\}/$distname/;
+
+               if ($pkgname =~ m"^(.*)\$\{DISTNAME:S(.)([^:]*)\2([^:]*)\2\}(.*)$") {
+                       my ($before, $separator, $old, $new, $after) = ($1, $2, $3, $4, $5);
+                       my $newname = $distname;
+                       $newname =~ s/$old/$new/;
+                       $pkgname = $before . $newname . $after;
+               }
        }
 
        if (defined($pkgname) && defined($distname) && $pkgname eq $distname) {



Home | Main Index | Thread Index | Old Index