On 10/18/2012 06:37 PM, Phil Knirsch wrote:
On 10/16/2012 11:04 PM, James Antill wrote:
---
yum/__init__.py | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/yum/__init__.py b/yum/__init__.py
index be5a608..e43bf3c 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -4329,6 +4329,28 @@ much more problems).

return False

+ def _valid_install_arch(self, po, ipkgs=None):
+ ''' See if we can install this arch of package, mainly for
+ i386 vs. i586 or ppc64 vs. ppc64 etc. '''
+ if not ipkgs:
+ ipkgs = self.rpmdb.searchNames([po.name])
+ for txmbr in self.tsInfo.matchNaevr(po.name):
+ if txmbr.output_state not in TS_INSTALL_STATES:
+ continue
+ ipkgs.append(txmbr.po)
+
+ for ipkg in ipkgs:
+ if po.arch == ipkg.arch:
+ continue
+ if not po.verEQ(ipkg):
+ continue
+ if canCoinstall(po.arch, ipkg.arch):
+ continue
+ self.verbose_logger.log(logginglevels.INFO_2,
+ _("Package: %s - can't co-install with %s"), po, ipkg)
+ return False
+ return True
+
def install(self, po=None, **kwargs):
"""Mark the specified item for installation. If a package
object is given, mark it for installation. Otherwise, mark
@@ -4488,6 +4510,9 @@ much more problems).
txmbrs = self.update(po=po)
tx_return.extend(txmbrs)
continue
+
+ if not self._valid_install_arch(po, ipkgs):
+ continue

# Make sure we're not installing a package which is obsoleted by
# something else in the repo. Unless there is a obsoletion loop,
@@ -4861,6 +4886,9 @@ much more problems).
tx_return.append(txmbr)

for available_pkg in availpkgs:
+ if not self._valid_install_arch(available_pkg):
+ continue
+
# "Just do it" if it's a local pkg.
if isinstance(available_pkg, YumLocalPackage):
n = available_pkg.name
@@ -5373,6 +5401,10 @@ much more problems).
# installed version. Indexed fromn the latest installed pkgtup.
downgrade_apkgs = {}
for pkg in sorted(apkgs):
+ # We are cleverer here, I think...
+ # if not self._valid_install_arch(pkg, ipkgs):
+ # continue
+
na = (pkg.name, pkg.arch)

# Here we allow downgrades from .i386 => .noarch, or .i586 => .i386

Thanks James!

We'll get to test the fix tomorrow on our P7 box to see if it works,
will give an update then.

Thanks & regards, Phil


Alright, quick heads up: I ran the tests today and the patch seems to be working.

From what i understand the following now happens:

Installed: foo-1.i386

Exactarch irrelevant
Commands: yum install foo-1.i686
          yum install foo-1.i386 foo-1.i686
          yum update foo-1.i686
Result: Same version of pkgs, i386 pkg already installed. Co-install conflict detected, i686 pkg removed from ts -> Nothing to do, but no error.

Exactarch = true
Commands: yum install foo-2.i686
          yum install foo-2.i386 foo-2.i686
          yum update foo-2.i686
Result: Update, but exactarch keeps us on i386, so foo-2.i386 is installed.

Exactarch = false
Commands: yum install foo-2.i686
          yum install foo-2.i386 foo-2.i686
          yum update foo-2.i686
Result: Update, but exactarch now allows us to transition to "higher" arch, so update will be foo-2.i686.


I've only really tested the first case as that was the one that was erroring out (where it shouldn't have) and that works now as expected.

James, could you get a rawhide build of that yum today so we can pull it into our Fedora 18 ppc64 tree please?

Thanks!

Regards, Phil

--
Philipp Knirsch              | Tel.:  +49-711-96437-470
Manager Core Services        | Fax.:  +49-711-96437-111
Red Hat GmbH                 | Email: Phil Knirsch <pknir...@redhat.com>
Hauptstaetterstr. 58         | Web:   http://www.redhat.com/
D-70178 Stuttgart, Germany
_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to