import errno
import atexit
import shutil
+import fnmatch
import logging
import optparse
import datetime
else:
raise Exception('unhandled branch, failing.')
+ # cleanup existing *orig.tar.gz
+ cmd = [BIN_SUDO, BIN_RM, '-f', fnmatch.filter(os.listdir('../build-area/'),'*.orig.tar.gz')]
+ cmdobj = subprocess.Popen(
+ cmd,
+ shell=False,
+ cwd='/',
+ close_fds=True,
+ stdout=sys.stdout,
+ stderr=sys.stderr,
+ env={'':''}
+ )
+
+ logger.debug(
+ 'Trying to call "%s"
+ %(' '.join(cmd))
+ )
+
+ ret = cmdobj.wait()
+ 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)]
subprocess.check_call(cmd)