From e37054fdebdf3700199d62f1037ee4925b45fddf Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Thu, 19 May 2011 14:57:45 -0400 Subject: [PATCH] More fun - Support running on short then long AKA, rel_2_2 then later rel_2_2_1 Signed-off-by: Thomas Berezansky --- build/tools/apply_version.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/build/tools/apply_version.sh b/build/tools/apply_version.sh index 91731a9fd9..74dd075498 100755 --- a/build/tools/apply_version.sh +++ b/build/tools/apply_version.sh @@ -2,7 +2,8 @@ GIT_ABS=`git rev-parse --show-toplevel` GIT_BRANCH=`git rev-parse --abbrev-ref HEAD` -HEADURL="http://git.evergreen-ils.org/Evergreen.git?h=refs/heads/$GIT_BRANCH" +HEADURLBASE="http://git.evergreen-ils.org/Evergreen.git?h=refs/heads/" +HEADURL="$HEADURLBASE$GIT_BRANCH" VERSION=${1:-AUTO} @@ -21,10 +22,12 @@ echo "Version: $VERSION Short: $SHORT_VERSION" # prep a couple alternate represenations DASH_VERSION=`echo $VERSION | sed 's/\./-/g'` +SHORT_DASH_VERSION=`echo $SHORT_VERSION | sed 's/\./-/g'` UNDER_VERSION=`echo $VERSION | sed -e 's/\./_/g' -e 's/-/_/g'` echo "Applying to Application.pm - HEAD -> $DASH_VERSION" -sed -i "s/HEAD/$DASH_VERSION/" $GIT_ABS/Open-ILS/src/perlmods/lib/OpenILS/Application.pm +echo "Alt: $SHORT_DASH_VERSION -> $DASH_VERSION" +sed -i -e "s/HEAD/$DASH_VERSION/" -e "s/$SHORT_DASH_VERSION/$DASH_VERSION/" $GIT_ABS/Open-ILS/src/perlmods/lib/OpenILS/Application.pm echo "Applying to windowssetup.nsi - Master -> $SHORT_VERSION" sed -i "s/Master/$SHORT_VERSION/" $GIT_ABS/Open-ILS/xul/staff_client/windowssetup.nsi @@ -34,8 +37,16 @@ echo "Header with $VERSION" echo "STAMP_ID with $UNDER_VERSION" sed -i -e "1 s/Evergreen.*/Evergreen $VERSION/" -e "s/STAMP_ID=rel_[^ ]*/STAMP_ID=rel_$UNDER_VERSION/" $GIT_ABS/README +echo "Finding/updating old \$HeadURL\$ entries" +HEADURLBASE=`echo ${HEADURLBASE} | sed 's/\?/\\?/'` +for file in `grep -Rl --exclude=apply_version.sh "$HEADURLBASE" $GIT_ABS` +do + echo $file + sed -i "s|${HEADURLBASE}[A-Za-z0-9_]*|$HEADURL|" $file +done + echo "Applying \$HeadURL\$ - $HEADURL" -for file in `grep -Rl '\\$HeadURL\\$' $GIT_ABS`; +for file in `grep -Rl --exclude=apply_version.sh '\\$HeadURL\\$' $GIT_ABS` do echo $file sed -i "s|\\\$HeadURL\\\$|$HEADURL|" $file -- 2.11.0