From 20cbe43332e31228ebfecdbe59a53d809141c752 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Fri, 22 Jun 2012 17:03:46 +0900 Subject: [PATCH] cabal-tweak-dep-ver: match complete dep name and not beyond "," --- cabal-tweak-dep-ver | 6 ++++-- ghc-rpm-macros.spec | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cabal-tweak-dep-ver b/cabal-tweak-dep-ver index 137c944..525b786 100755 --- a/cabal-tweak-dep-ver +++ b/cabal-tweak-dep-ver @@ -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 diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 6d55450..2d215f7 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -3,7 +3,7 @@ %global macros_file %{_sysconfdir}/rpm/macros.ghc Name: ghc-rpm-macros -Version: 0.95.5 +Version: 0.95.5.1 Release: 1%{?dist} Summary: Macros for building packages for GHC @@ -64,6 +64,10 @@ EOF %changelog +* Fri Jun 22 2012 Jens Petersen - 0.95.5.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 - 0.95.5-1 - some cabal-tweak-dep-ver improvements: - show file name when no match