diff options
author | Clark Williams <williams@redhat.com> | 2009-02-20 13:55:47 -0600 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2009-02-20 13:55:47 -0600 |
commit | 4842e113479be8204373da61752bb9105538bc90 (patch) | |
tree | 8968d6796f21d3426f0a4c7af2097a051775a50d /rteval/kcompile.py | |
parent | 780b8593abbd8e065ebf7dea0baedd27435ae86e (diff) | |
download | rteval-4842e113479be8204373da61752bb9105538bc90.tar.gz rteval-4842e113479be8204373da61752bb9105538bc90.tar.xz rteval-4842e113479be8204373da61752bb9105538bc90.zip |
return ready when build is done; handle keyboard interrupt better
Diffstat (limited to 'rteval/kcompile.py')
-rw-r--r-- | rteval/kcompile.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/rteval/kcompile.py b/rteval/kcompile.py index 52ffafb..780c21e 100644 --- a/rteval/kcompile.py +++ b/rteval/kcompile.py @@ -45,14 +45,22 @@ class Kcompile(load.Load): if kdir == None: raise RuntimeError, "Can't find kernel directory!" self.mydir = os.path.join(self.dir, kdir) + self.debug("kcompile: mydir = %s\n" % self.mydir) def build(self): self.debug("kcompile setting up all module config file in %s" % os.getcwd()) null = os.open("/dev/null", os.O_RDWR) # clean up from potential previous run - subprocess.call(["make", "-C", self.mydir, "distclean", "allmodconfig"], - stdin=null, stdout=null, stderr=null) + try: + ret = subprocess.call(["make", "-C", self.mydir, "distclean", "allmodconfig"], + stdin=null, stdout=null, stderr=null) + if ret: + raise RuntimeError, "kcompile setup failed: %d" % ret + except KeyboardInterrupt, m: + self.debug("keyboard interrupt, kcompile aborted") + return self.debug("kcompile ready to run") + self.ready = True def runload(self): null = os.open("/dev/null", os.O_RDWR) @@ -66,6 +74,7 @@ class Kcompile(load.Load): time.sleep(1.0) if p.poll() != None: p.wait() + self.debug("restarting compile job") p = subprocess.Popen(self.args, stdin=null,stdout=null,stderr=null) self.debug("stopping kcompile") |