From 787e5ecf0b9e62069f39951787fc4b5522a275ed Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 15 Feb 2007 12:31:02 +0000 Subject: [PATCH] * conflicts to obsoletes --- pisi/component.py | 11 +++++++++-- pisi/index.py | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pisi/component.py b/pisi/component.py index 9b1ea73f..ceb96a2c 100644 --- a/pisi/component.py +++ b/pisi/component.py @@ -21,13 +21,20 @@ import pisi.pxml.autoxml as autoxml import pisi.lockeddbshelve as shelve from pisi.itembyrepodb import ItemByRepoDB import pisi.itembyrepodb as itembyrepodb -from pisi.conflict import Conflict class Error(pisi.Error): pass __metaclass__ = autoxml.autoxml +class Obsolete: + + __metaclass__ = autoxml.autoxml + + s_Package = [autoxml.String, autoxml.mandatory] + + def __str__(self): + return self.package class Distribution(xmlfile.XmlFile): @@ -44,7 +51,7 @@ class Distribution(xmlfile.XmlFile): t_BinaryName = [autoxml.Text, autoxml.optional] # name of repository (binary distro) t_Architecture = [autoxml.Text, autoxml.optional] # architecture identifier - t_Conflicts = [ [Conflict], autoxml.optional, "Conflicts/Package"] + t_Obsoletes = [ [Obsolete], autoxml.optional, "Obsoletes/Package"] class Component(xmlfile.XmlFile): "representation for component declarations" diff --git a/pisi/index.py b/pisi/index.py index c655b8f4..13253b3f 100644 --- a/pisi/index.py +++ b/pisi/index.py @@ -104,11 +104,11 @@ class Index(XmlFile): if fn == 'distribution.xml': self.add_distro(os.path.join(root, fn)) - conflicts_list = map(str, self.distribution.conflicts) + obsoletes_list = map(str, self.distribution.obsoletes) for pkg in util.filter_latest_packages(packages): pkg_name = util.parse_package_name(os.path.basename(pkg))[0] - if pkg_name not in conflicts_list: + if pkg_name not in obsoletes_list: ctx.ui.info(_('Adding %s to package index') % pkg) self.add_package(pkg, deltas, repo_uri)