Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-06-04 Thread Corentin Chary
On Sat, Jun 2, 2012 at 7:30 PM, Michael Weber  wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Is there any way to verify the  data?
>
> What programs/scripts use these fields btw?

euscan will soon, and I guess p.g.o will too.

> I could imagine a test like (i.e.  type="sourceforge">$a )
> does http://www.fs.net/$a exist.
>
> Michael

That could probably be done in remoteids.py



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-06-02 Thread Michael Weber
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Is there any way to verify the  data?

What programs/scripts use these fields btw?

I could imagine a test like (i.e. $a )
does http://www.fs.net/$a exist.

Michael

- --
Gentoo Dev
http://xmw.de/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iF4EAREIAAYFAk/KTbwACgkQknrdDGLu8JC47wD/WhUl5SqDnd9SZM7xyYWE3NG6
GN/lt6/0J+7W070szVYA/00BA1r0jBA3i93FpvobgvFiKlZSTLPaN5sJCJrrqULR
=Uufg
-END PGP SIGNATURE-



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-05-22 Thread Michael Weber
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Can we bump our gentoo-x86/skel.metadata.xml and
app-vim/gentoo-syntax:/usr/share/vim/vimfiles/plugin/newmetadata.vim
files to display some upstream+remote-id lines to make these tags more
prominent?


   
   
   
   
   
   
   
   



On 04/19/2012 05:31 PM, Corentin Chary wrote:
> Add rubygems, github, gitorious, pecl, pear, bitbucket. All of them
> are handled by my remoteids.py script.
> 
> ref: https://bugs.gentoo.org/show_bug.cgi?id=406287 ref:
> https://github.com/iksaif/portage-janitor/blob/master/remoteids.py
> 
> --- a/metadata/dtd/metadata.dtd   2010-03-02 18:52:11.0
> +0100 +++ b/metadata/dtd/metadata.dtd 2012-04-19 14:22:14.077954310
> +0200 @@ -61,7 +61,7 @@(#PCDATA)> -   (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
> #REQUIRED> +   (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
> #REQUIRED>
> 
> 
> 


- -- 
- --
Gentoo Dev
http://xmw.de/
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iF4EAREIAAYFAk+7n6IACgkQknrdDGLu8JB0bwEAlh9AilEx700DVEwQYD2KJxtc
nLrzXyCrZZLZLE6cpX8BAJIj05i+LN8ZLJOH3bAtcSp41YG4EarviiKTdEpy2Yon
=CQje
-END PGP SIGNATURE-



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-21 Thread Corentin Chary
On Sat, Apr 21, 2012 at 11:32:26AM +0200, Michał Górny wrote:
> On Thu, 19 Apr 2012 21:32:49 +0200
> Corentin Chary  wrote:
> 
> > On Thu, Apr 19, 2012 at 6:54 PM, Michał Górny 
> > wrote:
> > > On Thu, 19 Apr 2012 17:31:11 +0200
> > > Corentin Chary  wrote:
> > >
> > >> -       > >> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
> > >> #REQUIRED>
> > >> +       > >> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
> > >> #REQUIRED>
> > >
> > > Wouldn't it be better if we kept them sorted?
> > 
> > There were not, so I just appended them, but I can provide another
> > patch sorting them too if preferred.
> 
> I'll appreciate if you could do that, along with that cpan-module
> addition, and if noone objects, I'll just commit that.
> 
> -- 
> Best regards,
> Michał Górny


--- a/metadata/dtd/metadata.dtd 2010-03-02 18:52:11.0 +0100
+++ b/metadata/dtd/metadata.dtd 2012-04-21 13:09:52.557223402 +0200
@@ -61,7 +61,7 @@
 
 
 
-  
+  
 
   


-- 
Corentin Chary
http://xf.iksaif.net/


pgp65RpvYD2Le.pgp
Description: PGP signature


Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-21 Thread Michał Górny
On Thu, 19 Apr 2012 21:32:49 +0200
Corentin Chary  wrote:

> On Thu, Apr 19, 2012 at 6:54 PM, Michał Górny 
> wrote:
> > On Thu, 19 Apr 2012 17:31:11 +0200
> > Corentin Chary  wrote:
> >
> >> -       >> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
> >> #REQUIRED>
> >> +       >> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
> >> #REQUIRED>
> >
> > Wouldn't it be better if we kept them sorted?
> 
> There were not, so I just appended them, but I can provide another
> patch sorting them too if preferred.

I'll appreciate if you could do that, along with that cpan-module
addition, and if noone objects, I'll just commit that.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-21 Thread Corentin Chary
On Sat, Apr 21, 2012 at 03:33:18PM +1200, Kent Fredric wrote:
> On 21 April 2012 08:33, Corentin Chary  wrote:
> > On Fri, Apr 20, 2012 at 9:35 PM, Kent Fredric  wrote:
> >> On 21 April 2012 01:34, Corentin Chary  wrote:
> >>> Yeah, not very important, but seems to work with this patch:
> >>> https://github.com/iksaif/portage-janitor/commit/972aff94744741e34e99f917337430d245883c48
> 
> http://api.metacpan.org/release/Scalar-List-Utils
> 
> Will be far better an option than parsing HTML =)
> 
> And even better:
> 
> curl -XPOST 'http://api.metacpan.org/module/_search' -d '
> {
>   "fields": [
>   "module.name",
>   "release"
>   ],
>   "query": {
>   "constant_score": {
>   "filter" : {
>   "and" : [
>   { "term": { 
> "distribution":"Scalar-List-Utils" } },
>   { "term": { "status":"latest"} },
>   { "term": { 
> "mime":"text/x-script.perl-module"}},
>   { "term": { "indexed":"true"}},
>   { "term": { "module.authorized":"true"}}
>   ]
>   }
>   }
>   }
> }
> '
> 

