def __init__(self, config, builddir, logtofile):
self.config = '\n'.join([line.lstrip() for line in
config.splitlines()]) + '\n'
self.logfile = infra.open_log_file(builddir, "build", logtofile)
if not os.path.isdir(self.builddir):
os.makedirs(self.builddir)
config_file = os.path.join(self.builddir, ".config")
with open(config_file, "w+") as cf:
self.logfile.write("> start defconfig\n" + self.config +
"O={}".format(self.builddir),
ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile)
raise SystemError("Cannot olddefconfig")
cmd = ["make", "-C", self.builddir]
ret = subprocess.call(cmd, stdout=self.logfile, stderr=self.logfile)
raise SystemError("Build failed")
open(self.stamp_path(), 'a').close()
return os.path.join(self.builddir, "build-done")
return os.path.exists(self.stamp_path())
if os.path.exists(self.builddir):
shutil.rmtree(self.builddir)