diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index fbda94b8..219c3da5 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -21,7 +21,9 @@ import pisi import pisi.cli import pisi.context as ctx from pisi.uri import URI - +import pisi.util as util +import pisi.api as api +import pisi.packagedb as packagedb class Error(pisi.Error): pass @@ -536,6 +538,8 @@ Usage: info ... metadata, files = pisi.api.info(arg) ctx.ui.info(unicode(metadata.package)) + revdeps = [x[0] for x in packagedb.get_rev_deps(arg)] + ctx.ui.info( _('Reverse Dependencies: ') + util.strlist(revdeps) ) if self.options.files or self.options.files_path: if files: ctx.ui.info(_('\nFiles:')) diff --git a/pisi/component.py b/pisi/component.py index 7060198c..1dd6252a 100644 --- a/pisi/component.py +++ b/pisi/component.py @@ -91,6 +91,8 @@ class ComponentDB(object): return self.d.has_key(name) def get_component(self, name): + if not self.has_component(name): + self.d[name] = Component(name = name) return self.d[name] def list_components(self): @@ -99,12 +101,13 @@ class ComponentDB(object): list.append(pkg) return list - def add_component(self, component): + def update_component(self, component): + if self.d.has_key(component.name): + # preserve the list of packages + component.packages = self.d[component.name].packages self.d[component.name] = component def add_package(self, component_name, package): - if not self.has_component(component_name): - raise Error(_('Information for component %s not available') % component_name) component = self.get_component(component_name) component.packages.append(package) self.d[component_name] = component # update diff --git a/pisi/index.py b/pisi/index.py index 77f9e5e8..c1101835 100644 --- a/pisi/index.py +++ b/pisi/index.py @@ -80,7 +80,7 @@ class Index(XmlFile): pkgdb = packagedb.get_db(repo) pkgdb.clear() for comp in self.components: - ctx.componentdb.add_component(comp) + ctx.componentdb.update_component(comp) for pkg in self.packages: pkgdb.add_package(pkg) diff --git a/pisi/pxml/autoxml.py b/pisi/pxml/autoxml.py index 3bda2a51..8938fcd6 100644 --- a/pisi/pxml/autoxml.py +++ b/pisi/pxml/autoxml.py @@ -306,7 +306,8 @@ class autoxml(oo.autosuper, oo.autoprop): #XmlFile.__init__(self, tag = tag) #workaround: init only top level xmlfile, not the parts if not args.has_key('tag'): - XmlFile.__init__(self, tag = cls.tag) + #XmlFile.__init__(self, tag = cls.tag) + pass # disable xmlfile support in constructor entirely! for base in cls.autoxml_bases: base.__init__(self) #super(cls, self).__init__(tag = tag) cooperative shit disabled for now