From: Benjamin Drung Date: Mon, 23 Dec 2013 14:42:50 +0000 (+0100) Subject: Cleanup the previous source packages. X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=31e7e387e06e9ced062573d393933dfc9dd820b2;p=profitbricks%2Fjenkins-build-scripts.git Cleanup the previous source packages. --- diff --git a/debian_build.py b/debian_build.py index 772f0d9..916f957 100755 --- a/debian_build.py +++ b/debian_build.py @@ -333,6 +333,16 @@ if __name__ == '__main__': status=gitrepo.git.status().strip(), )) + # .. and also cleanup the previous source packages + source_package_dir = os.path.join(os.curdir, "../deb-packages") + if os.path.isdir(source_package_dir): + cmd = [BIN_SUDO, BIN_RM, "-r", source_package_dir] + command = ' '.join(cmd) + if subprocess.call(cmd) == 0: + logger.debug('%s succeeded.' % command) + else: + logger.warn('%s failed.' % command) + # .. and also cleanup existing *orig.tar.gz if os.path.isdir(BUILD_AREA): files = [