From: Vincent Pit Date: Sun, 25 Jan 2009 11:37:39 +0000 (+0100) Subject: Prevent infinite loop when forcing a distribution with recursive dependencies X-Git-Tag: v0.06~10 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=86462016ed808b9ce5584b040facdd48dce72b85;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Prevent infinite loop when forcing a distribution with recursive dependencies --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index d40bf88..3813281 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -61,6 +61,8 @@ my $default_keywords; my $default_distdir; my $main_portdir; +my %forced; + sub _unquote { my $s = shift; $s =~ s/^["']*//; @@ -294,9 +296,10 @@ sub prepare { if (-e $file) { my $skip = 1; - if ($stat->force) { + if ($stat->force and not $forced{$file}) { if (-w $file) { 1 while unlink $file; + $forced{$file} = 1; $skip = 0; } else { error "Can't force rewriting of $file -- skipping";