ghc-rpm-macros/cabal-tweak-dep-ver

23 lines
381 B
Plaintext
Raw Normal View History

#!/bin/sh
USAGE="Usage: $0 dep old new"
if [ $# -ne 3 ]; then
echo "$USAGE"
exit 1
fi
CABALFILE=*.cabal
if [ $(ls $CABALFILE | wc -l) -ne 1 ]; then
echo "There needs to be one .cabal file in the current dir!"
exit 1
fi
if ! grep -q "$1.*$2" $CABALFILE; then
echo "$CABALFILE does not match: $1 $2"
exit 1
fi
sed -i.$1 -e "s/\($1.*\)$2/\1$3/g" $CABALFILE