# Slot dep only matters if we both have one. If we do they
# must be identical:
- if (self.slot is not None and other.slot is not None and
- self.slot != other.slot):
+ this_slot = getattr(self, 'slot', None)
+ that_slot = getattr(other, 'slot', None)
+ if (this_slot is not None and that_slot is not None and
+ this_slot != that_slot):
return False
# TODO: Uncomment when Portage's Atom supports repo
# cares about a flag it is irrelevant.
# Skip the (very common) case of one of us not having use deps:
- if self.use and other.use:
+ this_use = getattr(self, 'use', None)
+ that_use = getattr(other, 'use', None)
+ if this_use and that_use:
# Set of flags we do not have in common:
- flags = set(self.use.tokens) ^ set(other.use.tokens)
+ flags = set(this_use.tokens) ^ set(that_use.tokens)
for flag in flags:
# If this is unset and we also have the set version we fail:
if flag[0] == '-' and flag[1:] in flags:
else:
formatted_dep = mdep.operator + str(mdep.cpv)
if mdep.slot:
- formatted_dep += pp.emph(':') + pp.slot(mdep.slot)
+ formatted_dep += pp.emph(':') + pp.slot(','.join(mdep.slot))
if mdep.use:
useflags = pp.useflag(','.join(mdep.use.tokens))
formatted_dep += (pp.emph('[') + useflags + pp.emph(']'))
'slot': self.pkg.get_env_var("SLOT")
}
else:
- return self.pkg.cpv
+ return str(self.pkg.cpv)
def format_package_location(self):
"""Get the install status (in /var/db/?) and origin (from and overlay
if not isinstance(cpv, CPV):
raise ValueError("cpv must be a gentoolkit.cpv.CPV instance")
- #self.cpv = cpv
+ self.cpv = cpv
self.operator = op
self.version = cpv.version
self.revision = cpv.revision