Skip to content

Instantly share code, notes, and snippets.

@rrnewton
Forked from Voker57/hackage-mirror.sh
Last active November 9, 2015 15:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rrnewton/a91a717848b0b8c446cb to your computer and use it in GitHub Desktop.
Save rrnewton/a91a717848b0b8c446cb to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "Cleaning up..."
rm 00-index.tar.gz
mkdir -p package
echo "Downloading index..."
if [ ! -e 00-index.tar.gz ] ; then
wget http://hackage.haskell.org/packages/archive/00-index.tar.gz
fi
for splitpk in `tar tf 00-index.tar.gz | grep -v preferred | cut -d/ -f 1,2`; do
pk=`echo $splitpk | sed 's|/|-|'`
echo Downloading $pk ...
name=$pk.tar.gz
if [ ! -e package/$name ]; then
wget http://hackage.haskell.org/package/$pk/$name -O package/$name
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment