diff options
author | André Erdmann <dywi@mailerd.de> | 2012-07-02 18:48:31 +0200 |
---|---|---|
committer | André Erdmann <dywi@mailerd.de> | 2012-07-02 18:48:31 +0200 |
commit | 8a174d86bba8fa67d38935da2b7b7c51f53606fa (patch) | |
tree | bd5c5fff0bd2b7e27a21655a74a81115b830be95 /roverlay/ebuild | |
parent | depres channels: lock id generator usage (diff) | |
download | R_overlay-8a174d86bba8fa67d38935da2b7b7c51f53606fa.tar.gz R_overlay-8a174d86bba8fa67d38935da2b7b7c51f53606fa.tar.bz2 R_overlay-8a174d86bba8fa67d38935da2b7b7c51f53606fa.zip |
threaded overlay writing fix some threading issues
* the overlay produced can now be written to fs using per-pacackage dir threads
* fixed some thread locking issues
* added an error queue used by threads to pass exceptions to the main module
modified: roverlay/depres/channels.py
modified: roverlay/depres/depresolver.py
modified: roverlay/ebuild/creation.py
modified: roverlay/ebuild/depres.py
modified: roverlay/overlay/__init__.py
modified: roverlay/overlay/category.py
modified: roverlay/overlay/creator.py
modified: roverlay/overlay/package.py
modified: roverlay/overlay/worker.py
Diffstat (limited to 'roverlay/ebuild')
-rw-r--r-- | roverlay/ebuild/creation.py | 17 | ||||
-rw-r--r-- | roverlay/ebuild/depres.py | 9 |
2 files changed, 16 insertions, 10 deletions
diff --git a/roverlay/ebuild/creation.py b/roverlay/ebuild/creation.py index 056b1a2..b606ae9 100644 --- a/roverlay/ebuild/creation.py +++ b/roverlay/ebuild/creation.py @@ -22,7 +22,7 @@ FALLBACK_DESCRIPTION = "<none>" class EbuildCreation ( object ): """Used to create an ebuild using DESCRIPTION data.""" - def __init__ ( self, package_info, depres_channel_spawner=None ): + def __init__ ( self, package_info, err_queue, depres_channel_spawner=None ): """Initializes the creation of an ebuild. arguments: @@ -39,6 +39,8 @@ class EbuildCreation ( object ): self.depres_channel_spawner = depres_channel_spawner + self.err_queue = err_queue + self.package_info.set_readonly() # --- end of __init__ (...) --- @@ -64,10 +66,10 @@ class EbuildCreation ( object ): self.logger.info ( "Cannot create an ebuild for this package." ) self.status = -1 - except Exception as e: - # log this and set status to fail + except ( Exception, KeyboardInterrupt ): + # set status to fail self.status = -10 - self.logger.exception ( e ) + raise # --- end of run (...) --- def _lazyimport_desc_data ( self ): @@ -82,8 +84,8 @@ class EbuildCreation ( object ): logger=self.logger, read_now=True ) - self.package_info.set_writeable() - self.package_info.update ( + + self.package_info.update_now ( desc_data=reader.get_desc ( run_if_unset=False ) ) del reader @@ -133,7 +135,8 @@ class EbuildCreation ( object ): _dep_resolution = depres.EbuildDepRes ( self.package_info, self.logger, create_iuse=True, run_now=True, - depres_channel_spawner=self.depres_channel_spawner + depres_channel_spawner=self.depres_channel_spawner, + err_queue=self.err_queue ) if not _dep_resolution.success(): # log here? (FIXME) diff --git a/roverlay/ebuild/depres.py b/roverlay/ebuild/depres.py index 383831e..1c19a00 100644 --- a/roverlay/ebuild/depres.py +++ b/roverlay/ebuild/depres.py @@ -22,8 +22,8 @@ class EbuildDepRes ( object ): """Handles dependency resolution for a single ebuild.""" def __init__ ( - self, package_info, logger, depres_channel_spawner, - create_iuse=True, run_now=True + self, package_info, logger, depres_channel_spawner, err_queue, + create_iuse=True, run_now=True, ): """Initializes an EbuildDepRes. @@ -45,6 +45,8 @@ class EbuildDepRes ( object ): self.has_suggests = None self.create_iuse = create_iuse + self.err_queue = err_queue + self._channels = None if run_now: @@ -90,7 +92,8 @@ class EbuildDepRes ( object ): if dependency_type not in self._channels: self._channels [dependency_type] = self.request_resolver ( name=dependency_type, - logger=self.logger + logger=self.logger, + err_queue=self.err_queue ) return self._channels [dependency_type] # --- end of get_channel (...) --- |