Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle version strings starting with v - fix #44 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/g-cpan
Expand Up @@ -553,6 +553,7 @@ sub generatePackageInfo
spinner_start();
$gcpan_run->{cpan}{lc($ebuild_wanted)}{portage_name} = $gcpan_run->transformCPAN($gcpan_run->{cpan}{lc($ebuild_wanted)}{src_uri}, 'n');
$gcpan_run->{cpan}{lc($ebuild_wanted)}{portage_version} = $gcpan_run->transformCPAN($gcpan_run->{cpan}{lc($ebuild_wanted)}{src_uri}, 'v');
$gcpan_run->{cpan}{lc($ebuild_wanted)}{module_version} = $gcpan_run->transformCPAN($gcpan_run->{cpan}{lc($ebuild_wanted)}{src_uri}, 'mv');
spinner_stop();
}
else
Expand Down Expand Up @@ -686,7 +687,7 @@ sub generatePackageInfo
}
}

my $module_version = $gcpan_run->{cpan}{ lc($original_ebuild) }{portage_version};
my $module_version = $gcpan_run->{cpan}{ lc($original_ebuild) }{module_version};
my $description = $gcpan_run->{'cpan'}{ lc($original_ebuild) }{'description'};
$description =~ s/"/\\"/g;

Expand Down
4 changes: 2 additions & 2 deletions lib/Gentoo/CPAN.pm
Expand Up @@ -462,7 +462,7 @@ sub transformCPAN {
$filenamever =~ s/([0-9.]+)-([0-9.]+)$/$1\.$2/;

# Remove leading v's - happens on occasion
$filenamever =~ s{^v}{}i;
$filenamever =~ s{^v}{}i if $req ne 'mv';

# Some modules don't use the /\d\.\d\d/ convention, and portage goes
# berserk if the ebuild is called ebulldname-.02.ebuild -- so we treat
Expand All @@ -471,7 +471,7 @@ sub transformCPAN {
$filenamever = 0 . $filenamever;
}

return ( $req eq 'v' ) ? $filenamever : $filename;
return ( $req eq 'v' || $req eq 'mv' ) ? $filenamever : $filename;
}

sub makeCPANstub {
Expand Down