* conflicts to obsoletes

This commit is contained in:
Faik Uygur
2007-02-15 12:31:02 +00:00
parent 4e10232398
commit 787e5ecf0b
2 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -21,13 +21,20 @@ import pisi.pxml.autoxml as autoxml
import pisi.lockeddbshelve as shelve import pisi.lockeddbshelve as shelve
from pisi.itembyrepodb import ItemByRepoDB from pisi.itembyrepodb import ItemByRepoDB
import pisi.itembyrepodb as itembyrepodb import pisi.itembyrepodb as itembyrepodb
from pisi.conflict import Conflict
class Error(pisi.Error): class Error(pisi.Error):
pass pass
__metaclass__ = autoxml.autoxml __metaclass__ = autoxml.autoxml
class Obsolete:
__metaclass__ = autoxml.autoxml
s_Package = [autoxml.String, autoxml.mandatory]
def __str__(self):
return self.package
class Distribution(xmlfile.XmlFile): class Distribution(xmlfile.XmlFile):
@@ -44,7 +51,7 @@ class Distribution(xmlfile.XmlFile):
t_BinaryName = [autoxml.Text, autoxml.optional] # name of repository (binary distro) t_BinaryName = [autoxml.Text, autoxml.optional] # name of repository (binary distro)
t_Architecture = [autoxml.Text, autoxml.optional] # architecture identifier 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): class Component(xmlfile.XmlFile):
"representation for component declarations" "representation for component declarations"
+2 -2
View File
@@ -104,11 +104,11 @@ class Index(XmlFile):
if fn == 'distribution.xml': if fn == 'distribution.xml':
self.add_distro(os.path.join(root, fn)) 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): for pkg in util.filter_latest_packages(packages):
pkg_name = util.parse_package_name(os.path.basename(pkg))[0] 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) ctx.ui.info(_('Adding %s to package index') % pkg)
self.add_package(pkg, deltas, repo_uri) self.add_package(pkg, deltas, repo_uri)