mirror of
https://abf.rosa.ru/djam/urpm-tools.git
synced 2025-02-23 09:22:47 +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
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue