X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FCPANPLUS%2FDist%2FGentoo.pm;h=ed048f96153594b6e86292f85c85962b8a52e90c;hb=0b48b505ce499b8ac199dd921aed721105398d75;hp=a696b77d7627ac6793de7b5510069fb7458552dc;hpb=9a88cbe7efd58f6ee7099d7286cd9c364e0946ed;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index a696b77..ed048f9 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -21,11 +21,11 @@ CPANPLUS::Dist::Gentoo - CPANPLUS backend generating Gentoo ebuilds. =head1 VERSION -Version 0.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 SYNOPSIS @@ -61,6 +61,8 @@ my $default_keywords; my $default_distdir; my $main_portdir; +my %forced; + sub _unquote { my $s = shift; $s =~ s/^["']*//; @@ -68,11 +70,15 @@ sub _unquote { return $s; } +my $format_available; + sub format_available { + return $format_available if defined $format_available; + for my $prog (qw/emerge ebuild/) { unless (can_run($prog)) { error "$prog is required to write ebuilds -- aborting"; - return 0; + return $format_available = 0; } } @@ -102,7 +108,7 @@ sub format_available { $default_keywords = [ 'x86' ] unless defined $default_keywords; $default_distdir = '/usr/portage/distfiles' unless defined $default_distdir; - return 1; + return $format_available = 1; } sub init { @@ -294,9 +300,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"; @@ -562,7 +569,7 @@ Kent Fredric, for testing and suggesting improvements. =head1 COPYRIGHT & LICENSE -Copyright 2008 Vincent Pit, all rights reserved. +Copyright 2008-2009 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.