aboutsummaryrefslogtreecommitdiffstats
path: root/lib/python2.7/site-packages/autobuilder/buildsteps/RemoveTmpFiles.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python2.7/site-packages/autobuilder/buildsteps/RemoveTmpFiles.py')
-rw-r--r--lib/python2.7/site-packages/autobuilder/buildsteps/RemoveTmpFiles.py65
1 files changed, 0 insertions, 65 deletions
diff --git a/lib/python2.7/site-packages/autobuilder/buildsteps/RemoveTmpFiles.py b/lib/python2.7/site-packages/autobuilder/buildsteps/RemoveTmpFiles.py
deleted file mode 100644
index 3517d22a..00000000
--- a/lib/python2.7/site-packages/autobuilder/buildsteps/RemoveTmpFiles.py
+++ /dev/null
@@ -1,65 +0,0 @@
-'''
-Created on Jun 06, 2017
-
-__author__ = "Joshua Lock"
-__copyright__ = "Copyright 2017, Intel Corp."
-__credits__ = ["Joshua Lock"]
-__license__ = "GPL"
-__version__ = "2.0"
-__maintainer__ = "Joshua Lock"
-__email__ = "joshua.g.lock@intel.com"
-'''
-
-
-from buildbot.steps.shell import ShellCommand
-from autobuilder.config import *
-import os
-
-class RemoveTmpFiles(ShellCommand):
- haltOnFailure = False
- flunkOnFailure = True
- name = "RemoveTmpFiles"
-
- def __init__(self, factory, argdict=None, **kwargs):
- self._pendingLogObservers = []
- self.files = ""
- for k, v in argdict.iteritems():
- setattr(self, k, v)
- # Timeout needs to be passed to LoggingBuildStep as a kwarg
- self.timeout = 100000
- kwargs['timeout'] = self.timeout
- ShellCommand.__init__(self, **kwargs)
-
- def start(self):
- # the "build" child of the buildbot builddir is the directory poky (or
- # openembedded-core) has been cloned to, the build subdirectory of that
- # directory (build/build) is the OE-Core BUILDDIR.
- builddir = os.path.join(self.getProperty("builddir"), "build", "build")
-
- filesOK = True
- if not self.files:
- self.files = os.path.join(builddir, 'tmp')
- else:
- files = self.files.split()
- for f in files:
- if f.startswith('/') and not f.startswith(builddir):
- filesOK = False
- break
- else:
- abs = os.path.abspath(os.path.join(builddir, f))
- if not abs.startswith(builddir):
- filesOK = False
- break
-
- # Ensure the resulting path is a sub-directory of the build directory
- if not filesOK:
- reason = "Skipping RemoveTmpFiles because one or more of '%s' "
- reason = reason + "aren't a child of the build directory "
- reason = reason + "(BUILDDIR) '%s'"
- reason = reason % (self.files, build)
- self.command = "echo '%s'" % reason
- self.description = ["%s" % reason]
- else:
- self.command = "rm -rf %s" % self.files
-
- ShellCommand.start(self)