
https://github.com/nh2/custom-hackage An (almost trivial) script to generate 00-index.tar.gz which is necessary to run your own `remote-repo`. If you are a company that has to rely on that not everybody with a Hackage account can run arbitrary code on your computer at your next cabal install, and you want to make available only select versions of packages (as opposed to a full hackage mirror), this is for you. Just drop your tars into the directory structure, run the script and serve it over HTTP.

On 13-06-13 11:09 AM, Niklas Hambüchen wrote:
https://github.com/nh2/custom-hackage
An (almost trivial) script to generate 00-index.tar.gz which is necessary to run your own `remote-repo`.
I write the following critique with much reluctance, since I will be saying a lot of "this cannot possibly work, here is why", but I would also like to think that it had worked for you before you published it. Assume the remote-repo line goes like remote-repo: custom:http://127.0.0.1:8080/packages/archive And assume it has just one package, formula-1.1 Then your scheme uses this layout: http://127.0.0.1:8080/00-index.tar.gz http://127.0.0.1:8080/packages/archive/formula/1.1/formula-1.1.tar.gz However, cabal-install expects this layout: http://127.0.0.1:8080/packages/archive/00-index.tar.gz http://127.0.0.1:8080/packages/archive/package/formula-1.1.tar.gz I know this by both reading cabal-install source code and empirical tests, both 0.14 and 1.16. I have a working example at http://www.vex.net/~trebla/haskell/conrepo Lastly, I want to emphasize these points: The layout is different from Hackage's; cabal-install source code hardcodes treating Hackage differently. Yes, it goes out of its way to detect "http://hackage.haskell.org/packages/archive" and do a different thing. Mimicking Hackage is futile, unless you go out of your way to also mimic the host name "hackage.haskell.org". And the layout is different from local-repo's; local-repo's is in fact close to Hackage's. See my http://www.vex.net/~trebla/haskell/cabal-cabal.xhtml#remote-repo

Hello Albert, thanks for this! Please don't be reluctant with this, it is very appreciated. I have updated the script to use the paths as you described, and it seems to work quite well. The fact that all tars land under package/ even makes is easier to use. It would be great if you could give it another try. Niklas On 17/06/13 02:42, Albert Y. C. Lai wrote:
On 13-06-13 11:09 AM, Niklas Hambüchen wrote:
https://github.com/nh2/custom-hackage
An (almost trivial) script to generate 00-index.tar.gz which is necessary to run your own `remote-repo`.
I write the following critique with much reluctance, since I will be saying a lot of "this cannot possibly work, here is why", but I would also like to think that it had worked for you before you published it.
Assume the remote-repo line goes like
remote-repo: custom:http://127.0.0.1:8080/packages/archive
And assume it has just one package, formula-1.1
Then your scheme uses this layout:
http://127.0.0.1:8080/00-index.tar.gz http://127.0.0.1:8080/packages/archive/formula/1.1/formula-1.1.tar.gz
However, cabal-install expects this layout:
http://127.0.0.1:8080/packages/archive/00-index.tar.gz http://127.0.0.1:8080/packages/archive/package/formula-1.1.tar.gz
I know this by both reading cabal-install source code and empirical tests, both 0.14 and 1.16.
I have a working example at http://www.vex.net/~trebla/haskell/conrepo
Lastly, I want to emphasize these points:
The layout is different from Hackage's; cabal-install source code hardcodes treating Hackage differently. Yes, it goes out of its way to detect "http://hackage.haskell.org/packages/archive" and do a different thing. Mimicking Hackage is futile, unless you go out of your way to also mimic the host name "hackage.haskell.org".
And the layout is different from local-repo's; local-repo's is in fact close to Hackage's.
See my http://www.vex.net/~trebla/haskell/cabal-cabal.xhtml#remote-repo
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Albert Y. C. Lai
-
Niklas Hambüchen