It is !

$ ./remoteids.py --diff WWW-Bugzilla Moose bioperl Scalar-List-Utils libwww-perl
--- a/dev-perl/WWW-Bugzilla/metadata.xml
+++ b/dev-perl/WWW-Bugzilla/metadata.xml
@@ -3,6 +3,8 @@
 
   perl
   
+WWW::Bugzilla::Search
+WWW::Bugzilla
 WWW-Bugzilla
   
 
--- a/dev-perl/Moose/metadata.xml
+++ b/dev-perl/Moose/metadata.xml
@@ -3,6 +3,17 @@
 
   perl
   
+Class::MOP
+Moose::Meta::Attribute::Native::Trait::Counter
+Moose::Meta::Attribute::Native::Trait::String
+Moose::Meta::Method::Delegation
+Moose::Meta::TypeConstraint::Role
+Moose::Meta::Attribute::Custom::Moose
+Moose::Meta::Attribute
+Moose::Meta::Method
+Moose::Error::Croak
+Moose::Util::MetaRole
+Moose::Role
 Moose
   
 
--- a/perl-core/Scalar-List-Utils/metadata.xml
+++ b/perl-core/Scalar-List-Utils/metadata.xml
@@ -3,6 +3,9 @@
 
   perl
   
+List::Util
+Scalar::Util
+List::Util::XS
 Scalar-List-Utils
   
 
--- a/dev-perl/libwww-perl/metadata.xml
+++ b/dev-perl/libwww-perl/metadata.xml
@@ -3,6 +3,17 @@
 
   perl
   
+LWP::Protocol::data
+LWP::Protocol::gopher
+LWP::Debug
+LWP::UserAgent
+LWP::Authen::Digest
+LWP::Protocol::file
+LWP::Protocol::loopback
+LWP::Protocol::MyFTP
+LWP::Protocol::ftp
+LWP::Protocol::cpan
+LWP::MemberMixin
 libwww-perl
   
 


