Hey folks, I''ve looked through the docs, and the mailing list, but for the life of me I can''t figure out how to specify an alternate gem repository for a package. From the docs, it looks like I should be able to do source => whatever, but this seems to just send gem looking for a specific gem at a url, rather then the more general alternate source for the gem. It looks to me like the gem server will not except a direct url. Am I missing something simple? I''d just like to be able to do the equivalent of gem install foogem --source http://gem.example.com. Thanks, -Joel
On Jan 6, 2008, at 2:52 PM, Joel Wood wrote:> > Am I missing something simple? I''d just like to be able to do the > equivalent of gem install foogem --source http://gem.example.com.It looks like this isn''t possible with the current provider, and AFAIK you''re the first person to ask for it. The ''source'' parameter is already used (for specifying a gem file to install), so we''d need to create a new parameter or reuse a different one. -- Aizu''s Second Law: What changes the world is communication, not information. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Hi Luke, Glad to know I''m not missing something. Since the gem source url currently is ment to point to a gem directly, what would you think about modifying the provider so that if you pass it a url with a gem in it, it behaves one way, and without a gem it behaves another. So: foo/baz/cat/file.gem would create the line: gem install foo/baz/cat/file.gem while: http://gem.example.com would be interpreted as: gem install file.gem --source http://gem.example.com. I''d think a simple regex would do it. -Joel On Sun, 6 Jan 2008, Luke Kanies wrote:> On Jan 6, 2008, at 2:52 PM, Joel Wood wrote: >> >> Am I missing something simple? I''d just like to be able to do the >> equivalent of gem install foogem --source http://gem.example.com. > > It looks like this isn''t possible with the current provider, and AFAIK > you''re the first person to ask for it. > > The ''source'' parameter is already used (for specifying a gem file to > install), so we''d need to create a new parameter or reuse a different > one. > > -- > Aizu''s Second Law: > What changes the world is communication, not information. > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Jan 6, 2008, at 3:59 PM, Joel Wood wrote:> Hi Luke, > > Glad to know I''m not missing something. > > Since the gem source url currently is ment to point to a gem directly, > what would you think about modifying the provider so that if you > pass it a > url with a gem in it, it behaves one way, and without a gem it behaves > another. > > So: > > foo/baz/cat/file.gem > > would create the line: gem install foo/baz/cat/file.gem > > while: http://gem.example.com > > would be interpreted as: > > gem install file.gem --source http://gem.example.com. > > I''d think a simple regex would do it.It seems reasonable to me. If you supply the patch I''ll accept it. -- A nation is a society united by delusions about its ancestry and by common hatred of its neighbors. -- William Ralph Inge --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
I created a patch, but am having some problems. When called through puppet I get: err: //Node[master01]/gems/Package[fakegemfoo]/ensure: change from absent to present failed: Execution of ''/usr/bin/gem install --include-dependencies --source http://gems.example.com fakegemfoo'' returned 256: ERROR: While executing gem ... (OptionParser::InvalidOption) invalid option: --source But if I run that command from the terminal it works fine. Hints? Thanks, -Joel The patch: --- gem.rb.orig 2008-01-08 10:10:46.000000000 -0800 +++ gem.rb 2008-01-08 10:13:41.000000000 -0800 @@ -73,7 +73,12 @@ command << "--include-dependencies" if source = @resource[:source] - command << source + if source =~ /.*\.gem$/ + command << source + else + command << "--source " << @resource[:source] + command << @resource[:name] + end else command << @resource[:name] end On Wed, 16 Jan 2008, Luke Kanies wrote:> On Jan 6, 2008, at 3:59 PM, Joel Wood wrote: > >> Hi Luke, >> >> Glad to know I''m not missing something. >> >> Since the gem source url currently is ment to point to a gem directly, >> what would you think about modifying the provider so that if you >> pass it a >> url with a gem in it, it behaves one way, and without a gem it behaves >> another. >> >> So: >> >> foo/baz/cat/file.gem >> >> would create the line: gem install foo/baz/cat/file.gem >> >> while: http://gem.example.com >> >> would be interpreted as: >> >> gem install file.gem --source http://gem.example.com. >> >> I''d think a simple regex would do it. > > > It seems reasonable to me. If you supply the patch I''ll accept it. > > -- > A nation is a society united by delusions about its ancestry and by > common hatred of its neighbors. -- William Ralph Inge > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Jan 17, 2008, at 11:43 AM, Joel Wood wrote:> I created a patch, but am having some problems. When called through > puppet I get: > > err: //Node[master01]/gems/Package[fakegemfoo]/ensure: change from > absent > to present failed: Execution of ''/usr/bin/gem install > --include-dependencies --source http://gems.example.com fakegemfoo'' > returned 256: ERROR: While executing gem ... > (OptionParser::InvalidOption) > invalid option: --source > > But if I run that command from the terminal it works fine. Hints?Maybe there''s some kind of environment difference? Or sudo is affecting things? Otherwise, I have no idea. -- Levy''s Law: The truth is always more interesting than your preconception of what it might be. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com