From: Vincent Pit Date: Sat, 24 Jan 2009 22:28:43 +0000 (+0100) Subject: Revert "Specifying MODULE_AUTHOR sets S and SRC_URI, so we can remove them. It also... X-Git-Tag: v0.05~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=9a88cbe7efd58f6ee7099d7286cd9c364e0946ed;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Revert "Specifying MODULE_AUTHOR sets S and SRC_URI, so we can remove them. It also sets HOMEPAGE, but to a suboptimal URI, so it's better to keep it for now" This reverts commit 94d4cd2d24e105bf0d2c8117e2b5d469ccd13581. For distributions that fall back into the "gentooisms" category, MODULE_AUTHOR can't be trusted to set SRC_URI properly, since the real source uri can't be guessed from the ebuild name. --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 22059a9..a696b77 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -110,7 +110,7 @@ sub init { my $stat = $self->status; my $conf = $self->parent->parent->configure_object; - $stat->mk_accessors(qw/name version author distribution desc uri license + $stat->mk_accessors(qw/name version author distribution desc uri src license deps eb_name eb_version eb_dir eb_file fetched_arch portdir_overlay overlay distdir keywords do_manifest header footer @@ -322,6 +322,13 @@ sub prepare { $stat->uri('http://search.cpan.org/dist/' . $name); + unless ($author =~ /^(.)(.)/) { + error 'Wrong author name -- aborting'; + return 0; + } + $stat->src("mirror://cpan/modules/by-authors/id/$1/$1$2/$author/" + . $mod->package); + $stat->license([ qw/Artistic GPL-2/ ]); my $prereqs = $mod->status->prereqs; @@ -389,8 +396,10 @@ sub create { my $d = $stat->header; $d .= "# Generated by CPANPLUS::Dist::Gentoo version $VERSION\n\n"; $d .= 'MODULE_AUTHOR="' . $stat->author . "\"\ninherit perl-module\n\n"; + $d .= 'S="${WORKDIR}/' . $stat->distribution . "\"\n"; $d .= 'DESCRIPTION="' . $stat->desc . "\"\n"; - $d .= 'HOMEPAGE="' . $stat->uri . "\"\n\n"; + $d .= 'HOMEPAGE="' . $stat->uri . "\"\n"; + $d .= 'SRC_URI="' . $stat->src . "\"\n"; $d .= "SLOT=\"0\"\n"; $d .= 'LICENSE="|| ( ' . join(' ', sort @{$stat->license}) . " )\"\n"; $d .= 'KEYWORDS="' . join(' ', sort @{$stat->keywords}) . "\"\n";