[yum-commits] Branch 'yum-3_2_X' - 2 commits - output.py yum/__init__.py
James Antill
james at osuosl.org
Wed Aug 11 17:53:37 UTC 2010
output.py | 39 ++++++++++++++++++++++++++++++---------
yum/__init__.py | 8 ++++++++
2 files changed, 38 insertions(+), 9 deletions(-)
New commits:
commit f54244e2d4bd22ad89b84bea37395a1699adad0d
Author: James Antill <james at and.org>
Date: Wed Aug 11 12:50:30 2010 -0400
Change the format_missing_requires callback, to look for packages of
the same name with different versions and output their info.
This makes some implicit information explicit, to be clearer for the
users. Eg. Before:
Error: Package: gnome-media-2.31.5-4.fc14.x86_64 (fedora)
Requires: libgnome-control-center.so.1()(64bit)
Available: 1:control-center-2.31.5-2.fc14.x86_64 (fedora)
libgnome-control-center.so.1()(64bit)
...and after:
Error: Package: gnome-media-2.31.5-4.fc14.x86_64 (fedora)
Requires: libgnome-control-center.so.1()(64bit)
Available: 1:control-center-2.31.5-2.fc14.x86_64 (fedora)
libgnome-control-center.so.1()(64bit)
Removing: 1:control-center-2.30.1-2.fc13.x86_64 (@updates/13)
Not found
Updated By: 1:control-center-2.31.6-1.fc14.x86_64 (updates-testing)
Not found
...this adds a few more lookups, but it's all in the error paths.
diff --git a/output.py b/output.py
index 3a90995..10c7442 100755
--- a/output.py
+++ b/output.py
@@ -1882,10 +1882,12 @@ class DepSolveProgressCallBack:
msg += _('\n Not found')
return msg
- ipkgs = set()
- for pkg in sorted(yb.rpmdb.getProvides(needname)):
+ def _run_inst_pkg(pkg, msg):
nevr = (pkg.name, pkg.epoch, pkg.version, pkg.release)
- ipkgs.add(nevr)
+ if nevr in seen_pkgs or (pkg.verEQ(last) and pkg.arch == last.arch):
+ return msg
+
+ seen_pkgs.add(nevr)
action = _('Installed')
rmed = yb.tsInfo.getMembersWithState(pkg.pkgtup, TS_REMOVE_STATES)
if rmed:
@@ -1901,21 +1903,40 @@ class DepSolveProgressCallBack:
if rtype not in relmap:
continue
nevr = (rpkg.name, rpkg.epoch, rpkg.version, rpkg.release)
- ipkgs.add(nevr)
+ seen_pkgs.add(nevr)
msg += _msg_pkg(relmap[rtype], rpkg, needname)
+ return msg
- last = None
- for pkg in sorted(yb.pkgSack.getProvides(needname)):
+ def _run_avail_pkg(pkg, msg):
# We don't want to see installed packages, or N packages of the
# same version, from different repos.
nevr = (pkg.name, pkg.epoch, pkg.version, pkg.release)
- if nevr in ipkgs or (pkg.verEQ(last) and pkg.arch == last.arch):
- continue
- last = pkg
+ if nevr in seen_pkgs or (pkg.verEQ(last) and pkg.arch == last.arch):
+ return False, last, msg
+ seen_pkgs.add(nevr)
action = _('Available')
if yb.tsInfo.getMembersWithState(pkg.pkgtup, TS_INSTALL_STATES):
action = _('Installing')
msg += _msg_pkg(action, pkg, needname)
+ return True, pkg, msg
+
+ last = None
+ seen_pkgs = set()
+ for pkg in sorted(yb.rpmdb.getProvides(needname)):
+ msg = _run_inst_pkg(pkg, msg)
+
+ available_names = set()
+ for pkg in sorted(yb.pkgSack.getProvides(needname)):
+ tst, last, msg = _run_avail_pkg(pkg, msg)
+ if tst:
+ available_names.add(pkg.name)
+
+ last = None
+ for pkg in sorted(yb.rpmdb.searchNames(available_names)):
+ msg = _run_inst_pkg(pkg, msg)
+ last = None
+ for pkg in sorted(yb.pkgSack.searchNames(available_names)):
+ tst, last, msg = _run_avail_pkg(pkg, msg)
return msg
def procConflict(self, name, confname):
commit 83c22bd4521cf8464aed0abf6b9d873ef7b86ac5
Author: James Antill <james at and.org>
Date: Tue Aug 10 15:09:06 2010 -0400
Remove old txmbrs when creating a new remove txmbr, reinstall X X, BZ 622913.
diff --git a/yum/__init__.py b/yum/__init__.py
index 0304fea..3a9ef88 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3702,6 +3702,14 @@ class YumBase(depsolve.Depsolve):
if self.conf.protected_packages and po.pkgtup == kern_pkgtup:
self.logger.warning(_("Skipping the running kernel: %s") % po)
continue
+
+ if self.tsInfo.getMembers(po.pkgtup):
+ # This allows multiple reinstalls and update/downgrade "cancel"
+ for txmbr in self.tsInfo.matchNaevr(po.name):
+ self.logger.warning(_("Removing %s from the transaction") %
+ txmbr)
+ self.tsInfo.remove(txmbr.pkgtup)
+ # Now start the remove/reinstall
txmbr = self.tsInfo.addErase(po)
tx_return.append(txmbr)
More information about the Yum-commits
mailing list