I'll make it optional. The packages tree is about 85M nowadays,
which
is pretty hefty, even with CVS compression on.
~-0% cat ~/share/bin/cvsclean
#!/usr/bin/perl
sub cvsclean {
my($path) = @_;
my(%files) = ();
my(@subdirs);
print STDOUT "Cleaning $path\n";
opendir (DIR, "$path/") || die "No directory $path";
open (ENTRIES, "$path/CVS/Entries") || die "No $path/CVS/Entries
file";
while (<ENTRIES>) {
if (m[^D/([^/]+)]) {
push (@subdirs, "$path/$1");
} elsif (m[^/([^/]+)/[^/-]]) {
$files{$1} = "managed";
}
}
foreach $entry (readdir(DIR)) {
if (!exists ($files{$entry})) {
$entry = "$path/$entry";
if (-f $entry) {
print STDOUT "unlink $entry\n";
unlink $entry;
}
}
}
foreach $subdir (@subdirs) {
&cvsclean ($subdir);
}
}
&cvsclean (".");
~-0%