Skip to content
This repository has been archived by the owner on Mar 7, 2019. It is now read-only.

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

Closed
djerius opened this issue Mar 2, 2016 · 3 comments

Comments

@djerius
Copy link

djerius commented Mar 2, 2016

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
Copy link
Contributor

plicease commented Mar 2, 2016

Are you using exact_filename?

@djerius
Copy link
Author

djerius commented Mar 2, 2016

Yes:

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

plicease added a commit that referenced this issue Mar 3, 2016
@plicease
Copy link
Contributor

plicease commented Mar 9, 2016

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

@plicease plicease closed this as completed Mar 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants