diff options
author | André Erdmann <dywi@mailerd.de> | 2013-07-04 18:53:51 +0200 |
---|---|---|
committer | André Erdmann <dywi@mailerd.de> | 2013-07-04 18:53:51 +0200 |
commit | 3187207842e4c7022f3129bf5343924a1e33b594 (patch) | |
tree | 0b242ab5531c5de81bfa67189aea6c3d2c739ee7 /roverlay/packageinfo.py | |
parent | roverlay/interface/depres: fix pool counting (diff) | |
download | R_overlay-3187207842e4c7022f3129bf5343924a1e33b594.tar.gz R_overlay-3187207842e4c7022f3129bf5343924a1e33b594.tar.bz2 R_overlay-3187207842e4c7022f3129bf5343924a1e33b594.zip |
roverlay/depres: return depresult objects
Dependency resolution now creates depresult objects if a rule matches a
dependency string. Previously, it returned a 2-tuple (score,resolving_dep).
This is "necessary" for selfdep reduction (also see pseudocode in
overlay/root.py).
Additionally, this commit allows to define selfdeps that don't belong to the
default category ("sci-R") in rule files, either by OR-ing a deptype with
"#deptype <deptype>,selfdep" or by prefixing a single rule with "@selfdep".
The rule stub syntax ("zoo") is mostly unaffected by this change, but roverlay
is able to detect (non-)default-category selfdeps now.
Diffstat (limited to 'roverlay/packageinfo.py')
-rw-r--r-- | roverlay/packageinfo.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/roverlay/packageinfo.py b/roverlay/packageinfo.py index b86d69d..bef9327 100644 --- a/roverlay/packageinfo.py +++ b/roverlay/packageinfo.py @@ -104,6 +104,7 @@ class PackageInfo ( object ): 'imported', 'physical_only', 'src_uri', + 'has_suggests', )) _UPDATE_KEYS_SIMPLE_INITIAL = frozenset (( 'package_filename', @@ -126,10 +127,13 @@ class PackageInfo ( object ): arguments: * **initial_info -- passed to update ( **kw ) """ - self._info = dict() - self.readonly = False + self._info = dict() + self.valid = True + self.readonly = False + self.logger = LOGGER + self.selfdeps = None + #self.overlay_package_ref = None - self.logger = LOGGER #self._evars = dict() #self._lazy_actions = list() #(or set(), but list preserves order for actions with the same condition) @@ -137,6 +141,17 @@ class PackageInfo ( object ): self.update ( **initial_info ) # --- end of __init__ (...) --- + def has_valid_selfdeps ( self ): + """Returns True if all selfdeps of this package are valid.""" + v = self.valid + if v is True and self.selfdeps is not None and not all ( + map ( lambda d: d.deps_satisfiable(), self.selfdeps ) + ): + self.valid = False + return False + return v + # --- end of has_valid_selfdeps (...) --- + def attach_lazy_action ( self, lazy_action ): """Attaches a lazy action. Unsafe operation (no locks will be acquired etc.). @@ -664,11 +679,9 @@ class PackageInfo ( object ): self._use_pvr ( value ) elif key == 'suggests': + # FIXME/TODO: remove self._info ['has_suggests'] = value - elif key == 'depres_result': - self._info ['has_suggests'] = value [2] - elif key == 'filepath': self._use_filepath ( value ) |