Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 495030 - app-portage/g-cpan-0.16.4-r1 - add support for vX.Y.Z
Summary: app-portage/g-cpan-0.16.4-r1 - add support for vX.Y.Z
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-12-22 17:39 UTC by Alex Efros
Modified: 2016-05-12 10:22 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
g-cpan-0.16.4-v.patch (g-cpan-0.16.4-v.patch,987 bytes, patch)
2013-12-22 17:39 UTC, Alex Efros
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2013-12-22 17:39:04 UTC
Created attachment 365898 [details, diff]
g-cpan-0.16.4-v.patch

g-cpan fails to generate correct ebuilds when perl module version begins with "v". It does most of work correctly, but generated ebuild tries to download -X.Y.Z.tar.gz instead of -vX.Y.Z.tar.gz and fails while "digest".

Attached patch solve this issue.
Comment 1 Sergiy Borodych 2015-01-05 20:43:52 UTC
Seem like the similar fix comes with
https://github.com/gentoo-perl/g-cpan/commit/c464ccf61b23942a591110f11386992f9e6fcedd

Could you please provide some examples for check?
Comment 2 Sergiy Borodych 2016-04-26 11:56:15 UTC
ping
Comment 3 Alex Efros 2016-04-26 13:29:55 UTC
Sorry, I've switched to installing system-wide modules using cpanm to /usr/local/ and don't use g-cpan anymore.
Comment 4 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2016-04-26 13:58:17 UTC
The thing you're looking for is when upstream define versions like this:

https://metacpan.org/release/URI-Encode

Its quite easy to handle if your workflow is right.

1. Copy VERSION token from upstream DISTNAME verbatim as DIST_VERSION ( EAPI6 )
2. Run upstream VERSION token verbatim through Gentoo::PerlMod::Version.
3. Stash that resulting number as PV on the filename.

The rest happens pretty much on its own.

My local "pre-bump" script basically has this tiny block of code in it, and all I have to do is pass upstreams version verbatim:

> use Gentoo::PerlMod::Version qw( gentooize_version );
>
> my $catpkg  = cwd_cat_pkg( repo, cwd() );
> my $version = args_version( \@ARGV );   ######
> my $gv      = gentooize_version( $version, { lax => 1 } );  #######
> my $basename = "$catpkg->{package}-$gv.ebuild";  ########
> my $basedir  = path(repo, $catpkg->{category}, $catpkg->{package} );
> my $destfile = $basedir->child($basename);
> 
> my $template = get_newest_ebuild( repo, $catpkg->{category}, $catpkg->{package} );
> $template = fix_year( $template, 2016 );
> $template = force_eapi6($template);
> $template = set_version( $template, $version ); ###### <-- this just sets DIST_VERSION to $version
> $destfile->spew_raw($template);


The only hard part really is working out "what is the dist version" from upstream ( tip: you can't rely on the contents of META.* for this, its wrong often enough to be a problem )

If you're parsing an arbitrary "URL To Tarball" with this however, it should be straight forward:

https://metacpan.org/pod/CPAN::DistnameInfo


I believe that returns "version" in the form you want consistently.

Note: 

lax => 1  will automatically turn on normalizing -TRIAL and x.yy_zz style alphas, without it, those types are errors.

HTH
Comment 5 Sergiy Borodych 2016-04-27 09:55:14 UTC
@Kent not really good example :)

 * Scanning /usr/portage for URI-Encode
 * Found ebuild for CPAN name URI-Encode
 * Ebuild already exists for URI-Encode (dev-perl/URI-Encode)

Thank you for significant information. I'll keep it in mind.
You are so aware as always ;)

As I stated above I fixed similar issue some time ago for #355619.
Thats why I need more examples to test.

@Alex I will be pleasure if you may provide me some modules names what was issue for you.
I want to know if it is still an issue for current version.
Comment 6 Alex Efros 2016-04-27 10:11:20 UTC
(In reply to Sergiy Borodych from comment #5)
> @Alex I will be pleasure if you may provide me some modules names what was
> issue for you.

2.5 year later? My memory isn't THAT good. :)

> I want to know if it is still an issue for current version.

I've just tested g-cpan on CGI::Stateless - everything looks good for me, so I think we can close this issue.
Comment 7 Sergiy Borodych 2016-05-12 07:40:07 UTC
Please close on this :)