@@ -4789,6 +4789,21 @@ def _valid_install_arch(self, po, ipkgs=None):
4789
4789
return False
4790
4790
return True
4791
4791
4792
+ def _valid_obsoleter_arch (self , obsoleter , obsoletee ):
4793
+ """Return whether this obsoleter meets multilib_policy in case we are
4794
+ dealing with the noarch->arch obsoletion case."""
4795
+ if not self .arch .multilib or self .conf .multilib_policy != 'best' :
4796
+ # Install everything
4797
+ return True
4798
+ if obsoletee .arch != 'noarch' or obsoleter .arch == 'noarch' :
4799
+ # We do respect any arch->(no)arch obsoletions (having
4800
+ # obsoletee.i386 installed on x86_64, you'd still expect
4801
+ # obsoleter.i386 to replace it, even if you have
4802
+ # multilib_policy=best).
4803
+ return True
4804
+ # noarch->arch case
4805
+ return obsoleter .arch in self .arch .legit_multi_arches
4806
+
4792
4807
def install (self , po = None , ** kwargs ):
4793
4808
"""Mark the specified item for installation. If a package
4794
4809
object is given, mark it for installation. Otherwise, mark
@@ -5156,10 +5171,12 @@ def _dbg2(*args, **kwargs):
5156
5171
allow_missing = True )
5157
5172
if obsoleting_pkg is None :
5158
5173
continue
5174
+ installed_pkg = self .getInstalledPackageObject (installed )
5175
+ if not self ._valid_obsoleter_arch (obsoleting_pkg , installed_pkg ):
5176
+ continue
5159
5177
topkg = self ._test_loop (obsoleting_pkg , self ._pkg2obspkg )
5160
5178
if topkg is not None :
5161
5179
obsoleting_pkg = topkg
5162
- installed_pkg = self .getInstalledPackageObject (installed )
5163
5180
txmbr = self .tsInfo .addObsoleting (obsoleting_pkg , installed_pkg )
5164
5181
self .tsInfo .addObsoleted (installed_pkg , obsoleting_pkg )
5165
5182
if requiringPo :
@@ -5193,6 +5210,7 @@ def _dbg2(*args, **kwargs):
5193
5210
5194
5211
instpkgs = []
5195
5212
availpkgs = []
5213
+ arch_specified = True
5196
5214
if po : # just a po
5197
5215
if po .repoid == 'installed' :
5198
5216
instpkgs .append (po )
@@ -5254,6 +5272,8 @@ def _dbg2(*args, **kwargs):
5254
5272
self .logger .critical (_ ('No Match for argument: %s' ) % to_unicode (arg ))
5255
5273
if not self .conf .skip_missing_names_on_update :
5256
5274
raise Errors .UpdateMissingNameError , _ ('Not tolerating missing names on update, stopping.' )
5275
+
5276
+ arch_specified = '.' in kwargs ['pattern' ]
5257
5277
5258
5278
else : # we have kwargs, sort them out.
5259
5279
nevra_dict = self ._nevra_kwarg_parse (kwargs )
@@ -5306,12 +5326,16 @@ def _dbg2(*args, **kwargs):
5306
5326
allow_missing = True )
5307
5327
if obsoleting_pkg is None :
5308
5328
continue
5329
+ if not arch_specified and not self ._valid_obsoleter_arch (obsoleting_pkg , installed_pkg ):
5330
+ continue
5309
5331
obs_pkgs .append (obsoleting_pkg )
5310
5332
# NOTE: Broekn wrt. repoid
5311
5333
for obsoleting_pkg in packagesNewestByName (obs_pkgs ):
5312
5334
tx_return .extend (self .install (po = obsoleting_pkg ))
5313
5335
for available_pkg in availpkgs :
5314
5336
for obsoleted_pkg in self ._find_obsoletees (available_pkg ):
5337
+ if not arch_specified and not self ._valid_obsoleter_arch (available_pkg , obsoleted_pkg ):
5338
+ continue
5315
5339
obsoleted = obsoleted_pkg .pkgtup
5316
5340
txmbr = self .tsInfo .addObsoleting (available_pkg , obsoleted_pkg )
5317
5341
if requiringPo :
0 commit comments