Compare commits

...

3 Commits

Author SHA1 Message Date
Michele Calgaro fe2f909e5a
Remove astyle files since formatting will be done using uncrustify-trinity
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
(cherry picked from commit 0e60f5c683)
2 years ago
Slávek Banko 2c8776b5d9
create_tarball: Add support for creating tarballs from head on a git tag.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit 1ccd5c4fa1)
2 years ago
Slávek Banko ec0ec3b8bc
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 4eebab4010)
2 years ago

@ -1,29 +0,0 @@
#!/bin/bash
if [[ $1 == "" ]]; then
echo "Please specify the source directory to beautify"
exit 1
fi
ASTYLEARGS=$( cat <<EOF
--indent=tab \
--indent-classes \
--indent-switches \
--indent-cases \
--indent-namespaces \
--indent-labels \
--indent-col1-comments \
\
--unpad-paren \
\
--style=java \
--add-brackets \
--break-closing-brackets \
--keep-one-line-statements
EOF
)
astyle $ASTYLEARGS --recursive $1/*.c || true
astyle $ASTYLEARGS --recursive $1/*.cc || true
astyle $ASTYLEARGS --recursive $1/*.cpp || true
astyle $ASTYLEARGS --recursive $1/*.h || true

@ -1,14 +0,0 @@
--indent=tab
--indent-classes
--indent-switches
--indent-cases
--indent-namespaces
--indent-labels
--indent-col1-comments
--unpad-paren
--style=java
--add-brackets
--break-closing-brackets
--keep-one-line-statements

@ -70,17 +70,25 @@ cd `git rev-parse --show-toplevel`
# Check remote branch
branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"`
if [[ -z "$branch" ]]; then
branch=`git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
branch_detached=`git branch --contains HEAD | egrep "^\* \(HEAD detached at" | head -n1 | sed "s|^\* (HEAD detached at \([^)]*\)).*$|\1|"`
branch=`git tag | grep -Fx "${branch_detached}"`
fi
if [[ -z "$branch" ]]; then
branch=`git branch -r --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
branch=${branch#origin/}
fi
if [[ -z "$branch" ]] ||
[[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
echo "There is not active upstream branch. Exiting..."
exit 1
( [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]] &&
[[ -z "`git tag | grep -Fx \"${branch}\"`" ]] ); then
echo "There is not active upstream branch. Exiting."
exit 1
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 +101,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
@ -104,12 +112,18 @@ if [ "$TARGET" != "${TARGET#3.5.}" ]; then
else
targetBranch=master
fi
if [ "$branch" = "v${TARGET}" ]; then
targetBranch=v${TARGET}
fi
else
if [ "$TARGET" != "${TARGET%.0}" ]; then
targetBranch=master
else
targetBranch=r${TARGET%.*}.x
fi
if [ "$branch" = "r${TARGET}" ]; then
targetBranch=r${TARGET}
fi
fi
if [ "$branch" != "$targetBranch" ]; then
echo "Target $TARGET is not valid on $branch branch. Exiting."

@ -30,12 +30,18 @@ fi
# Check remote branch
branch=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"`
if [[ -z "$branch" ]]; then
branch=`git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
branch_detached=`git branch --contains HEAD | egrep "^\* \(HEAD detached at" | head -n1 | sed "s|^\* (HEAD detached at \([^)]*\)).*$|\1|"`
branch=`git tag | grep -Fx "${branch_detached}"`
fi
if [[ -z "$branch" ]]; then
branch=`git branch -r --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
branch=${branch#origin/}
fi
if [[ -z "$branch" ]] ||
[[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]]; then
echo "There is not active upstream branch. Exiting..."
exit 1
( [[ -z "`git rev-parse --symbolic-full-name --remotes=\"*/$branch\"`" ]] &&
[[ -z "`git tag | grep -Fx \"${branch}\"`" ]] ); then
echo "There is not active upstream branch. Exiting."
exit 1
fi
# Get submodule name
@ -57,7 +63,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 +78,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
@ -80,12 +88,18 @@ if [ "$TARGET" != "${TARGET#3.5.}" ]; then
else
targetBranch=master
fi
if [ "$branch" = "v${TARGET}" ]; then
targetBranch=v${TARGET}
fi
else
if [ "$TARGET" != "${TARGET%.0}" ]; then
targetBranch=master
else
targetBranch=r${TARGET%.*}.x
fi
if [ "$branch" = "r${TARGET}" ]; then
targetBranch=r${TARGET}
fi
fi
if [ "$branch" != "$targetBranch" ]; then
echo "Target $TARGET is not valid on $branch branch. Exiting."
@ -126,11 +140,15 @@ if [[ -n "$target_tag" ]] && \
fi
# Calculate version
tag=`git tag | \
sed "s|^\([^0-9]\)|\1.|" | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr | sed "s|^\([^0-9]\)\.|\1|" | \
while read t; do \
git branch --contains $t | cut -c 3- | grep -x "$branch" >/dev/null && \
echo "$t..HEAD" && break; done`
if [[ -z "$target_tag" ]]; then
tag=`git tag | \
sed "s|^\([^0-9]\)|\1.|" | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr -k 5,5nr | sed "s|^\([^0-9]\)\.|\1|" | \
while read t; do \
git branch --contains $t | cut -c 3- | grep -x "$branch" >/dev/null && \
echo "$t..HEAD" && break; done`
else
tag="$target_tag..HEAD"
fi
count=`git log $tag --pretty=oneline | wc -l`

Loading…
Cancel
Save