-- 
Corentin Chary
http://xf.iksaif.net/



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Kent Fredric
On 21 April 2012 08:33, Corentin Chary  wrote:
> On Fri, Apr 20, 2012 at 9:35 PM, Kent Fredric  wrote:
>> On 21 April 2012 01:34, Corentin Chary  wrote:
>>> Yeah, not very important, but seems to work with this patch:
>>> https://github.com/iksaif/portage-janitor/commit/972aff94744741e34e99f917337430d245883c48
>>>
>>> Example:
>>> $ python remoteids.py --diff WWW-Bugzilla Moose bioperl
>>> --- a/dev-perl/WWW-Bugzilla/metadata.xml
>>> +++ b/dev-perl/WWW-Bugzilla/metadata.xml
>>> @@ -3,6 +3,7 @@
>>>  
>> ...
>>> --
>>> Corentin Chary
>>> http://xf.iksaif.net/
>>>
>>
>> What does it to for say, Scalar-List-Utils ?  or libwww-perl ?
>
> Nothing, it's one of the cases you'll have to handle by-hand.
> Another option is to parse the HTML from
> http://search.cpan.org/dist/Scalar-List-Utils/ but I'm not a fan of
> HTML-parsing.
>
> --
> Corentin Chary
> http://xf.iksaif.net
>

http://api.metacpan.org/release/Scalar-List-Utils

Will be far better an option than parsing HTML =)

And even better:

curl -XPOST 'http://api.metacpan.org/module/_search' -d '
{
"fields": [
"module.name",
"release"
],
"query": {
"constant_score": {
"filter" : {
"and" : [
{ "term": { 
"distribution":"Scalar-List-Utils" } },
{ "term": { "status":"latest"} },
{ "term": { 
"mime":"text/x-script.perl-module"}},
{ "term": { "indexed":"true"}},
{ "term": { "module.authorized":"true"}}
]
}
}
}
}
'


-- 
Kent

perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"

http://kent-fredric.fox.geek.nz



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Corentin Chary
On Fri, Apr 20, 2012 at 9:35 PM, Kent Fredric  wrote:
> On 21 April 2012 01:34, Corentin Chary  wrote:
>> Yeah, not very important, but seems to work with this patch:
>> https://github.com/iksaif/portage-janitor/commit/972aff94744741e34e99f917337430d245883c48
>>
>> Example:
>> $ python remoteids.py --diff WWW-Bugzilla Moose bioperl
>> --- a/dev-perl/WWW-Bugzilla/metadata.xml
>> +++ b/dev-perl/WWW-Bugzilla/metadata.xml
>> @@ -3,6 +3,7 @@
>>  
> ...
>> --
>> Corentin Chary
>> http://xf.iksaif.net/
>>
>
> What does it to for say, Scalar-List-Utils ?  or libwww-perl ?

Nothing, it's one of the cases you'll have to handle by-hand.
Another option is to parse the HTML from
http://search.cpan.org/dist/Scalar-List-Utils/ but I'm not a fan of
HTML-parsing.

-- 
Corentin Chary
http://xf.iksaif.net



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Kent Fredric
On 21 April 2012 01:34, Corentin Chary  wrote:
> Yeah, not very important, but seems to work with this patch:
> https://github.com/iksaif/portage-janitor/commit/972aff94744741e34e99f917337430d245883c48
>
> Example:
> $ python remoteids.py --diff WWW-Bugzilla Moose bioperl
> --- a/dev-perl/WWW-Bugzilla/metadata.xml
> +++ b/dev-perl/WWW-Bugzilla/metadata.xml
> @@ -3,6 +3,7 @@
>  
...
> --
> Corentin Chary
> http://xf.iksaif.net/
>

What does it to for say, Scalar-List-Utils ?  or libwww-perl ?


-- 
Kent

perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"

