diff options
author | abs <abs@pkgsrc.org> | 2001-04-17 17:08:41 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2001-04-17 17:08:41 +0000 |
commit | 5f667fc4e1a6c5f2876787f30832c11dc0ff2160 (patch) | |
tree | 7039c4b2d62dffab97d8210d25923ce86b2489ed /pkgtools | |
parent | 7cd277e0a0a2dafd5a062a942601d48b09f00825 (diff) | |
download | pkgsrc-5f667fc4e1a6c5f2876787f30832c11dc0ff2160.tar.gz |
Update pkglint to 2.44 to match distinfo enhancements to pkgsrc by agc
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/Makefile | 4 | ||||
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 28 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 76 |
3 files changed, 45 insertions, 63 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index dcc5f649107..e3ae77c11f1 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.85 2001/04/02 19:02:33 wiz Exp $ +# $NetBSD: Makefile,v 1.86 2001/04/17 17:08:41 abs Exp $ # -DISTNAME= pkglint-2.43 +DISTNAME= pkglint-2.44 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index 168339de382..78e3a499896 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.44 2001/03/30 16:30:24 abs Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.45 2001/04/17 17:08:41 abs Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -72,7 +72,7 @@ if ($opt{'D'} && @ARGV) { my(@baddist); - @baddist = &scan_pkgsrc_distfiles_vs_md5($pkgsrcdir, $pkgdistdir, + @baddist = &scan_pkgsrc_distfiles_vs_distinfo($pkgsrcdir, $pkgdistdir, $opt{'o'}, $opt{'m'}); if ($opt{'r'}) { @@ -952,31 +952,33 @@ sub pkgsrc_check_depends } } -# Extract all md5 entries, then verify contents of distfiles +# Extract all distinfo entries, then verify contents of distfiles # -sub scan_pkgsrc_distfiles_vs_md5 +sub scan_pkgsrc_distfiles_vs_distinfo { - my($pkgsrcdir, $pkgdistdir, $check_unref, $check_md5) = @_; + my($pkgsrcdir, $pkgdistdir, $check_unref, $check_distinfo) = @_; my($cat, @categories, $pkgdir); my(%distfiles, %sumfiles, @distwarn, $file, $numpkg); my(@bad_distfiles); @categories = &list_pkgsrc_categories($pkgsrcdir); - &verbose("Scanning pkgsrc md5s: ".'_'x@categories."\b"x@categories); + &verbose("Scanning pkgsrc distinfo: ".'_'x@categories."\b"x@categories); $numpkg = 0; foreach $cat (sort @categories) { foreach $pkgdir (&list_pkgsrc_pkgdirs($pkgsrcdir, $cat)) { - if (open(MD5, "$pkgsrcdir/$cat/$pkgdir/files/md5")) + if (open(DISTINFO, "$pkgsrcdir/$cat/$pkgdir/distinfo")) { ++$numpkg; - while( <MD5> ) + while( <DISTINFO> ) { if (m/^(\w+) ?\(([^\)]+)\) = (\S+)/) { - if (!defined($distfiles{$2})) + if (substr($2, 0, 6) eq 'patch-') + { next; } + if (!defined $distfiles{$2}) { $distfiles{$2}{'sumtype'} = $1; $distfiles{$2}{'sum'} = $3; @@ -990,7 +992,7 @@ sub scan_pkgsrc_distfiles_vs_md5 } } } - close(MD5); + close(DISTINFO); } } &verbose('.'); @@ -1020,7 +1022,7 @@ sub scan_pkgsrc_distfiles_vs_md5 print join("\n", sort @bad_distfiles), "\n"; } - if ($check_md5) + if ($check_distinfo) { my($sum); if (@distwarn) @@ -1057,8 +1059,8 @@ opts: -h : This help. [see lintpkgsrc(1) for more information] Installed package options: Distfile options: - -i : Check version against pkgsrc -m : List md5 mismatches - -u : Fetch distfiles (may change) -o : List obsolete (no md5) + -i : Check version against pkgsrc -m : List distinfo mismatches + -u : Fetch distfiles (may change) -o : List obsolete (no distinfo) Prebuilt package options: Makefile options: -p : List old/obsolete -B : List packages marked as 'BROKEN' diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 5f8b39e705b..a284b090739 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -12,7 +12,7 @@ # Freely redistributable. Absolutely no warranty. # # From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp -# $NetBSD: pkglint.pl,v 1.43 2001/04/02 19:02:34 wiz Exp $ +# $NetBSD: pkglint.pl,v 1.44 2001/04/17 17:08:50 abs Exp $ # # This version contains some changes necessary for NetBSD packages # done by Hubert Feyrer <hubertf@netbsd.org>, @@ -184,14 +184,14 @@ foreach $i (<$portdir/$patchdir/patch-*>) { push(@checker, $i); $checker{$i} = 'checkpatch'; } -if (-f "$portdir/$patchsumfile") { - $i="$patchsumfile"; +if (-e <$portdir/$distinfo>) { + $i = "$distinfo"; next if (defined $checker{$i}); push(@checker, $i); - $checker{$i} = 'checkpatchsum'; + $checker{$i} = 'checkdistinfo'; } { - # Make sure there's a files/patch-sum if there are patches + # Make sure there's a distinfo if there are patches $patches=0; patch: foreach $i (<$portdir/$patchdir/patch-*>) { @@ -200,16 +200,10 @@ if (-f "$portdir/$patchsumfile") { last patch; } } - if ($patches && ! -f "$portdir/$patchsumfile" ) { - &perror("WARN: no $portdir/$patchsumfile file. Please run 'make makepatchsum'."); + if ($patches && ! -f "$portdir/$distinfo" ) { + &perror("WARN: no $portdir/$distinfo file. Please run 'make makepatchsum'."); } } -if (-e <$portdir/$digestfile>) { - $i = "$digestfile"; - next if (defined $checker{$i}); - push(@checker, $i); - $checker{$i} = 'checkdigest'; -} foreach $i (@checker) { print "OK: checking $i.\n"; if (! -f "$portdir/$i") { @@ -223,15 +217,21 @@ foreach $i (@checker) { } } } -if (-e <$portdir/$digestfile> ) { +if (-e <$portdir/$distinfo> ) { if ( $seen_NO_CHECKSUM ) { - &perror("WARN: NO_CHECKSUM set, but $portdir/$digestfile exists. Please remove it."); + &perror("WARN: NO_CHECKSUM set, but $portdir/$distinfo exists. Please remove it."); } } else { if ( ! $seen_NO_CHECKSUM ) { - &perror("WARN: no $portdir/$digestfile file. Please run 'make makesum'."); + &perror("WARN: no $portdir/$distinfo file. Please run 'make makesum'."); } } +if (-e <$pkgdir/files/md5> ) { + &perror("FATAL: pkg/files/md5 is deprecated -- run 'make mdi' to generate distinfo."); +} +if (-e <$pkgdir/files/patch-sum> ) { + &perror("FATAL: pkg/files/patch-sum is deprecated -- run 'make mps' to generate distinfo."); +} if (-e <$pkgdir/COMMENT> ) { &perror("FATAL: pkg/COMMENT is deprecated -- please use a COMMENT variable instead."); } @@ -301,11 +301,11 @@ sub checkdescr { } # -# files/patch-sum +# distinfo # -sub checkpatchsum { - local($file) = @_; # files/patch-sum - local(%inpatchsumfile); +sub checkdistinfo { + local($file) = @_; # distinfo + local(%indistinfofile); open(SUM,"<$portdir/$file") || return 0; while(<SUM>) { @@ -326,18 +326,18 @@ sub checkpatchsum { &perror("FATAL: checksum of $patch differs between $portdir/$file and\n" ." $portdir/$patchdir/$patch. Rerun 'make makepatchsum'."); } - } else { + } elsif ($patch =~ /^patch-/) { &perror("FATAL: patchfile '$patch' is in $file\n" ." but not in $portdir/$patchdir/$patch. Rerun 'make makepatchsum'."); } - $inpatchsumfile{$patch} = 1; + $indistinfofile{$patch} = 1; } close(SUM); foreach $patch ( <$portdir/$patchdir/patch-*> ) { $patch =~ /\/([^\/]+)$/; - if (! $inpatchsumfile{$1}) { + if (! $indistinfofile{$1}) { &perror("FATAL: patchsum of '$1' is in $portdir/$patchdir/$1 but not in\n" ." $file. Rerun 'make makepatchsum'."); } @@ -571,21 +571,6 @@ sub checkpatch { close(IN); } -sub checkdigest { - local($file) = @_; - local($rcsidseen) = 0; - - open(IN, "< $portdir/$file") || return 0; - while (<IN>) { - $rcsidseen++ if /\$$rcsidstr[:\$]/; - } - if (!$rcsidseen) { - &perror("FATAL: RCS tag \"\$$rcsidstr\$\" must be present ". - "in digest $file.") - } - close(IN); -} - sub readmakefile { local ($file) = @_; local $contents = ""; @@ -707,19 +692,14 @@ sub checkmakefile { $scriptdir = $1 if ($whole =~ /\nSCRIPTDIR[+?]?=[ \t]*([^\n]+)\n/); $scriptdir =~ s/\$\{.CURDIR\}/./; - $digestfile = "$filesdir/md5"; - $digestfile = $1 if ($whole =~ /\nDIGEST_FILE[+?]?=[ \t]*([^\n]+)\n/); - $digestfile =~ s/\$\{.CURDIR\}/./; - $digestfile =~ s/\${PKGSRCDIR}/..\/../; + $distinfo = "distinfo"; + $distinfo = $1 if ($whole =~ /\nDIGEST_FILE[+?]?=[ \t]*([^\n]+)\n/); + $distinfo =~ s/\$\{.CURDIR\}/./; + $distinfo =~ s/\${PKGSRCDIR}/..\/../; - $patchsumfile = "$filesdir/patch-sum"; - $patchsumfile = $1 - if ($whole =~ /\nPATCH_SUM_FILE[+?]?=[ \t]*([^\n]+)\n/); - $patchsumfile =~ s/\$\{.CURDIR\}/./; print("OK: PATCHDIR: $patchdir, SCRIPTDIR: $scriptdir, ". "FILESDIR: $filesdir, PKGDIR: $pkgdir, ". - "DIGEST_FILE: $digestfile, ". - "PATCH_SUM_FILE: $patchsumfile\n") if ($verbose); + "DISTINFO: $distinfo\n") if ($verbose); # # whole file: IS_INTERACTIVE/NOPORTDOCS |