BinpkgFetcher: handle AsynchronousLock failure
authorZac Medico <zmedico@gentoo.org>
Mon, 16 May 2011 07:21:03 +0000 (00:21 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 26 May 2011 03:04:37 +0000 (20:04 -0700)
pym/_emerge/BinpkgFetcher.py

index 221d9a7ffbb795ccf0ed23b8bc116321b41e031e..12544d1bed5c67633b66fb1c0203db0a9fc294cf 100644 (file)
@@ -158,7 +158,12 @@ class BinpkgFetcher(SpawnProcess):
                async_lock = AsynchronousLock(path=self.pkg_path,
                        scheduler=self.scheduler)
                async_lock.start()
-               async_lock.wait()
+
+               if async_lock.wait() != os.EX_OK:
+                       # TODO: Use CompositeTask for better handling, like in EbuildPhase.
+                       raise AssertionError("AsynchronousLock failed with returncode %s" \
+                               % (async_lock.returncode,))
+
                self._lock_obj = async_lock
                self.locked = True