[yum-commits] Branch 'yum-3_2_X' - 6 commits - docs/yum.8 docs/yum.conf.5 yum/packages.py yum/update_md.py yum/yumRepo.py

James Antill james at osuosl.org
Mon Apr 13 16:44:06 UTC 2009


 docs/yum.8       |    3 ++-
 docs/yum.conf.5  |    4 +++-
 yum/packages.py  |   20 +++++++++++++++++++-
 yum/update_md.py |    3 +++
 yum/yumRepo.py   |    5 ++++-
 5 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit 0f752404bb13915cea646ea5db8a270bd58d6f47
Author: James Antill <james at and.org>
Date:   Mon Apr 13 12:29:10 2009 -0400

    Fix local repos. to not traceback UpdateMetadata

diff --git a/yum/update_md.py b/yum/update_md.py
index 9b1f07b..b297704 100644
--- a/yum/update_md.py
+++ b/yum/update_md.py
@@ -26,6 +26,7 @@ import gzip
 
 from yum.i18n import utf8_text_wrap, to_utf8
 from yum.yumRepo import YumRepository
+from yum.packages import FakeRepository
 from yum.misc import to_xml
 import Errors
 
@@ -367,6 +368,8 @@ class UpdateMetadata(object):
                 if not md:
                     raise UpdateNoticeException()
                 infile = gzip.open(md)
+        elif isinstance(obj, FakeRepository):
+            raise Errors.RepoMDError, "No updateinfo for local pkg"
         else:   # obj is a file object
             infile = obj
 
commit ec84b2d2123937288d10975cbee74785aa1e5364
Author: James Antill <james at and.org>
Date:   Mon Apr 13 12:18:32 2009 -0400

    Remove i18n bytes from fake repo ids, fixes 495303

diff --git a/yum/packages.py b/yum/packages.py
index bc0f9cb..7ca88f9 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -163,8 +163,26 @@ class FakeSack:
             
 class FakeRepository:
     """Fake repository class for use in rpmsack package objects"""
+
+    def _set_cleanup_repoid(self, repoid):
+        """ Set the repoid, but because it can be random ... clean it up. """
+
+        #  We don't want repoids to contain random bytes that can be
+        # in the FS directories. It's also nice if they aren't "huge". So
+        # just chop to the rpm name.
+        repoid = os.path.basename(repoid)
+        if repoid.endswith(".rpm"):
+            repoid = repoid[:-4]
+
+        bytes = [] # Just in case someone uses mv to be evil:
+        for byte in repoid:
+            if ord(byte) >= 128:
+                byte = '?'
+            bytes.append(byte)
+        self.id = "/" + "".join(bytes)
+
     def __init__(self, repoid):
-        self.id = repoid
+        self._set_cleanup_repoid(repoid)
         self.sack = FakeSack()
 
     def __cmp__(self, other):
commit 3daa278a7205aa3ec2d11d21f5e7ad7942e25b1b
Author: James Antill <james at and.org>
Date:   Mon Apr 13 11:59:20 2009 -0400

    Add note about installonlyn and tokeep to man page

diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 3a03d6b..521ffed 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -108,7 +108,9 @@ kernel-bigmem, kernel-enterprise, kernel-debug, kernel-unsupported.
 
 .IP \fBinstallonly_limit \fR
 Number of packages listed in installonlypkgs to keep installed at the same
-time. Setting to 0 disables this feature. Default is '0'.
+time. Setting to 0 disables this feature. Default is '0'. Note that this
+functionality used to be in the "installonlyn" plugin, where this option was
+altered via. tokeep.
 
 .IP \fBkernelpkgnames \fR
 List of package names that are kernels. This is really only here for the
commit aeb59bee6dfbd551bbd1fda4a0b35bcf1c441282
Author: James Antill <james at and.org>
Date:   Mon Apr 13 11:58:58 2009 -0400

    Fix cost sorting of repos.

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 5204523..db3d44b 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -291,7 +291,7 @@ class YumRepository(Repository, config.RepoConf):
             ocost = 1000
         ret = cmp(self.cost, ocost)
         if ret:
-            return 1
+            return ret
         return cmp(self.id, other.id)
 
     def _getSack(self):
commit c43367f03da96c9629d3fe1ec9951129293b2357
Author: James Antill <james at and.org>
Date:   Thu Apr 9 11:36:07 2009 -0400

    Add text to tell the user how to get new mirrors

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index d9e2d77..5204523 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -755,6 +755,9 @@ class YumRepository(Repository, config.RepoConf):
                                     )
             except URLGrabError, e:
                 errstr = "failed to retrieve %s from %s\nerror was %s" % (relative, self.id, e)
+                if self.mirrorurls:
+                    errstr +="\n  You could try running: yum clean expire-cache"
+                    errstr +="\n  To get a new set of mirrors."
                 if e.errno == 256:
                     raise Errors.NoMoreMirrorsRepoError, errstr
                 else:
commit e6da271447aad3dddd85542c99fb8fbba012f3b6
Author: James Antill <james at and.org>
Date:   Wed Apr 8 01:26:35 2009 -0400

    Document the groupid feature of grouplist

diff --git a/docs/yum.8 b/docs/yum.8
index 379169a..c8116ee 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -166,7 +166,8 @@ as "installed" if all mandatory packages are installed, or if a group doesn't
 have any mandatory packages then it is installed if any of the optional or
 default package are installed.
 The optional "hidden" argument will also list groups marked as not being
-"user visible".
+"user visible". If you pass the -v option, to enable verbose mode, then the
+groupid's are displayed.
 .IP 
 .IP "\fBgroupremove\fP"
 Is used to remove all of the pacakges in a group, unlike "groupinstall" this


More information about the Yum-commits mailing list