summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2023-04-28 03:16:02 +0200
committerSlávek Banko <slavek.banko@axis.cz>2023-04-28 07:07:12 +0200
commitec0ec3b8bcb6398418dd55d3c3b0603169b6c752 (patch)
treeb11489bcf063fe05f0bd9c61a76ce3953c1adeec
parenta810c4d292629e8668538231691e4b6c4274fec8 (diff)
downloadscripts-ec0ec3b8bcb6398418dd55d3c3b0603169b6c752.tar.gz
scripts-ec0ec3b8bcb6398418dd55d3c3b0603169b6c752.zip
Allow to determine the target version from the default version in the tde-cmake module.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 4eebab4010c5d61f58dacfae7d7bed752d4424d9)
-rwxr-xr-xcreate_all_tarballs6
-rwxr-xr-xcreate_tarball6
2 files changed, 8 insertions, 4 deletions
diff --git a/create_all_tarballs b/create_all_tarballs
index 1ec8f12..1434f77 100755
--- a/create_all_tarballs
+++ b/create_all_tarballs
@@ -80,7 +80,9 @@ fi
# Set target version
if [ -z "$TARGET" ]; then
- if [ -f main/core/tdelibs/tdecore/tdeversion.h ]; then
+ if [ -f main/dependencies/tde-cmake/modules/TDEVersion.cmake ]; then
+ tdeversionHeader=main/dependencies/tde-cmake/modules/TDEVersion.cmake
+ elif [ -f main/core/tdelibs/tdecore/tdeversion.h ]; then
tdeversionHeader=main/core/tdelibs/tdecore/tdeversion.h
elif [ -f main/core/tdelibs/kdecore/kdeversion.h ]; then
tdeversionHeader=main/core/tdelibs/kdecore/kdeversion.h
@@ -93,7 +95,7 @@ if [ -z "$TARGET" ]; then
echo "Cannot find TDE core headers. Exiting."
exit 1
fi
- TARGET=`sed -n 's|#define [KT]DE_VERSION_STRING "[^0-9]\?\([^ "]*\).*|\1|p' $tdeversionHeader`
+ TARGET=`sed -n 's/^[ \t]*\(set( DEFAULT_VERSION\|#define [KT]DE_VERSION_STRING\) "[^0-9]\?\([^ ~"]*\).*/\2/p' $tdeversionHeader`
fi
export TARGET
diff --git a/create_tarball b/create_tarball
index b19dec6..6bc534e 100755
--- a/create_tarball
+++ b/create_tarball
@@ -57,7 +57,9 @@ MODULE=${SUBROOT#$TDEROOT/main/}
# Set target version
if [ -z "$TARGET" ]; then
- if [ -f $TDEROOT/main/core/tdelibs/tdecore/tdeversion.h ]; then
+ if [ -f $TDEROOT/main/dependencies/tde-cmake/modules/TDEVersion.cmake ]; then
+ tdeversionHeader=$TDEROOT/main/dependencies/tde-cmake/modules/TDEVersion.cmake
+ elif [ -f $TDEROOT/main/core/tdelibs/tdecore/tdeversion.h ]; then
tdeversionHeader=$TDEROOT/main/core/tdelibs/tdecore/tdeversion.h
elif [ -f $TDEROOT/main/core/tdelibs/kdecore/kdeversion.h ]; then
tdeversionHeader=$TDEROOT/main/core/tdelibs/kdecore/kdeversion.h
@@ -70,7 +72,7 @@ if [ -z "$TARGET" ]; then
echo "Cannot find TDE core headers. Exiting."
exit 1
fi
- TARGET=`sed -n 's|#define [KT]DE_VERSION_STRING "[^0-9]\?\([^ "]*\).*|\1|p' $tdeversionHeader`
+ TARGET=`sed -n 's/^[ \t]*\(set( DEFAULT_VERSION\|#define [KT]DE_VERSION_STRING\) "[^0-9]\?\([^ ~"]*\).*/\2/p' $tdeversionHeader`
fi
# Check branch by target