Puppet: System Administration Automated

Support

Ticket #1226 (new enhancement)

Opened 6 months ago

Last modified 6 months ago

Patch to allow repository specification through --source

Reported by: emerose Assigned to: emerose
Priority: normal Milestone:
Component: package Version: 0.24.4
Severity: normal Keywords: gem repository source
Cc: Triage Stage: Accepted
Attached Patches: Insufficient Complexity: Unknown

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...

Change History

05/16/08 00:49:47 changed by luke

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.

05/16/08 00:50:08 changed by luke

  • stage changed from Unreviewed to Accepted.

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

05/16/08 09:24:43 changed by jamtur01

  • owner changed from community to emerose.
  • patch changed from Code to Insufficient.