use base qw/CPANPLUS::Dist::Base/;
use CPANPLUS::Dist::Gentoo::Atom;
+use CPANPLUS::Dist::Gentoo::Guard;
use CPANPLUS::Dist::Gentoo::Maps;
=head1 NAME
my $file;
+ my $guard = CPANPLUS::Dist::Gentoo::Guard->new(sub {
+ if (defined $file and -e $file and -w _) {
+ 1 while unlink $file;
+ }
+ });
+
+ my $SIG_INT = $SIG{INT};
+ local $SIG{INT} = sub {
+ if ($SIG_INT) {
+ local $@;
+ eval { $SIG_INT->() };
+ die $@ if $@;
+ }
+ die 'Caught SIGINT';
+ };
+
my $OK = sub {
+ $guard->unarm;
$stat->created(1);
$stat->dist($file) if defined $file;
1;
$stat->created(0);
$stat->dist(undef);
$self->_abort(@_) if @_;
- if (defined $file and -f $file) {
- 1 while unlink $file;
- }
0;
};