Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# First get a list of all packages
cabal list --simple | tee packages.list
# Then compute the locations of their tar files
python3 -c "from fileinput import *; [print(\"https://hackage.haskell.org/package/\"+p+\"/\"+p+\"-\"+ver+\".tar.gz\") for (p,ver) in sorted(dict(map(str.split, input())).items())]" < packages.list | tee files.list
# If you are on windows make sure python didn't use CRLF:
# dos2unix files.list
# Download all the archives - 4 at a time. Some might fail, that is expected.
xargs -P4 wget -nv < files.list
# Do whatever you want afterwards. This was based on https://github.com/nh2/hackage-download, which sadly did not work for me.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.