Skip to content

Instantly share code, notes, and snippets.

@eccstartup
Forked from Voker57/hackage-mirror.sh
Created April 20, 2013 08:42
Show Gist options
  • Save eccstartup/5425281 to your computer and use it in GitHub Desktop.
Save eccstartup/5425281 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..."
wget http://hackage.haskell.org/packages/archive/00-index.tar.gz
for splitpk in `tar tf 00-index.tar.gz | cut -d/ -f 2,3`; do
pk=`echo $splitpk | sed 's|/|-|'`
name=$pk.tar.gz
if [ ! -a package/$name ]; then
wget http://hackage.haskell.org/packages/archive/$splitpk/$name -O package/$name
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment