pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Update pkgtools/pkglint to 4.71 - lintpkgsrc changes:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ced3c1be405b
branches:  trunk
changeset: 519407:ced3c1be405b
user:      abs <abs%pkgsrc.org@localhost>
date:      Mon Oct 02 19:35:43 2006 +0000

description:
Update pkgtools/pkglint to 4.71 - lintpkgsrc changes:
  - Handle 'badly named' patch files
  - In the event of a distint checksum mismatch, report the affected file
    as well as package
  - If we need to call out to make to parse a makefile and it returns any
    errors, ensure we prefix the error output with the Makefile path
  - run through perltidy. Ugly, but consistent

diffstat:

 doc/CHANGES-2006                     |     3 +-
 pkgtools/pkglint/Makefile            |     4 +-
 pkgtools/pkglint/files/lintpkgsrc.pl |  2544 ++++++++++++++++++---------------
 3 files changed, 1355 insertions(+), 1196 deletions(-)

diffs (truncated from 3023 to 300 lines):

diff -r 6720ecdcbab6 -r ced3c1be405b doc/CHANGES-2006
--- a/doc/CHANGES-2006  Mon Oct 02 19:18:57 2006 +0000
+++ b/doc/CHANGES-2006  Mon Oct 02 19:35:43 2006 +0000
@@ -1,4 +1,4 @@
->$NetBSD: CHANGES-2006,v 1.1383 2006/10/02 19:18:57 rillig Exp $
+>$NetBSD: CHANGES-2006,v 1.1384 2006/10/02 19:36:36 abs Exp $
 
 Changes to the packages collection and infrastructure in 2006:
 
@@ -4537,3 +4537,4 @@
        Updated cross/bfd-crunchide to 1.2 [joerg 2006-10-02]
        Added devel/p5-Carp-Clan version 5.4 [rillig 2006-10-02]
        Updated devel/p5-Carp-Clan to 5.4 [rillig 2006-10-02]
+       Updated pkgtools/pkglint to 4.71 [abs 2006-10-02]
diff -r 6720ecdcbab6 -r ced3c1be405b pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Mon Oct 02 19:18:57 2006 +0000
+++ b/pkgtools/pkglint/Makefile Mon Oct 02 19:35:43 2006 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.350 2006/09/27 15:10:45 joerg Exp $
+# $NetBSD: Makefile,v 1.351 2006/10/02 19:35:43 abs Exp $
 #
 
-DISTNAME=      pkglint-4.70
+DISTNAME=      pkglint-4.71
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 6720ecdcbab6 -r ced3c1be405b pkgtools/pkglint/files/lintpkgsrc.pl
--- a/pkgtools/pkglint/files/lintpkgsrc.pl      Mon Oct 02 19:18:57 2006 +0000
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl      Mon Oct 02 19:35:43 2006 +0000
@@ -1,6 +1,6 @@
 #! @PERL@
 
-# $NetBSD: lintpkgsrc.pl,v 1.111 2006/05/19 23:38:12 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.112 2006/10/02 19:35:43 abs Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -11,7 +11,7 @@
 #      simpler Makefile conditionals.
 #
 # TODO: Handle fun DEPENDS like avifile-devel with
-#                      {qt2-designer>=2.2.4,qt2-designer-kde>=2.3.1nb1} 
+#                      {qt2-designer>=2.2.4,qt2-designer-kde>=2.3.1nb1}
 
 $^W = 1;
 use locale;
@@ -19,34 +19,52 @@
 use Getopt::Std;
 use File::Find;
 use File::Basename;
+use IPC::Open3;
 use Cwd 'realpath', 'getcwd';
 
 # Buildtime configuration
-my $conf_make                  = '@MAKE@';
-my $conf_pkgsrcdir             = '@PKGSRCDIR@';
-my $conf_prefix                        = '@PREFIX@';
+my $conf_make      = '@MAKE@';
+my $conf_pkgsrcdir = '@PKGSRCDIR@';
+my $conf_prefix    = '@PREFIX@';
+
+my (
+    $pkglist,                     # list of Pkg packages
+    $pkg_installver,              # installed version of pkg_install pseudo-pkg
+    $default_vars,                # Set for Makefiles, inc PACKAGES & PKGSRCDIR
+    %opt,                         # Command line options
+    %vuln,                        # vulnerability data
+    @matched_prebuiltpackages,    # List of obsolete prebuilt package paths
+    @prebuilt_pkgdirs,            # Use to follow symlinks in prebuilt pkgdirs
+    %prebuilt_pkgdir_cache,       # To avoid symlink loops in prebuilt_pkgdirs
+);
+
+$ENV{PATH} .=
+  ":/bin:/usr/bin:/sbin:/usr/sbin:${conf_prefix}/sbin:${conf_prefix}/bin";
 
-my(    $pkglist,               # list of Pkg packages
-       $pkg_installver,        # installed version of pkg_install pseudo-pkg
-       $default_vars,          # Set for Makefiles, inc PACKAGES & PKGSRCDIR
-       %opt,                   # Command line options
-       %vuln,                  # vulnerability data
-       @matched_prebuiltpackages,# List of obsolete prebuilt package paths
-       @prebuilt_pkgdirs,      # Use to follow symlinks in prebuilt pkgdirs
-       %prebuilt_pkgdir_cache, # To avoid symlink loops in prebuilt_pkgdirs
-       );
+if (
+       !getopts( 'BDE:I:K:LM:OP:RSVdg:himopru', \%opt )
+    || $opt{h}
+    || !(
+           defined $opt{d}
+        || defined $opt{g}
+        || defined $opt{i}
+        || defined $opt{m}
+        || defined $opt{o}
+        || defined $opt{p}
+        || defined $opt{r}
+        || defined $opt{u}
+        || defined $opt{B}
+        || defined $opt{D}
+        || defined $opt{R}
+        || defined $opt{O}
+        || defined $opt{S}
+        || defined $opt{V}
+        || defined $opt{E}
+    )
+  )
+{
 
-$ENV{PATH} .= ":/bin:/usr/bin:/sbin:/usr/sbin:${conf_prefix}/sbin:${conf_prefix}/bin";
-
-if (!getopts('BDE:I:K:LM:OP:RSVdg:himopru', \%opt)
-    || $opt{h}
-    || !(defined($opt{d}) || defined($opt{g}) || defined($opt{i}) ||
-         defined($opt{m}) || defined($opt{o}) || defined($opt{p}) ||
-         defined($opt{r}) || defined($opt{u}) || defined($opt{B}) ||
-         defined($opt{D}) || defined($opt{R}) || defined($opt{O}) ||
-         defined($opt{S}) || defined($opt{V}) || defined($opt{E}))) {
-
-       usage_and_exit();
+    usage_and_exit();
 }
 $| = 1;
 
@@ -54,620 +72,672 @@
 # gets removed in the final evaluation
 my $magic_undefined = 'M_a_G_i_C_UNDEFINED';
 
-get_default_makefile_vars(); # $default_vars
+get_default_makefile_vars();    # $default_vars
 
-if ($opt{D} && @ARGV) {
-       foreach my $file (@ARGV) {
-               if ( -d $file) {
-                       $file .= "/Makefile";
-               }
-               if (! -f $file) {
-                       fail("No such file: $file");
-               }
-               my ($pkgname, $vars) = parse_makefile_pkgsrc($file);
-               $pkgname ||= 'UNDEFINED';
-               print "$file -> $pkgname\n";
-               foreach my $varname (sort keys %{$vars}) {
-                       print "\t$varname = $vars->{$varname}\n";
-               }
-               #if ($opt{d}) {
-               #       pkgsrc_check_depends();
-               #}
-       }
-       exit;
+if ( $opt{D} && @ARGV ) {
+    foreach my $file (@ARGV) {
+        if ( -d $file ) {
+            $file .= "/Makefile";
+        }
+        if ( !-f $file ) {
+            fail("No such file: $file");
+        }
+        my ( $pkgname, $vars ) = parse_makefile_pkgsrc($file);
+        $pkgname ||= 'UNDEFINED';
+        print "$file -> $pkgname\n";
+        foreach my $varname ( sort keys %{$vars} ) {
+            print "\t$varname = $vars->{$varname}\n";
+        }
+
+        #if ($opt{d}) {
+        #      pkgsrc_check_depends();
+        #}
+    }
+    exit;
 }
 
 sub main() {
-       my($pkgsrcdir, $pkgdistdir);
+    my ( $pkgsrcdir, $pkgdistdir );
 
-       $pkgsrcdir = $default_vars->{PKGSRCDIR};
-       $pkgdistdir = $default_vars->{DISTDIR};
+    $pkgsrcdir  = $default_vars->{PKGSRCDIR};
+    $pkgdistdir = $default_vars->{DISTDIR};
 
-       if ($opt{r} && !$opt{o} && !$opt{m} && !$opt{p}) {
-               $opt{o} = $opt{m} = $opt{p} = 1;
-       }
-       if ($opt{o} || $opt{m}) {
-               my(@baddist);
+    if ( $opt{r} && !$opt{o} && !$opt{m} && !$opt{p} ) {
+        $opt{o} = $opt{m} = $opt{p} = 1;
+    }
+    if ( $opt{o} || $opt{m} ) {
+        my (@baddist);
 
-               @baddist = scan_pkgsrc_distfiles_vs_distinfo(
-                   $pkgsrcdir, $pkgdistdir, $opt{o}, $opt{m});
-               if ($opt{r}) {
-                       verbose("Unlinking 'bad' distfiles\n");
-                       foreach my $distfile (@baddist) {
-                               unlink("$pkgdistdir/$distfile");
-                       }
-               }
-       }
+        @baddist =
+          scan_pkgsrc_distfiles_vs_distinfo( $pkgsrcdir, $pkgdistdir, $opt{o},
+            $opt{m} );
+        if ( $opt{r} ) {
+            verbose("Unlinking 'bad' distfiles\n");
+            foreach my $distfile (@baddist) {
+                unlink("$pkgdistdir/$distfile");
+            }
+        }
+    }
 
-       # List BROKEN packages
-       if ($opt{B}) {
-               scan_pkgsrc_makefiles($pkgsrcdir);
-               foreach my $pkgver ($pkglist->pkgver) {
-                       $pkgver->var('BROKEN') || next;
-                       print $pkgver->pkgname.': '.$pkgver->var('BROKEN')."\n";
-               }
-       }
+    # List BROKEN packages
+    if ( $opt{B} ) {
+        scan_pkgsrc_makefiles($pkgsrcdir);
+        foreach my $pkgver ( $pkglist->pkgver ) {
+            $pkgver->var('BROKEN') || next;
+            print $pkgver->pkgname . ': ' . $pkgver->var('BROKEN') . "\n";
+        }
+    }
 
-       # List obsolete or NO_BIN_ON_FTP/RESTRICTED prebuilt packages
-       #
-       if ($opt{p} || $opt{O} || $opt{R} || $opt{V}) {
-               if ($opt{V}) {
-                       my ($vuln) = "$pkgdistdir/pkg-vulnerabilities";
+    # List obsolete or NO_BIN_ON_FTP/RESTRICTED prebuilt packages
+    #
+    if ( $opt{p} || $opt{O} || $opt{R} || $opt{V} ) {
+        if ( $opt{V} ) {
+            my ($vuln) = "$pkgdistdir/pkg-vulnerabilities";
 
-                       if (!open(VULN, $vuln)) {
-                               fail("Unable to open '$vuln': $!");
-                       }
-                       while (<VULN>) {
-                               s/#.*//;
-                               if (/([^*?[]+)(<|>|<=|>=)(\d\S+)/) {
-                                       my ($pkg, $cmp, $ver) = ($1, $2, $3);
-                                       push(@{$vuln{$pkg}},"$cmp $ver");
-                               }
-                       }
-                       close(VULN);
-               }
+            if ( !open( VULN, $vuln ) ) {
+                fail("Unable to open '$vuln': $!");
+            }
+            while (<VULN>) {
+                s/#.*//;
+                if (/([^*?[]+)(<|>|<=|>=)(\d\S+)/) {
+                    my ( $pkg, $cmp, $ver ) = ( $1, $2, $3 );
+                    push( @{ $vuln{$pkg} }, "$cmp $ver" );
+                }
+            }
+            close(VULN);
+        }
 
-               if ($opt{p} || $opt{O} || $opt{R} || $opt{V}) {
-                       scan_pkgsrc_makefiles($pkgsrcdir);
-               }
-               @prebuilt_pkgdirs = ($default_vars->{PACKAGES});
-               %prebuilt_pkgdir_cache = ();
+        if ( $opt{p} || $opt{O} || $opt{R} || $opt{V} ) {
+            scan_pkgsrc_makefiles($pkgsrcdir);
+        }
+        @prebuilt_pkgdirs      = ( $default_vars->{PACKAGES} );
+        %prebuilt_pkgdir_cache = ();
 
-               while (@prebuilt_pkgdirs) {
-                       find(\&check_prebuilt_packages, shift @prebuilt_pkgdirs);
-               }
+        while (@prebuilt_pkgdirs) {
+            find( \&check_prebuilt_packages, shift @prebuilt_pkgdirs );
+        }
 
-               if ($opt{r}) {
-                       verbose("Unlinking listed prebuiltpackages\n");
-                       foreach my $pkgfile (@matched_prebuiltpackages) {
-                               unlink($pkgfile);
-                       }
-               }
-       }
+        if ( $opt{r} ) {
+            verbose("Unlinking listed prebuiltpackages\n");
+            foreach my $pkgfile (@matched_prebuiltpackages) {
+                unlink($pkgfile);
+            }
+        }
+    }
 
-       if ($opt{S}) {
-               my(%in_subdir);
+    if ( $opt{S} ) {



Home | Main Index | Thread Index | Old Index