1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-20 04:02:27 +00:00
freebsd-ports/Tools/scripts/release/scrubindex.pl
Murray Stokely 23cad417ec Modernize these two scripts a little bit to make it easier to deal
with 5.X or 4.X package sets (i.e., INDEX vs INDEX-5 and tgz vs tbz)

OKed by:    marcus
2004-06-08 21:57:01 +00:00

32 lines
494 B
Perl
Executable File

#!/usr/bin/perl
# $FreeBSD$
die "$0 <pkgdir> <indexfile>\n" if ($#ARGV != 1);
$xdep = 'XFree86-3\.3\.6_10';
$pkgdir = shift(@ARGV);
#$ext = 'tbz';
$ext = 'tgz';
print STDERR "scrubindex pkgdir: $pkgdir\n";
my $cnt = 0;
LOOP:
while (<>) {
s/$xdep//g;
s/ */ /g;
s/\| /\|/g;
@f = split('\|');
next if (! -f "$pkgdir/$f[0].$ext");
foreach $dep (split(' ', $f[8])) {
next LOOP if (! -f "$pkgdir/$dep.$ext");
}
$cnt++;
print;
}
print STDERR "$cnt lines copied from scrubindex.pl"