Diff: [root] @ 9d5700e21da | faq | css

hackage mirror fix

File: howto/setup-hackage-mirror [Diff]

diff --git a/howto/setup-hackage-mirror b/howto/setup-hackage-mirror
index 220489b..0cf3057 100644
-- a/howto/setup-hackage-mirror
++ b/howto/setup-hackage-mirror
@@ -2,18 +2,20 @@ h1. How to set up a "hackage":http://hackage.haskell.org/packages/hackage.html m

1. @cd@ to a clean directory where you want your hackage mirror to be

2. Download a tarball with latest hackage contents from [http://hackage.haskell.org/cgi-bin/hackage-scripts/archive.tar] package index:

bc. wget http://hackage.haskell.org/cgi-bin/hackage-scripts/archive.tar -O /tmp http://hackage.haskell.org/packages/archive/00-index.tar.gz

3. This archive package index contains .cabal files of all packages in tar.gz's placed in folders (@HAppS-Server/, which should be placed in @package@ subdirectory that are available on server. hackage in /packages/archive/$package/$version/$package-$version.tar.gz. However, if this is an exception for hackage.haskell.org, added and maintained by some moron. If your mirror hostname host is not @hackage.haskell.org@ (*UGLY UGLY HACK GODDAMN WHOEVER DONE IT*), cabal will request not @package/HAppS-Server/, but just @package/HAppS-Server- So, we need different, you have to transform file paths:

bc. tar xf /tmp/archive.tar --transform 's|^.*/|package/|'

4. Download package index: serve them as /package/$package-$version.tar.gz. So, here's a shell script that downloads and places them for you:

bc. for splitpk in `tar tf 00-index.tar.gz | cut -d/ -f 2,3`; do
pk=`echo $splitpk | sed 's|/|-|'`
if [ ! -a package/$name ]; then
wget http://hackage.haskell.org/packages/archive/00-index.tar.gz http://hackage.haskell.org/packages/archive/$splitpk/$name -O package/$name

That is all! You can serve this directory as hackage mirror mirror.

\ No newline at end of file
Here's a shell script that does it all for you: [http://gist.github.com/562813]
\ No newline at end of file
\ No newline at end of file

By Voker57 on 2011-01-01 20:22:32 +0300 Powered by bitcheese wiki engine