[packages/rpm-build-tools/tag_checking: 2/2] Check for existence of tag during tagging

draenog draenog at pld-linux.org
Wed Jul 11 02:40:22 CEST 2012


commit 5ba2abb8f17b663313c5f87df3b0fde3784c9bb3
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Wed Jul 11 01:19:43 2012 +0100

    Check for existence of tag during tagging
    
    Fails only when requested tag already exists and points to a different
    commit. It is to allow rebuilding of auto tags.

 builder.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/builder.sh b/builder.sh
index 44aaac8..398674c 100755
--- a/builder.sh
+++ b/builder.sh
@@ -1385,9 +1385,13 @@ tag_files() {
 
 	cd "$PACKAGE_DIR"
 
-	update_shell_title "tag sources: $_tag"
-	git $OPTIONS $_tag || exit
-	git push $CVS_FORCE $REMOTE_PLD tag $_tag || Exit_error err_remote_problem $REMOTE_PLD
+	if tag_exist $_tag || [ -n "$CVS_FORCE" ]; then
+		update_shell_title "tag sources: $_tag"
+		git $OPTIONS $_tag || exit
+		git push $CVS_FORCE $REMOTE_PLD tag $_tag || Exit_error err_remote_problem $REMOTE_PLD
+	else
+		echo "Tag $_tag already exists and points to the same commit"
+	fi
 }
 
 branch_files() {


More information about the pld-cvs-commit mailing list