2015-11-05 20:23:19 +00:00
|
|
|
#!/bin/sh
|
|
|
|
################################################################################
|
|
|
|
# #
|
|
|
|
# Download package metadata for all versions on Hackage #
|
|
|
|
# #
|
|
|
|
# Copyright (C) 2015 Daniel Gröber <dxld@darkboxed.org> #
|
|
|
|
# #
|
|
|
|
# Copying and distribution of this file, with or without modification, #
|
|
|
|
# are permitted in any medium without royalty provided the copyright #
|
|
|
|
# notice and this notice are preserved. This file is offered as-is, #
|
|
|
|
# without any warranty. #
|
|
|
|
# #
|
|
|
|
# Usage: ./download-metadata.sh PACKAGE OUTPUT_DIRECTORY #
|
|
|
|
# #
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
PACKAGE=$1
|
|
|
|
OUTDIR=$2
|
|
|
|
|
2016-10-30 21:46:12 +00:00
|
|
|
versions="$(wget -O - https://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '(."normal-version" + ."deprecated-version")[]' -r)"
|
2016-06-02 18:15:59 +00:00
|
|
|
#versions="$(wget -O - https://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '."deprecated-version"[]' -r)"
|
|
|
|
|
|
|
|
|
2015-11-05 20:23:19 +00:00
|
|
|
|
|
|
|
mkdir -p "$OUTDIR"
|
|
|
|
|
|
|
|
for v in $versions; do
|
|
|
|
|
2016-06-02 18:15:59 +00:00
|
|
|
wget https://hackage.haskell.org/package/"$PACKAGE-$v"/"$PACKAGE".cabal -O "$OUTDIR/${PACKAGE}-${v}.cabal" &
|
2015-11-05 20:23:19 +00:00
|
|
|
|
|
|
|
done
|