Perl5-Alien / Alien-Base

Base classes for Alien:: modules (deprecated, see Alien-Build)
Other
35 stars 19 forks source link

last path component in alien_repository{location} deleted if it doesn't end in a / (for http) #161

Closed djerius closed 8 years ago

djerius commented 8 years ago

In Alien::Base::ModuleBuild::Repository::HTTP::build_uri, if the passed $path (which corresponds to the alien_repository location parameter) does not end in a / its last component is removed by URI->new_abs. For example, if the arguments to build_uri are

  DB<3> x @_
0  'https'
1  'github.com'
2  'ericmandel/xpa/archive/'
3  'v2.1.17.zip'

one gets this

  DB<5> p $uri
https://github.com/ericmandel/xpa/archive/v2.1.17.zip

However, if the arguments are

  DB<3> x @_
0  'https'
1  'github.com'
2  'ericmandel/xpa/archive'
3  'v2.1.17.zip'

one gets this

  DB<5> p $uri
https://github.com/ericmandel/xpa/v2.1.17.zip

which (to me at least) is surprising. I can't think of a context in which the caller isn't expecting the full path to be used, so I'd like to suggest ensuring that the path always ends in a /. If not, a documentation update would be appreciated.

Thanks, Diab

plicease commented 8 years ago

Are you using exact_filename?

djerius commented 8 years ago

Yes:

 alien_repository => [
        {
         protocol => 'https',
         host     => 'github.com',
         location => 'ericmandel/xpa/archive',
         exact_filename => "v2.1.17.zip",
        },
 ],
plicease commented 8 years ago

This is fixed in 0.027_03. I will do a production release on Monday, assuming nothing bad shows up in cpantesters before then.