Am 21.12.2015 um 19:54 schröbte Geoff Leyland: >> On 22/12/2015, at 1:33 am, Philipp Janda <siffie...@gmx.net> wrote: >> >> Two other things: This would probably be a welcome addition to LuaRocks3 >> (unfortunately the change isn't backwards compatible), and you can >> implement your changes in a custom fetcher module and provide that as a >> rock as well (so you don't have to run a patched LuaRocks). Have a look >> at the files in `src/luarocks/fetch/`. > > Can you just clarify this a little? In your earlier email, you suggested > patching fetch.lua, which is in LR2 and LR3, and here you're talking about > LR3, but "breaking change", and I assume LR3 doesn't have those yet? > > So, just to make it clear: > - should do anything at all with LR2, or just migrate locally to LR3 from > git?
You can modify your LR2 code and use it. But your changes won't end up in LR2 releases, so you'd basically have to manage your own LuaRocks fork. You can implement the changes for LR3, and those changes have a good chance of being incorporated in the official code base. I haven't tried LR3 yet though, and an official release is probably some time ahead. Implementing your changes as a fetcher plugin lets you use the official LR2 releases (you'd only have to maintain your fetcher module). > - are you sure it's a breaking change for LR3? I'm not sure it makes for a > custom fetcher - source.dir seems to be orthogonal to the fetch method, and > so, as you said, the change would go in fetch.lua, and work whether you > downloaded a zip, a git repo or from hg. LR3 isn't frozen yet, so basically anything is allowed to change there. And Hisham has already said that a PR for LR3 would be welcome. Each fetcher implements its own `get_sources()` function. The default one (in `src/luarocks/fetch.lua`) unzips archives. The other fetchers do other stuff (e.g. the git fetcher clones a repository and doesn't unzip anything). You could copy/paste/modify the `get_sources()` from `src/luarocks/fetch.lua` in a plugin `luarocks.fetch.bitbucket_https`, and any rock with `source.url = "bitbucket+https://..."` would use your modified code instead of the default `get_sources()` implementation. > > If I'm going to try do this, then there's a couple of other things that come > to mind: > - even LR3 doesn't seem to have a git_ssh in fetch/, though there is an > hg_ssh. Why is that? Probably the lack of public servers with git+ssh access. If you need it, you can probably just copy `git_https.lua` to `git_ssh.lua`. Philipp ------------------------------------------------------------------------------ _______________________________________________ Luarocks-developers mailing list Luarocks-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/luarocks-developers