From 31e7e387e06e9ced062573d393933dfc9dd820b2 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Mon, 23 Dec 2013 15:42:50 +0100 Subject: [PATCH] Cleanup the previous source packages. --- debian_build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 = [ -- 2.39.5