Commit 75867d1c authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add scripts for testing compatability with hackage packages

So far just a test that all the non-trivial Setup.(l)hs scripts
compile. This only tests the latest versions, though if one were
to download a complete archive then one could test them all.
To speed up the check we skip Setup.hs scripts that have fewer
than 22 words. Below this cutoff there are no custom hooks and
it catches the great majority of scripts which greatly speeds up
the check.
parent 556b9877
#!/bin/sh
base_version=1.2.3.0
test_version=1.3.9
for setup in archive/*/*/Setup.hs archive/*/*/Setup.lhs; do
pkgname=$(basename ${setup})
if test $(wc -w < ${setup}) -gt 21; then
if ghc -package Cabal-${base_version} -S ${setup} -o /dev/null 2> /dev/null; then
if ghc -package Cabal-${test_version} -S ${setup} -o /dev/null 2> /dev/null; then
echo "OK ${setup}"
else
echo "FAIL ${setup} does not compile with Cabal-${test_version}"
fi
else
echo "OK ${setup} (does not compile with Cabal-${base_version})"
fi
else
echo "trivial ${setup}"
fi
done
#!/bin/sh
if test ! -f archive/archive.tar; then
wget http://hackage.haskell.org/cgi-bin/hackage-scripts/archive.tar
mkdir -p archive
mv archive.tar archive/
tar -C archive -xf archive/archive.tar
fi
if test ! -f archive/00-index.tar.gz; then
wget http://hackage.haskell.org/packages/archive/00-index.tar.gz
mkdir -p archive
mv 00-index.tar.gz archive/
tar -C archive -xzf archive/00-index.tar.gz
fi
#!/bin/sh
for tarball in archive/*/*/*.tar.gz; do
pkgdir=$(dirname ${tarball})
pkgname=$(basename ${tarball} .tar.gz)
if tar -tzf ${tarball} ${pkgname}/Setup.hs 2> /dev/null; then
tar -xzf ${tarball} ${pkgname}/Setup.hs -O > ${pkgdir}/Setup.hs
elif tar -tzf ${tarball} ${pkgname}/Setup.lhs 2> /dev/null; then
tar -xzf ${tarball} ${pkgname}/Setup.lhs -O > ${pkgdir}/Setup.lhs
else
echo "${pkgname} has no Setup.hs or .lhs at all!!?!"
fi
done
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment