cabal-tweak-dep-ver: only match complete dep name and not beyond ","

This commit is contained in:
Jens Petersen 2012-06-22 17:11:39 +09:00
parent fec42b2c88
commit 99dc3d6e4c
2 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,9 @@ if [ $(echo $CABALFILE | wc -w) -ne 1 ]; then
exit 1
fi
if ! grep -q "$DEP.*$OLD" $CABALFILE; then
BREAK=[^[:alnum:]-]
if ! grep -q "$BREAK$DEP$BREAK[^,]*$OLD" $CABALFILE; then
echo "$CABALFILE does not match: $DEP $OLD"
exit 1
fi
@ -29,4 +31,4 @@ if [ ! -f $CABALFILE.orig ]; then
BACKUP=.orig
fi
sed -i$BACKUP -e "s/\($DEP.*\)$OLD/\1$NEW/g" $CABALFILE
sed -i$BACKUP -e "s/\($BREAK$DEP$BREAK[^,]*\)$OLD/\1$NEW/g" $CABALFILE

View File

@ -3,7 +3,7 @@
%global macros_file %{_sysconfdir}/rpm/macros.ghc
Name: ghc-rpm-macros
Version: 0.15.6
Version: 0.15.6.1
Release: 1%{?dist}
Summary: Macros for building packages for GHC
@ -64,7 +64,11 @@ EOF
%changelog
* Fri Jun 8 2012 Jens Petersen <petersen@redhat.com> - 0.15.6-1
* Fri Jun 22 2012 Jens Petersen <petersen@redhat.com> - 0.15.6.1-1
- cabal-tweak-dep-ver: be careful only to match complete dep name and
do not match beyond ","
* Fri Jun 22 2012 Jens Petersen <petersen@redhat.com> - 0.15.6-1
- cabal-tweak-dep-ver: new script to tweak depends version bounds in .cabal
from ghc-rpm-macros-0.95.5
- ghc-dep.sh: only use buildroot package.conf.d if it exists