Reposync: recognize situations when one of conflicting packages obsoletes another

This commit is contained in:
Denis Silakov 2015-11-12 18:12:12 +03:00
parent d67ba50200
commit 5b7c54e070

View file

@ -219,19 +219,30 @@ def emulate_install(pkg):
''' Reurns True if something was done, False - if package was not installed '''
global actions, not_provided_packages, conflicting_packages
vprint('Emulating package installation: ' + pkg)
# TODO: Currently we only check that new package obsoletes the name of conflicting
# package. It would be more correct to check obsoleted version; on the other hand,
# removal of conflicting package is the only chance for us to avoid conflict,
# otherwise reposync will refuse to work
pkg_obseletes = []
for obs in repository.packages[pkg]['obsoletes']:
pkg_obseletes.append(obs.N)
conflicts = False
for confl in repository.packages[pkg]['conflicts']:
res = installed.whatprovides(confl)
for item in res[:]:
if item in to_remove_pre:
res.remove(item)
if item in pkg_obseletes:
res.remove(item)
to_remove_pre.append(item)
if res:
conflicts = True
conflicting_packages.append( (pkg, res) )
vprint("New conflict: %s, %s" % (str(pkg), str(res)))
vprint("New conflict1: %s, %s" % (str(pkg), str(res)))
for prov in repository.packages[pkg]['provides']:
res = installed.whatconflicts(prov)
for item in res[:]:
@ -240,13 +251,13 @@ def emulate_install(pkg):
if res:
conflicts = True
conflicting_packages.append( (res, pkg) )
vprint("New conflict: %s, %s" % (str(res), str(pkg)))
vprint("New conflict2: %s, %s" % (str(res), str(pkg)))
if conflicts:
return False
# remove the previosly added conflicts for this package
for item in conflicting_packages[:]:
pkg1, pkgs2 = item
if isinstance(pkgs2, basestring):