Skip to content

Instantly share code, notes, and snippets.

@eccstartup
Forked from Voker57/hackage-mirror.sh
Last active August 19, 2016 08:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eccstartup/7889417 to your computer and use it in GitHub Desktop.
Save eccstartup/7889417 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Cleaning up..."
#rm 00-index.tar.gz
mkdir -p package
echo "Downloading index..."
wget -c http://hackage.haskell.org/packages/archive/00-index.tar.gz
for splitpk in `tar tf 00-index.tar.gz | cut -d/ -f 1,2`; do
pk=`echo $splitpk | sed 's|/|-|'`
name=$pk.tar.gz
if [[ ! -a 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