diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index ceab3752..8cbfe510 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -637,10 +637,9 @@ Usage: info ... for arg in self.args: if ctx.componentdb.has_component(arg): - component, repo = ctx.componentdb.get_component_repo(arg) + component = ctx.componentdb.get_union_comp(arg) #if self.options.long: - if repo != pisi.itembyrepodb.installed: - ctx.ui.info(unicode(component)) + ctx.ui.info(unicode(component)) else: # then assume it was a package self.info_package(arg) self.finalize() diff --git a/pisi/component.py b/pisi/component.py index f0edb7b9..13c42bae 100644 --- a/pisi/component.py +++ b/pisi/component.py @@ -119,6 +119,20 @@ class ComponentDB(object): except pisi.itembyrepodb.NotfoundError, e: raise Error(_('Component %s not found') % name) + def get_union_comp(self, name, txn = None, tracking = False): + """get a union of all repository components packages, not just the first repo in order. + get only basic repo info from the first repo""" + def proc(txn): + s = self.d.d.get(name, txn=txn) + pkgs = set() + for repostr in self.d.order(tracking = tracking): + if s.has_key(repostr): + pkgs |= set(s[repostr].packages) + comp = self.get_component(name) + comp.packages = list(pkgs) + return comp + return self.d.txn_proc(proc, txn) + def list_components(self, repo=None, show_tracking=False): return self.d.list(repo, show_tracking=show_tracking) diff --git a/pisi/itembyrepodb.py b/pisi/itembyrepodb.py index 5cdd5f0f..9767b9e5 100644 --- a/pisi/itembyrepodb.py +++ b/pisi/itembyrepodb.py @@ -80,9 +80,11 @@ class ItemByRepoDB(object): return [ k for k,data in self.d.items() if pred(k, data)] # TODO: carry this to repodb, really :/ - def order(self): + def order(self, tracking = True): import pisi.repodb - order = [ 'repo-' + x for x in ctx.repodb.list() ] + ['trdparty', 'inst'] + order = [ 'repo-' + x for x in ctx.repodb.list() ] + if tracking: + order += ['trdparty', 'inst'] return order # def list_repo(self, repo):