summaryrefslogtreecommitdiff
path: root/Tools/scripts/release/scrubindex.pl
blob: 608d4d359a245a718708db8025a8623e830b3e6e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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"