http://kent-fredric.fox.geek.nz



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Corentin Chary
On Sat, Apr 21, 2012 at 12:39:26AM +1200, Kent Fredric wrote:
> If you really want to support Perl Modules, ( which theres not much
> need for at present, looks like the team have gone through already for
> the most part and added remote-id's where possible already ), anything
> that inherits 'perl-module.eclass' has a bit of magic, in that neither
> SRC_URI or HOMEPAGE is required in the ebuild, and it just gets the
> package name from what gentoo is using.  We've tried to be as close to
> upstream as possible for the ease of maintenance.

Actually the eclass seems to fill SRC_URI and HOMEPAGE, so when you source
the ebuild they are available.

> However, there are still exception cases, for instance, BioPerl has to
> define 'MY_PN' to tell the perl-module eclass to use a different token
> ( and when this is present, it should be sufficient to say that that
> should be the remote-id instead of the package name:
> see dev-perl/Moose  # an example with neither src_uri or homepage
> see sci-biology/bioperl # an example where the package name has
> been forced overridden as its changed upstream
> 
> But resolving module names is much trickier, its easy-ish to map a
> module name to a package using the service, but doing it the other way
> round is not so straight forward, as one package can have many
> modules, and its common in perl to state dependencies in terms of the
> module to require, not the package its in, but there's also often a
> defacto "main module".
> 
> But I'm myself still working out how to best do that with the service
> , so auto-populating a "cpan-module" identifier can be left to later,
> its just something I considered "useful" to have metadata wise because
> that value is more useful to users.

Yeah, not very important, but seems to work with this patch:
https://github.com/iksaif/portage-janitor/commit/972aff94744741e34e99f917337430d245883c48

Example:
$ python remoteids.py --diff WWW-Bugzilla Moose bioperl
--- a/dev-perl/WWW-Bugzilla/metadata.xml
+++ b/dev-perl/WWW-Bugzilla/metadata.xml
@@ -3,6 +3,7 @@
 
   perl
   
+WWW::Bugzilla
 WWW-Bugzilla
   
 
--- a/dev-perl/Moose/metadata.xml
+++ b/dev-perl/Moose/metadata.xml
@@ -3,6 +3,7 @@
 
   perl
   
+Moose
 Moose
   
 
--- a/sci-biology/bioperl/metadata.xml
+++ b/sci-biology/bioperl/metadata.xml
@@ -8,6 +8,7 @@ 
Install sci-biology/bioperl-run


+   BioPerl
BioPerl

 

-- 
Corentin Chary
http://xf.iksaif.net/



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Kent Fredric
On 20 April 2012 23:21, Corentin Chary  wrote:
>
> Currently it uses SRC_URI and HOMEPAGE, but honestly it wouldn't be
> hard to use any other environment variable and to do some checks on a
> webservice.
> Anyway for tricky cases it can still be done by hand.
>
> --
> Corentin Chary
> http://xf.iksaif.net
>


If you really want to support Perl Modules, ( which theres not much
need for at present, looks like the team have gone through already for
the most part and added remote-id's where possible already ), anything
that inherits 'perl-module.eclass' has a bit of magic, in that neither
SRC_URI or HOMEPAGE is required in the ebuild, and it just gets the
package name from what gentoo is using.  We've tried to be as close to
upstream as possible for the ease of maintenance.

However, there are still exception cases, for instance, BioPerl has to
define 'MY_PN' to tell the perl-module eclass to use a different token
( and when this is present, it should be sufficient to say that that
should be the remote-id instead of the package name:
see dev-perl/Moose  # an example with neither src_uri or homepage
see sci-biology/bioperl # an example where the package name has
been forced overridden as its changed upstream

But resolving module names is much trickier, its easy-ish to map a
module name to a package using the service, but doing it the other way
round is not so straight forward, as one package can have many
modules, and its common in perl to state dependencies in terms of the
module to require, not the package its in, but there's also often a
defacto "main module".

But I'm myself still working out how to best do that with the service
, so auto-populating a "cpan-module" identifier can be left to later,
its just something I considered "useful" to have metadata wise because
that value is more useful to users.

-- 
Kent

perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"

http://kent-fredric.fox.geek.nz



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Corentin Chary
On Fri, Apr 20, 2012 at 10:26 AM, Kent Fredric  wrote:
> On 20 April 2012 19:46, Corentin Chary  wrote:
>> On Fri, Apr 20, 2012 at 9:37 AM, Kent Fredric  wrote:
>>> On 20 April 2012 03:31, Corentin Chary  wrote:
 Add rubygems, github, gitorious, pecl, pear, bitbucket.
 All of them are handled by my remoteids.py script.

 ref: https://bugs.gentoo.org/show_bug.cgi?id=406287
 ref: https://github.com/iksaif/portage-janitor/blob/master/remoteids.py

 --- a/metadata/dtd/metadata.dtd 2010-03-02 18:52:11.0 +0100
 +++ b/metadata/dtd/metadata.dtd 2012-04-19 14:22:14.077954310 +0200
 @@ -61,7 +61,7 @@
     
     
     
 -      >>> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
  #REQUIRED>
 +      >>> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
  #REQUIRED>

   

 --
 Corentin Chary
 http://xf.iksaif.net/
>>>
>>>
>>> I suggested last week on #gentoo-perl that it might be nice to have
>>> 'cpan' and 'cpan-module'  ( or something like that ) to disambiguate 2
>>> queryable terms. ( where 'cpan'  => 'the package name on cpan' )
>>>
>>> For some purposes, its most convenient to use the distribution name,
>>> and for other purposes, (ie: cpan clients) its more convenient to use
>>> a Module name, and its not easy to translate between the two, as
>>> Module names sometimes switch between packages  they're shipped in.
>>>
>>> For instance, a while ago, the BioPerl module was shipped in a
>>> distribution 'bioperl' , which has only recently been changed to
>>> BioPerl
>>>
>>>
>>> http://api.metacpan.org/release/_search?q=distribution:bioperl&fields=archive,author,date,download_url
>>>
>>> http://api.metacpan.org/release/_search?q=distribution:BioPerl&fields=archive,author,date,download_url
>>>
>>> vs
>>>
>>>
>>> http://api.metacpan.org/module/_search?q=module.name:Bio\:\:Perl&fields=distribution,author,release
>>
>> Looks sane since the goal of remote-id is being able to identify the
>> package upstream.
>> Do you think you could patch remotesid.py to generate tags for cpan /
>> cpan-modules ? Or at least give me a pseudo-algo that does the trick.
>> Thanks :)
>>
>> --
>> Corentin Chary
>> http://xf.iksaif.net
>>
>
>
> That is sadly not straight forward.  Extracting the package name can
> be straight forward if you have the URL, because the package name is
> literally the same as the archive name in SRC_URI , sans version
> information.
>
> However, if you look at many perl ebuilds, you'll notice many lack
> this field and we've got other things in place, so the current parsing
> technique you use to detect uses of SRC_URI wont work there ( I could
> be wrong, I don't fully grok your python code )

Currently it uses SRC_URI and HOMEPAGE, but honestly it wouldn't be
hard to use any other environment variable and to do some checks on a
webservice.
Anyway for tricky cases it can still be done by hand.

> And more-over, determining the value of 'cpan-module' may be
> impossible without access to the tar.gz itself, or querying the
> MetaCPAN API.
>
> Usually, upstream are sensible and have package names which closely
> correspond with the module names, ie: "Dist::Zilla" is shipped in
> 'Dist-Zilla-$VERSION.tar.gz',  but there are many packages which dont
> do this, such as this notable example:
> https://metacpan.org/release/Scalar-List-Utils  , which has no modules
> corresponding to the package name, and no way to divine the/a 'main'
> module from the package itself. ( and this is exacerbated by packages
> changing names, or package joins ( 2 packages becoming 1 via releasing
> modules together ),  and package splits ( 1 package rips into 2 sets
> of modules ).
>
> Essentially, using a cpan-module as an identifier is somewhat
> "forwards only" , and even then, what it will resolve to is governed
> by time.
>
> This is fine for CPAN clients, which do the resolution hot, using the
> whole of CPAN as their data, if a user asks for "Foo::Bar", their cpan
> client will ask a cpan server ( or regularly (hourly) updated list )
> as to what package that module can be found in ( and this only returns
> the most recent package, so name changes and so-forth are invisible to
> the user ).
>
> And being helpful to CPAN clients is one of the reasons we want this
> value as a specifiable option in the first place. For us, its easier
> to track the package name, and then when that has to change we can
> manually resolve the issue
>
> --
> Kent
>
> perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
> 3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"
>
> http://kent-fredric.fox.geek.nz
>



-- 
Corentin Chary
http://xf.iksaif.net



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Kent Fredric
On 20 April 2012 19:46, Corentin Chary  wrote:
> On Fri, Apr 20, 2012 at 9:37 AM, Kent Fredric  wrote:
>> On 20 April 2012 03:31, Corentin Chary  wrote:
>>> Add rubygems, github, gitorious, pecl, pear, bitbucket.
>>> All of them are handled by my remoteids.py script.
>>>
>>> ref: https://bugs.gentoo.org/show_bug.cgi?id=406287
>>> ref: https://github.com/iksaif/portage-janitor/blob/master/remoteids.py
>>>
>>> --- a/metadata/dtd/metadata.dtd 2010-03-02 18:52:11.0 +0100
>>> +++ b/metadata/dtd/metadata.dtd 2012-04-19 14:22:14.077954310 +0200
>>> @@ -61,7 +61,7 @@
>>>     
>>>     
>>>     
>>> -      >> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
>>>  #REQUIRED>
>>> +      >> (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
>>>  #REQUIRED>
>>>
>>>   
>>>
>>> --
>>> Corentin Chary
>>> http://xf.iksaif.net/
>>
>>
>> I suggested last week on #gentoo-perl that it might be nice to have
>> 'cpan' and 'cpan-module'  ( or something like that ) to disambiguate 2
>> queryable terms. ( where 'cpan'  => 'the package name on cpan' )
>>
>> For some purposes, its most convenient to use the distribution name,
>> and for other purposes, (ie: cpan clients) its more convenient to use
>> a Module name, and its not easy to translate between the two, as
>> Module names sometimes switch between packages  they're shipped in.
>>
>> For instance, a while ago, the BioPerl module was shipped in a
>> distribution 'bioperl' , which has only recently been changed to
>> BioPerl
>>
>>
>> http://api.metacpan.org/release/_search?q=distribution:bioperl&fields=archive,author,date,download_url
>>
>> http://api.metacpan.org/release/_search?q=distribution:BioPerl&fields=archive,author,date,download_url
>>
>> vs
>>
>>
>> http://api.metacpan.org/module/_search?q=module.name:Bio\:\:Perl&fields=distribution,author,release
>
> Looks sane since the goal of remote-id is being able to identify the
> package upstream.
> Do you think you could patch remotesid.py to generate tags for cpan /
> cpan-modules ? Or at least give me a pseudo-algo that does the trick.
> Thanks :)
>
> --
> Corentin Chary
> http://xf.iksaif.net
>


That is sadly not straight forward.  Extracting the package name can
be straight forward if you have the URL, because the package name is
literally the same as the archive name in SRC_URI , sans version
information.

However, if you look at many perl ebuilds, you'll notice many lack
this field and we've got other things in place, so the current parsing
technique you use to detect uses of SRC_URI wont work there ( I could
be wrong, I don't fully grok your python code )

And more-over, determining the value of 'cpan-module' may be
impossible without access to the tar.gz itself, or querying the
MetaCPAN API.

Usually, upstream are sensible and have package names which closely
correspond with the module names, ie: "Dist::Zilla" is shipped in
'Dist-Zilla-$VERSION.tar.gz',  but there are many packages which dont
do this, such as this notable example:
https://metacpan.org/release/Scalar-List-Utils  , which has no modules
corresponding to the package name, and no way to divine the/a 'main'
module from the package itself. ( and this is exacerbated by packages
changing names, or package joins ( 2 packages becoming 1 via releasing
modules together ),  and package splits ( 1 package rips into 2 sets
of modules ).

Essentially, using a cpan-module as an identifier is somewhat
"forwards only" , and even then, what it will resolve to is governed
by time.

This is fine for CPAN clients, which do the resolution hot, using the
whole of CPAN as their data, if a user asks for "Foo::Bar", their cpan
client will ask a cpan server ( or regularly (hourly) updated list )
as to what package that module can be found in ( and this only returns
the most recent package, so name changes and so-forth are invisible to
the user ).

And being helpful to CPAN clients is one of the reasons we want this
value as a specifiable option in the first place. For us, its easier
to track the package name, and then when that has to change we can
manually resolve the issue

-- 
Kent

perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"

http://kent-fredric.fox.geek.nz



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Corentin Chary
On Fri, Apr 20, 2012 at 9:37 AM, Kent Fredric  wrote:
> On 20 April 2012 03:31, Corentin Chary  wrote:
>> Add rubygems, github, gitorious, pecl, pear, bitbucket.
>> All of them are handled by my remoteids.py script.
>>
>> ref: https://bugs.gentoo.org/show_bug.cgi?id=406287
>> ref: https://github.com/iksaif/portage-janitor/blob/master/remoteids.py
>>
>> --- a/metadata/dtd/metadata.dtd 2010-03-02 18:52:11.0 +0100
>> +++ b/metadata/dtd/metadata.dtd 2012-04-19 14:22:14.077954310 +0200
>> @@ -61,7 +61,7 @@
>>     
>>     
>>     
>> -      > (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
>>  #REQUIRED>
>> +      > (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
>>  #REQUIRED>
>>
>>   
>>
>> --
>> Corentin Chary
>> http://xf.iksaif.net/
>
>
> I suggested last week on #gentoo-perl that it might be nice to have
> 'cpan' and 'cpan-module'  ( or something like that ) to disambiguate 2
> queryable terms. ( where 'cpan'  => 'the package name on cpan' )
>
> For some purposes, its most convenient to use the distribution name,
> and for other purposes, (ie: cpan clients) its more convenient to use
> a Module name, and its not easy to translate between the two, as
> Module names sometimes switch between packages  they're shipped in.
>
> For instance, a while ago, the BioPerl module was shipped in a
> distribution 'bioperl' , which has only recently been changed to
> BioPerl
>
>
> http://api.metacpan.org/release/_search?q=distribution:bioperl&fields=archive,author,date,download_url
>
> http://api.metacpan.org/release/_search?q=distribution:BioPerl&fields=archive,author,date,download_url
>
> vs
>
>
> http://api.metacpan.org/module/_search?q=module.name:Bio\:\:Perl&fields=distribution,author,release

Looks sane since the goal of remote-id is being able to identify the
package upstream.
Do you think you could patch remotesid.py to generate tags for cpan /
cpan-modules ? Or at least give me a pseudo-algo that does the trick.
Thanks :)

-- 
Corentin Chary
http://xf.iksaif.net



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-20 Thread Kent Fredric
On 20 April 2012 03:31, Corentin Chary  wrote:
> Add rubygems, github, gitorious, pecl, pear, bitbucket.
> All of them are handled by my remoteids.py script.
>
> ref: https://bugs.gentoo.org/show_bug.cgi?id=406287
> ref: https://github.com/iksaif/portage-janitor/blob/master/remoteids.py
>
> --- a/metadata/dtd/metadata.dtd 2010-03-02 18:52:11.0 +0100
> +++ b/metadata/dtd/metadata.dtd 2012-04-19 14:22:14.077954310 +0200
> @@ -61,7 +61,7 @@
>     
>     
>     
> -       (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
>  #REQUIRED>
> +       (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
>  #REQUIRED>
>
>   
>
> --
> Corentin Chary
> http://xf.iksaif.net/


I suggested last week on #gentoo-perl that it might be nice to have
'cpan' and 'cpan-module'  ( or something like that ) to disambiguate 2
queryable terms. ( where 'cpan'  => 'the package name on cpan' )

For some purposes, its most convenient to use the distribution name,
and for other purposes, (ie: cpan clients) its more convenient to use
a Module name, and its not easy to translate between the two, as
Module names sometimes switch between packages  they're shipped in.

For instance, a while ago, the BioPerl module was shipped in a
distribution 'bioperl' , which has only recently been changed to
BioPerl


http://api.metacpan.org/release/_search?q=distribution:bioperl&fields=archive,author,date,download_url

http://api.metacpan.org/release/_search?q=distribution:BioPerl&fields=archive,author,date,download_url

vs


http://api.metacpan.org/module/_search?q=module.name:Bio\:\:Perl&fields=distribution,author,release



-- 
Kent

perl -e  "print substr( \"edrgmaM  SPA NOcomil.ic\\@tfrken\", \$_ * 3,
3 ) for ( 9,8,0,7,1,6,5,4,3,2 );"

http://kent-fredric.fox.geek.nz



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-19 Thread Robin H. Johnson
On Thu, Apr 19, 2012 at 05:31:11PM +0200, Corentin Chary wrote:
> Add rubygems, github, gitorious, pecl, pear, bitbucket.
> All of them are handled by my remoteids.py script.
Can we get Launchpad added as well?

-- 
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robb...@gentoo.org
GnuPG FP   : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-19 Thread Corentin Chary
On Thu, Apr 19, 2012 at 6:54 PM, Michał Górny  wrote:
> On Thu, 19 Apr 2012 17:31:11 +0200
> Corentin Chary  wrote:
>
>> -      > (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
>> #REQUIRED>
>> +      > (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
>> #REQUIRED>
>
> Wouldn't it be better if we kept them sorted?

There were not, so I just appended them, but I can provide another
patch sorting them too if preferred.


-- 
Corentin Chary
http://xf.iksaif.net



Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-19 Thread Michał Górny
On Thu, 19 Apr 2012 20:08:09 +0200
""Paweł Hajdan, Jr.""  wrote:

> On 4/19/12 5:31 PM, Corentin Chary wrote:
> > Add rubygems, github, gitorious, pecl, pear, bitbucket.
> > All of them are handled by my remoteids.py script.
> 
> Just making sure: do github, gitorious and bitbucket provide file
> hosting? I know they host repos, but for most ebuilds where remote-id
> would be useful, we need tarballs.

Yes, they do.

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-19 Thread Paweł Hajdan, Jr.
On 4/19/12 5:31 PM, Corentin Chary wrote:
> Add rubygems, github, gitorious, pecl, pear, bitbucket.
> All of them are handled by my remoteids.py script.

Just making sure: do github, gitorious and bitbucket provide file
hosting? I know they host repos, but for most ebuilds where remote-id
would be useful, we need tarballs.



signature.asc
Description: OpenPGP digital signature


Re: [gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-19 Thread Michał Górny
On Thu, 19 Apr 2012 17:31:11 +0200
Corentin Chary  wrote:

> -   (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran)
> #REQUIRED>
> +   (freshmeat|sourceforge|sourceforge-jp|cpan|vim|google-code|ctan|pypi|rubyforge|cran|rubygems|github|gitorious|pecl|pear|bitbucket)
> #REQUIRED>

Wouldn't it be better if we kept them sorted?

-- 
Best regards,
Michał Górny


signature.asc
Description: PGP signature


[gentoo-dev] RFC: Add new remote-id types in metadata.dtd

2012-04-19 Thread Corentin Chary
Add rubygems, github, gitorious, pecl, pear, bitbucket.
All of them are handled by my remoteids.py script.

ref: https://bugs.gentoo.org/show_bug.cgi?id=406287
ref: https://github.com/iksaif/portage-janitor/blob/master/remoteids.py

--- a/metadata/dtd/metadata.dtd 2010-03-02 18:52:11.0 +0100
+++ b/metadata/dtd/metadata.dtd 2012-04-19 14:22:14.077954310 +0200
@@ -61,7 +61,7 @@
 
 
 
-  
+  
 
   

-- 
Corentin Chary
http://xf.iksaif.net/


pgplrUeuh7QHW.pgp
Description: PGP signature