try:
logger.debug('Reset and clean repository first:')
gitcmd = git.Git('.')
- logger.debug('%s' %(gitcmd.reset('--hard','HEAD')))
- logger.debug('%s' %(gitcmd.clean('-fdx')))
- logger.debug('%s' %(gitcmd.branch('-D','%s' %(localname))))
- logger.debug('%s' %(gitcmd.checkout('-b','%s' %(localname),'%s' %(remotename))))
+ logger.debug(
+ 'git reset --hard HEAD:\n%s'
+ %(gitcmd.reset('--hard','HEAD'))
+ )
+ logger.debug(
+ 'git clean -fdx:\n%s'
+ %(gitcmd.clean('-fdx'))
+ )
+ logger.debug(
+ 'git branch -D %s\n%s'
+ %(localname,gitcmd.branch('-D','%s' %(localname)))
+ )
+ logger.debug(
+ 'git checkout -b %s %s %s'
+ %(
+ localname,
+ remotename,
+ gitcmd.checkout('-b','%s' %(localname),'%s' %(remotename))
+ )
+ )
except Exception, exception:
raise Exception('Failure while managing Git clone:\n%s' %(exception))
else:
logger.debug('Status is now:\n%s' %( gitcmd.status() ))
+ # cleanup existing *orig.tar.gz
+ if os.path.isdir(BUILD_AREA):
+ files = [os.path.join(BUILD_AREA,file) for file in fnmatch.filter(os.listdir(BUILD_AREA),'*.orig.tar.gz')]
+ if len(files) > 0:
+ logger.debug('Previous upstream tarball(s) found: %s' %( files ))
+ cmd = [BIN_SUDO, BIN_RM, '-v', " ".join(files)]
+ cmdobj = subprocess.Popen(
+ cmd,
+ shell=False,
+ cwd='/',
+ close_fds=True,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ env={'':''}
+ )
+
+ logger.debug('Calling "%s":' %(' '.join(cmd)))
+ ret = cmdobj.wait()
+ for line in cmdobj.stdout.readlines():
+ logger.debug('%s' %(line))
+
+ if ret:
+ _str = (
+ 'Cmd "%s" returned non-zero (exitcode: %s).'
+ %(' '.join(cmd), ret)
+ )
+ logger.debug(_str)
+ raise Exception(_str)
+
## #if GIT_BRANCH_NAME != 'master':
## if not git_helper.git_new_branch_from(localname,remotename):
## raise Exception('Checkout of %s was not successfull.' %( remotename ))
else:
raise Exception('unhandled branch, failing.')
- # cleanup existing *orig.tar.gz
- if os.path.isdir(BUILD_AREA):
- files = [os.path.join(BUILD_AREA,file) for file in fnmatch.filter(os.listdir(BUILD_AREA),'*.orig.tar.gz')]
- if len(files) > 0:
- logger.debug('Previous upstream tarball(s) found: %s' %( files ))
- cmd = [BIN_SUDO, BIN_RM, '-v', " ".join(files)]
- cmdobj = subprocess.Popen(
- cmd,
- shell=False,
- cwd='/',
- close_fds=True,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT,
- env={'':''}
- )
-
- logger.debug('Calling "%s" ..' %(' '.join(cmd)))
- ret = cmdobj.wait()
- for line in cmdobj.stdout.readlines():
- logger.debug('%s' %(line))
-
- if ret:
- _str = (
- 'Cmd "%s" returned non-zero (exitcode: %s).'
- %(' '.join(cmd), ret)
- )
- logger.debug(_str)
- raise Exception(_str)
-
logger.info('dist: %s' %(pb_suite))
cmd = ['figlet-figlet', '-t', 'dist: %s' %(pb_suite)]