DEB build scripts: further improvement to detection of correct scm info when working on detached HEAD.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/65/head
Michele Calgaro 5 years ago
parent eb3700be2a
commit c6530389dc
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -275,7 +275,10 @@ if [ "$bool_COPY_MOD_SRC" = "y" ]; then
echo "# TDE SCM module information" > "$MOD_BUILD_PATH/.tdescminfo" echo "# TDE SCM module information" > "$MOD_BUILD_PATH/.tdescminfo"
echo "Name: $MOD_NAME" >> "$MOD_BUILD_PATH/.tdescminfo" echo "Name: $MOD_NAME" >> "$MOD_BUILD_PATH/.tdescminfo"
cd "$MOD_GIT_PATH" cd "$MOD_GIT_PATH"
MOD_BRANCH=`git rev-parse --abbrev-ref HEAD | grep -v "no branch" | head -n1` MOD_BRANCH=`git symbolic-ref -q HEAD | sed "s|^refs/heads/||"`
if [[ -z "$MOD_BRANCH" ]]; then
MOD_BRANCH=`git branch --contains HEAD | egrep -v "no branch|detached" | head -n1 | cut -c 3-`
fi
COMMIT_HASH=`git rev-parse HEAD` COMMIT_HASH=`git rev-parse HEAD`
echo "Revision: $MOD_BRANCH-$COMMIT_HASH" >> "$MOD_BUILD_PATH/.tdescminfo" echo "Revision: $MOD_BRANCH-$COMMIT_HASH" >> "$MOD_BUILD_PATH/.tdescminfo"
git log -1 --pretty=format:"DateTime: %cd%n" --date=format:"%m/%d/%Y %H:%M" >> "$MOD_BUILD_PATH/.tdescminfo" git log -1 --pretty=format:"DateTime: %cd%n" --date=format:"%m/%d/%Y %H:%M" >> "$MOD_BUILD_PATH/.tdescminfo"
@ -310,7 +313,10 @@ if [ "$bool_EXTRADEP_MOD" != "y" -a "$bool_COPY_PKGING_FILES" = "y" ]; then
# Default package name # Default package name
# Calculate package version # Calculate package version
cd $MOD_GIT_PATH cd $MOD_GIT_PATH
branch=`git rev-parse --abbrev-ref HEAD | egrep -v "no branch|detached" | head -n1` 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-`
fi
target_tag=`git tag | grep -F "$TDE_RELEASE" | head -n1` target_tag=`git tag | grep -F "$TDE_RELEASE" | head -n1`
tag=`git tag | \ 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|" | \ 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|" | \

Loading…
Cancel
Save