[yum-commits] Branch 'yum-3_2_X' - 3 commits - yum/__init__.py yum/rpmtrans.py yum/update_md.py
James Antill
james at osuosl.org
Thu Jun 16 14:55:19 UTC 2011
yum/__init__.py | 7 +++++++
yum/rpmtrans.py | 3 +++
yum/update_md.py | 4 +++-
3 files changed, 13 insertions(+), 1 deletion(-)
New commits:
commit a0910bf542ddc408ab2cdff932d2d58302db504a
Author: James Antill <james at and.org>
Date: Thu Jun 16 10:55:12 2011 -0400
Add comments on TS_FAILED setting.
diff --git a/yum/__init__.py b/yum/__init__.py
index d879c51..8fa957f 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1589,6 +1589,7 @@ class YumBase(depsolve.Depsolve):
# but raising an exception is not going to do any good
self.logger.critical(_('%s was supposed to be installed' \
' but is not!' % txmbr.po))
+ # Note: Get Panu to do te.Failed() so we don't have to
txmbr.output_state = TS_FAILED
continue
po = self.getInstalledPackageObject(txmbr.pkgtup)
@@ -1649,8 +1650,12 @@ class YumBase(depsolve.Depsolve):
output_states=TS_INSTALL_STATES):
# maybe a file log here, too
# but raising an exception is not going to do any good
+ # Note: This actually triggers atm. because we can't
+ # always find the erased txmbr to set it when
+ # we should.
self.logger.critical(_('%s was supposed to be removed' \
' but is not!' % txmbr.po))
+ # Note: Get Panu to do te.Failed() so we don't have to
txmbr.output_state = TS_FAILED
continue
yumdb_item = self.rpmdb.yumdb.get_package(po=txmbr.po)
commit 521d84d0e65b9743ed63b11c335466cd6ae25d01
Author: Nick Jacek <njacek at redhat.com>
Date: Thu Jun 16 10:09:43 2011 -0400
If verifyTransaction detects that an install or removal was not successful, it will now set the output_state of the pkg to TS_FAILED. BZ 661962
For the case of a removal, since the output_state will be TS_FAILED
rather than just remaining TS_ERASE, yum will now correctly say that
the removal failed instead of saying that the package was removed.
diff --git a/yum/__init__.py b/yum/__init__.py
index a0c6b9d..d879c51 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1589,6 +1589,7 @@ class YumBase(depsolve.Depsolve):
# but raising an exception is not going to do any good
self.logger.critical(_('%s was supposed to be installed' \
' but is not!' % txmbr.po))
+ txmbr.output_state = TS_FAILED
continue
po = self.getInstalledPackageObject(txmbr.pkgtup)
rpo = txmbr.po
@@ -1650,6 +1651,7 @@ class YumBase(depsolve.Depsolve):
# but raising an exception is not going to do any good
self.logger.critical(_('%s was supposed to be removed' \
' but is not!' % txmbr.po))
+ txmbr.output_state = TS_FAILED
continue
yumdb_item = self.rpmdb.yumdb.get_package(po=txmbr.po)
yumdb_item.clean()
diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py
index 6687080..43f9634 100644
--- a/yum/rpmtrans.py
+++ b/yum/rpmtrans.py
@@ -545,6 +545,7 @@ class RPMTransaction:
def _cpioError(self, bytes, total, h):
name, txmbr = self._getTxmbr(h)
+ # In the case of a remove, we only have a name, not a txmbr
if txmbr is not None:
msg = "Error in cpio payload of rpm package %s" % txmbr.po
txmbr.output_state = TS_FAILED
@@ -553,6 +554,7 @@ class RPMTransaction:
def _unpackError(self, bytes, total, h):
name, txmbr = self._getTxmbr(h)
+ # In the case of a remove, we only have a name, not a txmbr
if txmbr is not None:
txmbr.output_state = TS_FAILED
msg = "Error unpacking rpm package %s" % txmbr.po
@@ -574,6 +576,7 @@ class RPMTransaction:
if total:
msg = ("Error in %s scriptlet in rpm package %s" %
(scriptlet_name, package_name))
+ # In the case of a remove, we only have a name, not a txmbr
if txmbr is not None:
txmbr.output_state = TS_FAILED
else:
commit 677dd8469b4c2b1111951f58f0dbfdcc4d8d2087
Author: James Antill <james at and.org>
Date: Thu Jun 16 10:52:36 2011 -0400
Add a __unicode__ to the UpdateNotice object, so the test code works.
diff --git a/yum/update_md.py b/yum/update_md.py
index 39fa72e..2cb1acb 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -23,7 +23,7 @@ Update metadata (updateinfo.xml) parsing.
import sys
-from yum.i18n import utf8_text_wrap, to_utf8
+from yum.i18n import utf8_text_wrap, to_utf8, to_unicode
from yum.yumRepo import YumRepository
from yum.packages import FakeRepository
from yum.misc import to_xml, decompress, repo_gen_decompress
@@ -161,6 +161,8 @@ class UpdateNotice(object):
def __str__(self):
return to_utf8(self.text())
+ def __unicode__(self):
+ return to_unicode(self.text())
def get_metadata(self):
""" Return the metadata dict. """
More information about the Yum-commits
mailing list