Add package metadata from hackage
This commit is contained in:
28
scripts/download-metadata.sh
Executable file
28
scripts/download-metadata.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/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
|
||||
|
||||
versions="$(wget -O - http://hackage.haskell.org/package/"$PACKAGE"/preferred.json | jq '."normal-version"[]' -r)"
|
||||
|
||||
mkdir -p "$OUTDIR"
|
||||
|
||||
for v in $versions; do
|
||||
|
||||
wget https://hackage.haskell.org/package/"$PACKAGE-$v"/"$PACKAGE".cabal -O "$OUTDIR/${PACKAGE}-${v}.cabal"
|
||||
|
||||
done
|
||||
Reference in New Issue
Block a user