]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
correctly detect colons
authorHolger Levsen <holger@layer-acht.org>
Thu, 15 Mar 2012 13:26:36 +0000 (14:26 +0100)
committerHolger Levsen <holger@layer-acht.org>
Thu, 15 Mar 2012 13:26:36 +0000 (14:26 +0100)
debian_build.py

index d2ac1105588acc77d36a24af278dfc0689d86f29..5dc53e5b70c0da330993e939e9063ab5ca5f7e53 100755 (executable)
@@ -436,22 +436,22 @@ if __name__ == '__main__':
         if GIT_BRANCH_NAME == 'master' or GIT_BRANCH_NAME.startswith('hotfix/'):
             # replace ~ with _ for tags
             version_tag = version.replace('~','_')
-            if version_tag.find(":"):
-                logger_error('Illegal character ":" in version %s detected. Please use a different version.' % version_tag)
+            if version_tag.find(":") != -1 :
+                logger_error('Illegal character ":" in version "%s" detected. Please use a different version.' % version_tag)
                 exit_error()
             cmd = ['/usr/bin/git', 'tag', version_tag]
             try:
                 subprocess.check_call(cmd)
             except:
-                logger_error('Could not tag repository with %s.' % version_tag)
+                logger_error('Could not tag repository with "%s".' % version_tag)
                 exit_error()
             cmd = ['/usr/bin/git', 'push', 'origin', version_tag]
             try:
                 subprocess.check_call(cmd)
             except:
-                logger_error('Could not push tag %s to repository.' % version_tag)
+                logger_error('Could not push tag "%s" to repository.' % version_tag)
                 exit_error()
-            logger.info('Tagged as %s' % version_tag)
+            logger.info('Tagged as "%s".' % version_tag)
         try:
             # now upload
             create_dput_cfg()