| 1 |
#!/usr/local/bin/perl -w |
| 2 |
BEGIN {exec('perl5.002',$0,@ARGV) unless ($] >= 5.002)} |
| 3 |
use Config; |
| 4 |
use Getopt::Long; |
| 5 |
|
| 6 |
$opt_perl = ""; |
| 7 |
$opt_site = ""; |
| 8 |
$opt_man = ""; |
| 9 |
|
| 10 |
GetOptions('site','perl','inc','man'); |
| 11 |
|
| 12 |
my %dirs = (); |
| 13 |
|
| 14 |
|
| 15 |
sub maybe |
| 16 |
{ |
| 17 |
foreach (@_) |
| 18 |
{ |
| 19 |
$dirs{$_} = 0 if (defined($_) && -d $_ && !exists $dirs{$_}); |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
maybe($Config{'installarchlib'},$Config{'installprivlib'}) if ($opt_perl); |
| 24 |
maybe($Config{'installsitearch'},$Config{'installsitelib'}) if ($opt_site); |
| 25 |
|
| 26 |
my %done = (); |
| 27 |
my $dir; |
| 28 |
foreach $dir (keys %dirs) |
| 29 |
{ |
| 30 |
my $file; |
| 31 |
foreach $file ('Tk.pm','Tk','auto/Tk') |
| 32 |
{ |
| 33 |
my $path = "$dir/$file"; |
| 34 |
next if (exists $done{$path}); |
| 35 |
$done{$path} = 0; |
| 36 |
if (-f $path) |
| 37 |
{ |
| 38 |
print "rm -f $path\n"; |
| 39 |
} |
| 40 |
elsif (-d $path) |
| 41 |
{ |
| 42 |
print "rm -rf $path\n"; |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
if ($opt_man) |
| 48 |
{ |
| 49 |
my $path; |
| 50 |
foreach $path (<$Config{'installman3dir'}/Tk::*.$Config{'man3ext'}>) |
| 51 |
{ |
| 52 |
if (-f $path) |
| 53 |
{ |
| 54 |
print "rm -f $path\n"; |
| 55 |
} |
| 56 |
} |
| 57 |
} |
| 58 |
|