[packages/rpm-build-tools] Fix test if build is from correct branch

draenog draenog at pld-linux.org
Mon Jul 9 18:38:10 CEST 2012


commit 0c6ce8b52e9224fa87cd6ede1b4d3e99caa26a7f
Author: Kącper Kornet <draenog at pld-linux.org>
Date:   Mon Jul 9 17:32:00 2012 +0100

    Fix test if build is from correct branch
    
    The right way is to extract SHA1 of TAG_BRANCH and CVSTAG and compare
    them.

 builder.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/builder.sh b/builder.sh
index 594fce3..f9e8b99 100755
--- a/builder.sh
+++ b/builder.sh
@@ -2491,8 +2491,8 @@ case "$COMMAND" in
 					cmd_branches="git show-ref"
 					ref_prefix=refs/remotes/${REMOTE_PLD}
 				fi
-				TAG_STATUS=$($cmd_branches | grep -i "${ref_prefix}/$TAG_BRANCH$")
-				if [ -n "$TAG_STATUS" -a "$TAG_STATUS" != "$CVSTAG" ]; then
+				TAG_STATUS=$($cmd_branches | grep -i "${ref_prefix}/$TAG_BRANCH$" | cut -c'-40')
+				if [ -n "$TAG_STATUS" -a "$TAG_STATUS" != $(git rev-parse "$CVSTAG") ]; then
 					Exit_error err_branch_exists "$TAG_STATUS"
 				fi
 			fi


More information about the pld-cvs-commit mailing list