diff --git a/increase_frameworks_version.sh b/increase_frameworks_version.sh index 4f1e7ec..bf9ce1e 100755 --- a/increase_frameworks_version.sh +++ b/increase_frameworks_version.sh @@ -1,71 +1,69 @@ #!/bin/bash . utils.sh # Read ECM version repo=extra-cmake-modules . $releasetools/version ecm_version=$version if [ ! -d $srcdir ]; then echo "$srcdir does not exist, please fix srcdir variable" exit 1 fi step=$1 if [ "$step" != step1 -a "$step" != step2 ]; then echo "Argument missing: step1 (update sources and update version number) or step2 (update version requirements)" exit 2 fi cat $releasetools/modules.git | while read repo branch; do echo $repo . $releasetools/version checkout=$(findCheckout $repo) cd $checkout || exit 2 echo $PWD $cmd git checkout master || exit 3 $cmd git reset --hard origin/master || exit 3 $cmd git pull --rebase || exit 3 if [ "$step" = step1 ]; then if [ "$repo" = extra-cmake-modules ]; then #ecm_major=`echo $ecm_version | cut -d. -f1` #ecm_minor=`echo $ecm_version | cut -d. -f2` #ecm_patch=`echo $ecm_version | cut -d. -f3` #$cmd perl -pi -e '$_ =~ s/\Q$1/'$ecm_major'/ if (/^set.ECM_MAJOR_VERSION ([0-9]*)/);' CMakeLists.txt #$cmd perl -pi -e '$_ =~ s/\Q$1/'$ecm_minor'/ if (/^set.ECM_MINOR_VERSION ([0-9]*)/);' CMakeLists.txt #$cmd perl -pi -e '$_ =~ s/\Q$1/'$ecm_patch'/ if (/^set.ECM_PATCH_VERSION ([0-9]*)/);' CMakeLists.txt $cmd perl -pi -e 's/\Q$1/'$version'/ if (/^set.VERSION \"([^\"]*)\"/);' CMakeLists.txt $cmd git commit -a -m "GIT_SILENT Upgrade ECM version to $ecm_version." else if test -f setup.py; then # kapidox special case $cmd perl -pi.bak -e '$_ =~ s/\Q$1/'$version'/ if (/^ +version=.(.*).,/);' setup.py if cmp setup.py setup.py.bak; then rm -f setup.py.bak continue fi rm -f setup.py.bak else $cmd perl -pi.bak -e '$_ =~ s/\Q$1/'$version'/ if (/^set.KF5_VERSION \"([^\"]*)\"/);' CMakeLists.txt if cmp CMakeLists.txt CMakeLists.txt.bak; then rm -f CMakeLists.txt.bak continue fi rm -f CMakeLists.txt.bak fi $cmd git commit -a -m "GIT_SILENT Upgrade KF5 version to $version." fi else $cmd perl -pi.bak -e 's/ECM [0-9]+\.[0-9]+\.[0-9]+/ECM '$ecm_version'/g; $_ =~ s/\Q$1/'$version'/ if (/^set.KF5_DEP_VERSION \"([^\"]*)\"/);' CMakeLists.txt if cmp CMakeLists.txt CMakeLists.txt.bak; then rm -f CMakeLists.txt.bak continue fi rm -f CMakeLists.txt.bak $cmd git commit -a -m "GIT_SILENT Upgrade ECM and KF5 version requirements for $version release." fi $cmd git pull --rebase $cmd git push - # Give some time for CI to catch up (less races) - sleep 20s done