diff options
author | Stanislav Ochotnicky <sochotnicky@gmail.com> | 2009-07-27 18:07:53 +0200 |
---|---|---|
committer | Stanislav Ochotnicky <sochotnicky@gmail.com> | 2009-07-27 18:07:53 +0200 |
commit | 93da4f679c041000aa99decb068d7aa5ae956edf (patch) | |
tree | f60a61052212406aa5310c273f5f81690638d6be /src | |
parent | Add log when dep fails (diff) | |
download | collagen-93da4f679c041000aa99decb068d7aa5ae956edf.tar.gz collagen-93da4f679c041000aa99decb068d7aa5ae956edf.tar.bz2 collagen-93da4f679c041000aa99decb068d7aa5ae956edf.zip |
Add error handling when package_infos is missing
should fix bug #18
Diffstat (limited to 'src')
-rw-r--r-- | src/tinderbox/__init__.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/tinderbox/__init__.py b/src/tinderbox/__init__.py index 79e9712..c9868ba 100644 --- a/src/tinderbox/__init__.py +++ b/src/tinderbox/__init__.py @@ -4,6 +4,7 @@ import socket import pickle from time import sleep import os +import errno import subprocess from subprocess import CalledProcessError import re @@ -115,6 +116,7 @@ class Tinderbox(object): package.version = pkgver else: package.version = "%s-%s" % (pkgver, pkgrev) + package.reinit() self._emerge_package_subprocess(pkg, ebuild, dep_groups, package) sys.exit(0) @@ -132,7 +134,13 @@ class Tinderbox(object): print "Something went really bad and we need logging, stat!" log.error("Emerge of package %s failed with error code: %d" % (pkg, status)) - package_infos = self._load_info('package_infos') + try: + package_infos = self._load_info('package_infos') + except IOError, e: + log.error("Loading package_infos file failed, something has gone wrong in subprocess apparently") + package.attachments["error"] = "Loading package_infos failed, package was not compiled with any dependency combination" + package_infos = [package.get_info()] + msg = protocol.AddPackageInfo(package_infos) self.sock.sendall(pickle.dumps(msg)) #TODO make binpkg @@ -365,6 +373,9 @@ class Package(object): self.name = name self.version = version self.use_flags = use_flags + self.reinit() + + def reinit(self): self.content = None self.attachments = {} self.depends = None |