do not include conflicted packages into index
This commit is contained in:
@@ -21,6 +21,7 @@ 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
|
||||||
@@ -43,6 +44,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"]
|
||||||
|
|
||||||
class Component(xmlfile.XmlFile):
|
class Component(xmlfile.XmlFile):
|
||||||
"representation for component declarations"
|
"representation for component declarations"
|
||||||
|
|||||||
+8
-2
@@ -104,9 +104,15 @@ 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 = []
|
||||||
|
for i in self.distribution.conflicts:
|
||||||
|
conflicts_list.append("%s" % i)
|
||||||
|
|
||||||
for pkg in util.filter_latest_packages(packages):
|
for pkg in util.filter_latest_packages(packages):
|
||||||
ctx.ui.info(_('Adding %s to package index') % pkg)
|
pkg_name = util.parse_package_name(os.path.basename(pkg))[0]
|
||||||
self.add_package(pkg, deltas, repo_uri)
|
if pkg_name not in conflicts_list:
|
||||||
|
ctx.ui.info(_('Adding %s to package index') % pkg)
|
||||||
|
self.add_package(pkg, deltas, repo_uri)
|
||||||
|
|
||||||
def update_db(self, repo, txn = None):
|
def update_db(self, repo, txn = None):
|
||||||
# FIXME: updating db takes too much time. So a notify mechanism is used to inform the status
|
# FIXME: updating db takes too much time. So a notify mechanism is used to inform the status
|
||||||
|
|||||||
Reference in New Issue
Block a user