#
################################################################################
#
-# $Revision: 8 $
+# $Revision: 10 $
# $Author: mhx $
-# $Date: 2006/01/14 22:41:11 +0100 $
+# $Date: 2006/12/02 09:58:34 +0100 $
#
################################################################################
#
force => 0,
test => 0,
install => 1,
+ 'test-archives' => 0,
);
my %config = (
force
test
install!
+ test-archives+
)) or pod2usage(2);
if (exists $opt{config}) {
@perls = sort keys %perl;
}
+if ($opt{'test-archives'}) {
+ my $test = 'test';
+ my $cwd = cwd;
+ -d $test or mkpath($test);
+ chdir $test or die "chdir $test: $!\n";
+ for my $perl (@perls) {
+ eval {
+ my $d = extract_source($perl{$perl});
+ rmtree($d) if -e $d;
+ };
+ warn $@ if $@;
+ }
+ chdir $cwd or die "chdir $cwd: $!\n";
+ print STDERR "cleaning up\n";
+ rmtree($test);
+ exit 0;
+}
+
my %current;
for my $cfg (@{$opt{config}}) {
{
my $perl = shift;
- print "reading $perl->{source}\n";
+ my $what = $opt{'test-archives'} ? 'test' : 'read';
+ print "${what}ing $perl->{source}\n";
my $target;
$target = $t;
}
- if (-d $target) {
- print "removing old build directory $target\n";
- rmtree($target);
- }
+ if ($opt{'test-archives'} == 0 || $opt{'test-archives'} > 1) {
+ if (-d $target) {
+ print "removing old build directory $target\n";
+ rmtree($target);
+ }
- print "extracting $perl->{source}\n";
+ print "extracting $perl->{source}\n";
- Archive::Tar->extract_archive($perl->{source})
- or die "extract failed: " . Archive::Tar->error() . "\n";
+ Archive::Tar->extract_archive($perl->{source})
+ or die "extract failed: " . Archive::Tar->error() . "\n";
- -d $target or die "oooops, $target not found\n";
+ -d $target or die "oooops, $target not found\n";
+ }
return $target;
}
=head1 COPYRIGHT
-Copyright (c) 2004-2005, Marcus Holland-Moritz.
+Copyright (c) 2004-2006, Marcus Holland-Moritz.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=head1 SEE ALSO
-See L<Devel::PPPort>.
+See L<Devel::PPPort> and L<HACKERS>.