From: Vincent Pit Date: Sun, 16 Aug 2009 16:38:33 +0000 (+0200) Subject: Rename eb_(.*) accessors to ebuild_$1 X-Git-Tag: v0.08~12 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git;a=commitdiff_plain;h=54356f51aba0692e97cd89e4b2c24058d325d4d9 Rename eb_(.*) accessors to ebuild_$1 --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 65b9aed..5b113d8 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -118,7 +118,8 @@ sub init { my $conf = $self->parent->parent->configure_object; $stat->mk_accessors(qw/name version author distribution desc uri src license - deps eb_name eb_version eb_dir eb_file fetched_arch + fetched_arch deps + ebuild_name ebuild_version ebuild_dir ebuild_file portdir_overlay overlay distdir keywords do_manifest header footer force verbose/); @@ -206,21 +207,21 @@ sub prepare { $stat->distribution($name . '-' . $version); - $stat->eb_version(CPANPLUS::Dist::Gentoo::Maps::version_c2g($version)); + $stat->ebuild_version(CPANPLUS::Dist::Gentoo::Maps::version_c2g($version)); - $stat->eb_name(CPANPLUS::Dist::Gentoo::Maps::name_c2g($name)); + $stat->ebuild_name(CPANPLUS::Dist::Gentoo::Maps::name_c2g($name)); - $stat->eb_dir(File::Spec->catdir( + $stat->ebuild_dir(File::Spec->catdir( $stat->overlay, CATEGORY, - $stat->eb_name, + $stat->ebuild_name, )); my $file = File::Spec->catfile( - $stat->eb_dir, - $stat->eb_name . '-' . $stat->eb_version . '.ebuild', + $stat->ebuild_dir, + $stat->ebuild_name . '-' . $stat->ebuild_version . '.ebuild', ); - $stat->eb_file($file); + $stat->ebuild_file($file); if (-e $file) { my $skip = 1; @@ -289,7 +290,7 @@ sub create { my $self = shift; my $stat = $self->status; - my $OK = sub { $stat->created(1); $stat->dist($stat->eb_file); 1 }; + my $OK = sub { $stat->created(1); $stat->dist($stat->ebuild_file); 1 }; my $FAIL = sub { $stat->created(0); $stat->dist(undef); $self->_abort(@_) if @_; 0 }; unless ($stat->prepared) { @@ -303,13 +304,13 @@ sub create { return $OK->(); } - my $dir = $stat->eb_dir; + my $dir = $stat->ebuild_dir; unless (-d $dir) { eval { File::Path::mkpath($dir) }; return $FAIL->("mkpath($dir): $@") if $@; } - my $file = $stat->eb_file; + my $file = $stat->ebuild_file; open my $eb, '>', $file or return $FAIL->("open($file): $!"); print $eb $self->ebuild_source; close $eb; @@ -337,7 +338,7 @@ sub update_manifest { my $self = shift; my $stat = $self->status; - my $file = $stat->eb_file; + my $file = $stat->ebuild_file; unless ($file and -e $file) { return $self->_abort('The ebuild file is invalid or does not exist'); } @@ -348,7 +349,7 @@ sub update_manifest { $self->_notify('Adding Manifest entry for', $stat->distribution); - return $self->_run([ 'ebuild', $stat->eb_file, 'manifest' ], 0); + return $self->_run([ 'ebuild', $stat->ebuild_file, 'manifest' ], 0); } =head2 C @@ -435,7 +436,7 @@ sub install { my $conf = $self->parent->parent->configure_object; my $sudo = $conf->get_program('sudo'); - my @cmd = ('emerge', '=' . $stat->eb_name . '-' . $stat->eb_version); + my @cmd = ('emerge', '=' . $stat->ebuild_name . '-' . $stat->ebuild_version); unshift @cmd, $sudo if $sudo; my $success = $self->_run(\@cmd, 1); @@ -450,7 +451,7 @@ sub uninstall { my $conf = $self->parent->parent->configure_object; my $sudo = $conf->get_program('sudo'); - my @cmd = ('emerge', '-C', '=' . $stat->eb_name . '-' . $stat->eb_version); + my @cmd = ('emerge', '-C', '=' . $stat->ebuild_name . '-' . $stat->ebuild_version); unshift @cmd, $sudo if $sudo; my $success = $self->_run(\@cmd, 1);