mirror of
https://abf.rosa.ru/djam/urpm-tools.git
synced 2025-02-23 17:32:46 +00:00
Reposync: recognize situations when one of conflicting packages obsoletes another
This commit is contained in:
parent
d67ba50200
commit
5b7c54e070
1 changed files with 19 additions and 8 deletions
|
@ -220,16 +220,27 @@ def emulate_install(pkg):
|
||||||
global actions, not_provided_packages, conflicting_packages
|
global actions, not_provided_packages, conflicting_packages
|
||||||
vprint('Emulating package installation: ' + pkg)
|
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
|
conflicts = False
|
||||||
for confl in repository.packages[pkg]['conflicts']:
|
for confl in repository.packages[pkg]['conflicts']:
|
||||||
res = installed.whatprovides(confl)
|
res = installed.whatprovides(confl)
|
||||||
for item in res[:]:
|
for item in res[:]:
|
||||||
if item in to_remove_pre:
|
if item in to_remove_pre:
|
||||||
res.remove(item)
|
res.remove(item)
|
||||||
|
if item in pkg_obseletes:
|
||||||
|
res.remove(item)
|
||||||
|
to_remove_pre.append(item)
|
||||||
if res:
|
if res:
|
||||||
conflicts = True
|
conflicts = True
|
||||||
conflicting_packages.append( (pkg, res) )
|
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']:
|
for prov in repository.packages[pkg]['provides']:
|
||||||
|
@ -240,7 +251,7 @@ def emulate_install(pkg):
|
||||||
if res:
|
if res:
|
||||||
conflicts = True
|
conflicts = True
|
||||||
conflicting_packages.append( (res, pkg) )
|
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:
|
if conflicts:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Add table
Reference in a new issue