[yum-commits] Branch 'yum-3_2_X' - 5 commits - docs/yum.8 output.py yumcommands.py yum/transactioninfo.py

James Antill james at osuosl.org
Tue Dec 1 15:43:58 UTC 2009


 docs/yum.8             |    5 ++++-
 output.py              |   12 ++++++++++--
 yum/transactioninfo.py |    6 ++++++
 yumcommands.py         |   27 ++++++++++++++++++++++-----
 4 files changed, 42 insertions(+), 8 deletions(-)

New commits:
commit 4aa1a6639a1544bc714b75b61d5cbf9d5ce34fc3
Author: James Antill <james at and.org>
Date:   Tue Dec 1 10:06:09 2009 -0500

    Make status output nicer for repolist disabled/all/enabled, BZ 540489

diff --git a/yumcommands.py b/yumcommands.py
index b809216..002164b 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -803,10 +803,14 @@ class RepoListCommand(YumCommand):
         for repo in repos:
             if len(extcmds) and not _repo_match(repo, extcmds):
                 continue
+            if arg != 'all':
+                ui_enabled = ''
+                ui_endis_wid = 0
             if repo in enabled_repos:
                 enabled = True
-                ui_enabled = ehibeg + _('enabled') + hiend + ": "
-                ui_endis_wid = utf8_width(_('enabled')) + 2
+                if arg == 'all':
+                    ui_enabled = ehibeg + _('enabled') + hiend + ": "
+                    ui_endis_wid = utf8_width(_('enabled')) + 2
                 num        = len(repo.sack)
                 tot_num   += num
                 ui_num     = to_unicode(locale.format("%d", num, True))
@@ -921,7 +925,9 @@ class RepoListCommand(YumCommand):
                     ct_len = ui_endis_wid
                 if ui_len < len(ui_num):
                     ui_len = len(ui_num)
-            if utf8_width(_('status')) > ct_len + ui_len:
+            if arg == 'disabled': # Don't output a status column.
+                left = base.term.columns - (id_len + 1)
+            elif utf8_width(_('status')) > ct_len + ui_len:
                 left = base.term.columns - (id_len + utf8_width(_('status')) +2)
             else:
                 left = base.term.columns - (id_len + ct_len + ui_len + 2)
@@ -935,9 +941,20 @@ class RepoListCommand(YumCommand):
 
             txt_rid  = utf8_width_fill(_('repo id'), id_len)
             txt_rnam = utf8_width_fill(_('repo name'), nm_len, nm_len)
-            base.verbose_logger.log(logginglevels.INFO_2,"%s %s %s",
-                                    txt_rid, txt_rnam, _('status'))
+            if arg == 'disabled': # Don't output a status column.
+                base.verbose_logger.log(logginglevels.INFO_2,"%s %s",
+                                        txt_rid, txt_rnam)
+            else:
+                base.verbose_logger.log(logginglevels.INFO_2,"%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",
+                                            utf8_width_fill(rid, id_len),
+                                            utf8_width_fill(rname, nm_len,
+                                                            nm_len))
+                    continue
+
                 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",
commit 941e2419be760822dcdaf406d95523fe01593ff6
Author: James Antill <james at and.org>
Date:   Mon Nov 30 23:42:31 2009 -0500

    Add obsoleted packages to obsoleting txmbrs

diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py
index c2fc804..a00342c 100644
--- a/yum/transactioninfo.py
+++ b/yum/transactioninfo.py
@@ -487,6 +487,12 @@ class TransactionData:
         txmbr.relatedto.append((obsoleting_po, 'obsoletedby'))
         txmbr.obsoleted_by.append(obsoleting_po)
         self.add(txmbr)
+        for otxmbr in self.getMembersWithState(obsoleting_po.pkgtup,
+                                               [TS_OBSOLETING]):
+            if po in otxmbr.obsoletes:
+                continue
+            otxmbr.relatedto.append((po, 'obsoletes'))
+            otxmbr.obsoletes.append(po)
         return txmbr
 
 
commit 8c0d5afc8645322ce0089baf4b674f88328d7cba
Author: James Antill <james at and.org>
Date:   Mon Nov 30 23:39:54 2009 -0500

    Add yum-security link to yum man page

diff --git a/docs/yum.8 b/docs/yum.8
index ff82ece..6ba873e 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -500,6 +500,7 @@ configuration options.
 .I yum-complete-transaction (1)
 .I yumdownloader (1)
 .I yum-utils (1)
+.I yum-security (8)
 http://yum.baseurl.org/
 http://yum.baseurl.org/wiki/Faq
 yum search yum
commit 1baeb9b072cfa7260b96e09032e9994e113cfcea
Author: James Antill <james at and.org>
Date:   Tue Nov 24 16:43:38 2009 -0500

    Tell people looking for list recent, about list-updateinfo new

diff --git a/docs/yum.8 b/docs/yum.8
index 7ac9772..ff82ece 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -394,7 +394,9 @@ List the packages installed on the system that are obsoleted by packages
 in any yum repository listed in the config file.
 .IP
 .IP "\fByum list recent\fP"
-List packages recently added into the repositories. 
+List packages recently added into the repositories. This is often not helpful,
+but what you may really want to use is "yum list-updateinfo new" from the
+security yum plugin.
 .IP
 .IP "\fBSpecifying package names\fP"
 All the list options mentioned above take file-glob-syntax wildcards or package
commit 6b714d980095e1ee94005a7ed657b6eb8db5d7d2
Author: James Antill <james at and.org>
Date:   Mon Nov 23 23:15:04 2009 -0500

    Fix the chopping name output in "history info", when we obsolete

diff --git a/output.py b/output.py
index 4a94bc4..a59ca66 100755
--- a/output.py
+++ b/output.py
@@ -1428,6 +1428,7 @@ to exit.
                 print "%4d" % num, line
 
     def historyInfoCmdPkgsAltered(self, old, pats=[]):
+        last = None
         for hpkg in old.trans_data:
             prefix = " " * 4
             if not hpkg.done:
@@ -1459,15 +1460,22 @@ to exit.
             uistate = utf8_width_fill(uistate, 12, 12)
             # Should probably use columns here...
             if False: pass
-            elif hpkg.state == 'Update':
+            elif (last is not None and
+                  last.state == 'Updated' and last.name == hpkg.name and
+                  hpkg.state == 'Update'):
                 ln = len(hpkg.name) + 1
                 cn = (" " * ln) + cn[ln:]
                 print "%s%s%s%s %s" % (prefix, hibeg, uistate, hiend, cn)
-            elif hpkg.state == 'Downgraded':
+            elif (last is not None and
+                  last.state == 'Downgrade' and last.name == hpkg.name and
+                  hpkg.state == 'Downgraded'):
                 ln = len(hpkg.name) + 1
                 cn = (" " * ln) + cn[ln:]
                 print "%s%s%s%s %s" % (prefix, hibeg, uistate, hiend, cn)
             else:
+                last = None
+                if hpkg.state in ('Updated', 'Downgrade'):
+                    last = hpkg
                 print "%s%s%s%s %s" % (prefix, hibeg, uistate, hiend, cn)
 
     def historySummaryCmd(self, extcmds):


More information about the Yum-commits mailing list