Feature #1226

Patch to allow repository specification through --source

Added by Sam Quigley about 4 years ago. Updated almost 4 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:James Turnbull % Done:

0%

Category:package
Target version:0.24.5
Affected Puppet version: Branch:
Keywords:
Votes: 0

Description

In http://github.com/emerose/puppet/commit/71abfcb381e0ed141c270c6d9980e91161a4eba8 I’ve written a patch that will overload the ‘source’ parameter for the gem provider. If the source is a URL (with non-nil scheme part), the source will be passed to the gem —source option; otherwise, the source option will behave as before (ie, be interpreted as a path on the local disk where the gem to install can be found).

Note that the patch also adds an is_uri? method to the Puppet:Util::URIHelper module — and that there’s room for disagreement about whether it does the right thing (as there is about whether that method is useful outside the gem provider). In particular, URI.parse in the Ruby standard library interprets “/usr/bin/foo” as a perfectly valid URI that just happens to have a nil scheme component. A call to is_uri?(“/usr/bin/foo”) will return false, however. That seems right to me; if there’s disagreement about that, though, I’d be happy to re-work this patch…


Related issues

related to Puppet - Feature #7886: support gem repository in a directory in the filesystem In Topic Branch Pending Review 06/10/2011

History

Updated by Luke Kanies about 4 years ago

I’m fine with this change, I think, but I’d like to see tests for the new code (and, if possible, please add tests for the whole gem provider).

You should also document this change in the provider.

Updated by Luke Kanies about 4 years ago

And as mentioned on irc, this patch should be against 0.24.x, not master.

Updated by Redmine Admin almost 4 years ago

  • Status changed from 1 to Accepted

Updated by Luke Kanies almost 4 years ago

Any progress on updating this commit to add tests and be against 0.24.x?

Updated by Sam Quigley almost 4 years ago

Sorry, I haven’t touched this in a while. Writing tests for providers turns out to be extremely frustrating, in light of the way every module seems to be intertwined with every other module. I’d really hoped this would be a quick fix; unfortunately, I don’t have time to unravel the RAL code right now…

If anyone does want to pick this up, the changes at http://github.com/emerose/puppet/commit/ed94b54105de4415f71c377faca4bee1a02d95d8 are a pretty significant improvement over the previous patch…

-sq

Updated by Luke Kanies almost 4 years ago

  • Status changed from Accepted to Ready For Checkin
  • Assignee changed from Sam Quigley to James Turnbull
  • Target version set to 0.24.5

Fixed in branch tickets/0.24.x/1226 in my repo.

Updated by James Turnbull almost 4 years ago

  • Status changed from Ready For Checkin to Closed

Pushed in commit:56525beb26d8371533a17667e6ebcae0cda9a6f6 in branch 0.24.x

Also available in: Atom PDF