Issue #7886 has been updated by jared jennings.
The original code (which treats both `file:///` URLs and absolute paths as locators for one gem, never a repository) was written for #1226 by Sam Quigley three years ago. See commit:71f4b02f1d and commit:667fac18cc. Josh Cooper wrote: > [I]s there a historical reason why someone would specify a file URI, but not > want the --source <URL> option to be used? I know of none; but I think it's minimally surprising for `file:///foo` to mean exactly what `/foo` does, and so it should stay that way. As to why both `file:///` URLS and absolute paths presently mean only a single gem, I surmise that any normal person who wants to set up a site-specific gem repo would throw it on a web server. But at my site NFS is much, much easier. That's why this issue arose for me, and why I think it never came up before now. > What if instead we omitted the --source parameter when the source parameter > is an absolute path? Otherwise, it's a URL and we always append --source > <URL> to the gem command? That's one way to split it up. But I think the analogy "gem : repository :: path : URL" is not as close as "gem : repository :: file : directory". Both filesystem paths and URLs can end with a slash or not, and in both regimes, ending with a slash makes it explicit that you're talking about a directory and not a file. To me it's easy to infer from there that I'm talking about a repository and not a single gem. > Another option is to use a query parameter, e.g. file:///foo?remote=true If we were to use words to say "it's a repo and not a single gem," I think it would be easier to remember the right syntax if the words took the form of another parameter to the resource type instead, like `repository => true`. ---------------------------------------- Feature #7886: support gem repository in a directory in the filesystem https://projects.puppetlabs.com/issues/7886 Author: jared jennings Status: In Topic Branch Pending Review Priority: Normal Assignee: Nigel Kersten Category: provider Target version: Affected Puppet version: 2.6.4 Keywords: Branch: https://github.com/puppetlabs/puppet/pull/155 I want to install gems from a remote repository which is a directory. Call it `/foo`. I got the gem files I want, put them in `/foo/gems`, and ran `gem generate_index -d /foo`. Now of course I want to install the gems with Puppet. The resource type reference says about the gem provider for the package type, "If a URL is passed via `source`, then that URL is used as the remote gem repository." So I write-- <pre> package { "rails": provider => gem, ensure => installed, source => "file:///foo/", } </pre> But instead of running `gem install --source /foo/ rails`, Puppet tries to `gem install /foo/`. A look at the source reveals that URLs with the scheme `file` are always treated as individual gem files, never gem repositories (source:/lib/puppet/provider/package/gem.rb@9bb30181#L83). I don't think it ever makes sense to `gem install` a directory. So I'd like to propose that if I give a `file:` url ending with a slash, it should be treated as a gem repository, not a gem file. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
