]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
Cleanup the previous source packages.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Mon, 23 Dec 2013 14:42:50 +0000 (15:42 +0100)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Mon, 23 Dec 2013 14:42:50 +0000 (15:42 +0100)
debian_build.py

index 772f0d9e7913aeeb974fb956c8dbfbef0a66a97d..916f95798dc05a524f0bf32234d88f06b6ac3263 100755 (executable)
@@ -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 = [