else:
logger.info('git clone was not successfull')
exit_error()
+
atexit.register(remove_git_target_workspace)
os.chdir(GIT_TARGET_DIR)
- #git_helper.git_checkout_branch(GIT_DEBIAN_BRANCH)
- git_helper.git_new_branch_from(
- GIT_DEBIAN_BRANCH,
- os.path.join('origin', GIT_DEBIAN_BRANCH)
- )
+
+ if GIT_UPSTREAM_BRANCH != GIT_DEBIAN_BRANCH:
+ git_helper.git_new_branch_from(
+ GIT_DEBIAN_BRANCH,
+ os.path.join('origin', GIT_DEBIAN_BRANCH)
+ )
+
repo = git.repo.Repo()
+
+ if repo.active_branch != 'master' and GIT_DEBIAN_BRANCH != 'master':
+ git_helper.git_checkout_branch(GIT_DEBIAN_BRANCH)
+
if not GIT_COMMITTER_EMAIL:
- # if the GIT_COMMIT_EMAIL is not set,
- # get the email addi from the commit
for commit in repo.commits():
if commit.id == GIT_NEW_ID:
GIT_COMMITTER_EMAIL = commit.committer.email
)
else:
raise Exception('No git_committer_email found')
- logger.info('Directory Listing: %s' %(os.listdir(GIT_TARGET_DIR)))
+
+ gbp = git_buildpackage.GitBuildPackage(
+ upstream_branch=GIT_UPSTREAM_BRANCH,
+ debian_branch=GIT_DEBIAN_BRANCH,
+ dist='squeeze',
+ arch='amd64'
+ )
+
+ ret = gbp.build()
+ logger.debug(
+ 'This is the return value of git-buildpackage: %s'
+ %(ret)
+ )
+
+#class GitBuildPackage(object):
+# def __init__(self, upstream_branch=None,
+# debian_branch=None, dist=None, arch=None)
#ftp = FTP(
# 'alexandria.profitbricks.localdomain',