[yum-commits] Branch 'yum-3_2_X' - 3 commits - docs/yum.conf.5 yumcommands.py yum/__init__.py yummain.py
James Antill
james at osuosl.org
Tue May 24 21:26:28 UTC 2011
docs/yum.conf.5 | 4 ++--
yum/__init__.py | 6 ++++++
yumcommands.py | 13 ++++++-------
yummain.py | 7 ++++---
4 files changed, 18 insertions(+), 12 deletions(-)
New commits:
commit 4f91d1634e833bfc5ab6cc48deef125f0e32afef
Author: James Antill <james at and.org>
Date: Tue May 24 17:23:59 2011 -0400
Don't show depsolve failure messages for non-depsolving problems. BZ 597336.
diff --git a/yum/__init__.py b/yum/__init__.py
index 36c4077..61c71cf 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1000,6 +1000,10 @@ class YumBase(depsolve.Depsolve):
if self.tsInfo.pkgSack is not None: # rm Transactions don't have pkgSack
self.tsInfo.pkgSack.dropCachedData()
+ # FIXME: This is horrible, see below and yummain. Maybe create a real
+ # rescode object? :(
+ self._depsolving_failed = rescode == 1
+
txmbrs = []
if rescode == 2 and self.conf.protected_multilib and self.arch.multilib:
txmbrs = self.tsInfo.getMembersWithState(None, TS_INSTALL_STATES)
@@ -1036,6 +1040,7 @@ class YumBase(depsolve.Depsolve):
xrestring.append(msg % (first, other))
if xrestring:
rescode = 1
+ self._depsolving_failed = False
restring = xrestring
# This is a version of the old "protect-packages" plugin, it allows
@@ -1088,6 +1093,7 @@ class YumBase(depsolve.Depsolve):
for pkgname in sorted(bad_togo):
restring.append(_('Trying to remove "%s", which is protected') %
pkgname)
+ self._depsolving_failed = False
if rescode == 2:
self.save_ts(auto=True)
diff --git a/yummain.py b/yummain.py
index 1b94153..ea85926 100755
--- a/yummain.py
+++ b/yummain.py
@@ -189,9 +189,10 @@ def main(args):
prefix = _('Error: %s')
prefix2nd = (' ' * (utf8_width(prefix) - 2))
logger.critical(prefix, msg.replace('\n', '\n' + prefix2nd))
- if not base.conf.skip_broken:
- verbose_logger.info(_(" You could try using --skip-broken to work around the problem"))
- rpmdb_warn_checks()
+ if base._depsolving_failed:
+ if not base.conf.skip_broken:
+ verbose_logger.info(_(" You could try using --skip-broken to work around the problem"))
+ rpmdb_warn_checks()
if unlock(): return 200
return 1
elif result == 2:
commit 96b934cbf21554d83b24926517e2833379b3f307
Author: James Antill <james at and.org>
Date: Tue May 24 17:12:50 2011 -0400
Remove usage of INFO_* from yumcommands, as -q supresses that. BZ 689241.
diff --git a/yumcommands.py b/yumcommands.py
index fb70f3e..a950011 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -158,7 +158,7 @@ class YumCommand:
def doneCommand(self, base, msg, *args):
if not self.done_command_once:
- base.verbose_logger.log(logginglevels.INFO_2, msg, *args)
+ base.verbose_logger.info(msg, *args)
self.done_command_once = True
def getNames(self):
@@ -1060,14 +1060,14 @@ class RepoListCommand(YumCommand):
txt_rid = utf8_width_fill(_('repo id'), id_len)
txt_rnam = utf8_width_fill(_('repo name'), nm_len, nm_len)
if arg == 'disabled': # Don't output a status column.
- base.verbose_logger.log(logginglevels.INFO_2,"%s %s",
+ base.verbose_logger.info("%s %s",
txt_rid, txt_rnam)
else:
- base.verbose_logger.log(logginglevels.INFO_2,"%s %s %s",
+ base.verbose_logger.info("%s %s %s",
txt_rid, txt_rnam, _('status'))
for (rid, rname, (ui_enabled, ui_endis_wid), ui_num) in cols:
if arg == 'disabled': # Don't output a status column.
- base.verbose_logger.log(logginglevels.INFO_2, "%s %s",
+ base.verbose_logger.info("%s %s",
utf8_width_fill(rid, id_len),
utf8_width_fill(rname, nm_len,
nm_len))
@@ -1075,7 +1075,7 @@ class RepoListCommand(YumCommand):
if ui_num:
ui_num = utf8_width_fill(ui_num, ui_len, left=False)
- base.verbose_logger.log(logginglevels.INFO_2, "%s %s %s%s",
+ base.verbose_logger.info("%s %s %s%s",
utf8_width_fill(rid, id_len),
utf8_width_fill(rname, nm_len, nm_len),
ui_enabled, ui_num)
@@ -1144,8 +1144,7 @@ class HelpCommand(YumCommand):
def doCommand(self, base, basecmd, extcmds):
if extcmds[0] in base.yum_cli_commands:
command = base.yum_cli_commands[extcmds[0]]
- base.verbose_logger.log(logginglevels.INFO_2,
- self._makeOutput(command))
+ base.verbose_logger.info(self._makeOutput(command))
return 0, []
def needTs(self, base, basecmd, extcmds):
commit 0c051cf3275d09a47f1c68b3b13681be4f79fe92
Author: James Antill <james at and.org>
Date: Tue May 24 17:06:44 2011 -0400
Tweak color docs. again. BZ 672706.
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index e6037c2..bebc050 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -492,8 +492,8 @@ bugtrackers.
.IP
\fBcolor \fR
-Display colorized output automatically, depending on the output terminal,
-always (using ANSI codes) or never.
+Whether to display colorized output automatically, depending on the output
+terminal, can be changed to always (using ANSI codes) or never.
Default is `auto'.
Possible values are: auto, never, always.
Command-line option: \fB\-\-color\fP
More information about the Yum-commits
mailing list