From ea0d63cbe0aa09740964dce0533dba8e06937692 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Wed, 5 Mar 2014 13:29:52 +0100 Subject: [PATCH] Rename curr_commit_id to curr_commit_hexsha. --- debian_build.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/debian_build.py b/debian_build.py index 53d1832..7dbe9ba 100755 --- a/debian_build.py +++ b/debian_build.py @@ -155,10 +155,10 @@ if __name__ == '__main__': curr_commit = gitrepo.commit(remote_branch) # id attribute used in python-git 0.3.2~RC1-1 found in wheezy if hasattr(curr_commit, 'hexsha'): - curr_commit_id = curr_commit.hexsha + curr_commit_hexsha = curr_commit.hexsha # id attribute used in python-git 0.1.6-1 found in squeeze elif hasattr(curr_commit, 'id'): - curr_commit_id = curr_commit.id + curr_commit_hexsha = curr_commit.id except Exception as error: logger.error('Failed to find commit for {input}'.format(input=remote_branch)) exit_error() @@ -211,7 +211,7 @@ if __name__ == '__main__': tagged_commit_hexsha = tagged_commit.hexsha else: tagged_commit_hexsha = tagged_commit.id - if tagged_commit_hexsha == curr_commit_id: + if tagged_commit_hexsha == curr_commit_hexsha: message = 'Tag {name} was already created for commit {sha}.'.format( name=remote_tag[0].name, sha=tagged_commit[0:7], @@ -239,7 +239,7 @@ if __name__ == '__main__': version=curr_version, date=daily_date, build=ENV['BUILD_NUMBER'], - commit=curr_commit_id[0:7], + commit=curr_commit_hexsha[0:7], suffix=options.version_suffix, ) pb_suite = 'develop-{dist}'.format(dist=curr_dist) @@ -266,7 +266,7 @@ if __name__ == '__main__': version=curr_version, date=daily_date, build=ENV['BUILD_NUMBER'], - commit=curr_commit_id[0:7], + commit=curr_commit_hexsha[0:7], suffix=options.version_suffix, ) reprepro_base = '/srv/dev-{dist}'.format(dist=curr_dist) @@ -282,12 +282,13 @@ if __name__ == '__main__': #if GIT_REPO_PATH.startswith('/srv/git/dev/'): # if ENV['GIT_BRANCH_NAME'] == 'pre-staging': # version = '%s~develop%s+%s+%s' %(version, daily_date, BUILD_NUMBER, - # curr_commit_id[0:7]) + # curr_commit_hexsha[0:7]) # changelog_distro = 'pre-staging' # else: # # use shorter date because we can # daily_date = datetime.datetime.now().strftime('%Y%m%d') - # version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER, curr_commit_id[0:7]) + # version = '%s~alpha%s+%s+%s' %(version, daily_date, BUILD_NUMBER, + # curr_commit_hexsha[0:7]) # changelog_distro = 'unstable' # create dput object with data gathered from reprepro_base defined above @@ -453,7 +454,7 @@ if __name__ == '__main__': '--no-auto-nmu', '--', 'Generated by Jenkins build of commit {commit}'.format( - commit=curr_commit_id[0:7], + commit=curr_commit_hexsha[0:7], ), ] @@ -509,7 +510,7 @@ if __name__ == '__main__': dist=curr_dist, arch='amd64', pb_suite=pb_suite, - git_commit_id=curr_commit_id[0:7], + git_commit_id=curr_commit_hexsha[0:7], ) if ret == 0: logger.info('Current environment:\n\n{env}\n'.format(env=builder.env)) -- 2.39.5