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

@ -220,16 +220,27 @@ def emulate_install(pkg):
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']:
@ -240,7 +251,7 @@ 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