devel/yum yum-misc-fixes.patch,1.9,1.10

Jeremy Katz (katzj) fedora-extras-commits at redhat.com
Wed Sep 26 18:54:39 UTC 2007


Author: katzj

Update of /cvs/pkgs/devel/yum
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv19508

Added Files:
	yum-misc-fixes.patch 
Log Message:
add the patch

yum-misc-fixes.patch:

Index: yum-misc-fixes.patch
===================================================================
RCS file: yum-misc-fixes.patch
diff -N yum-misc-fixes.patch
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ yum-misc-fixes.patch	26 Sep 2007 18:54:34 -0000	1.10
@@ -0,0 +1,152 @@
+diff --git a/cli.py b/cli.py
+index 1fc0594..07a93c5 100644
+--- a/cli.py
++++ b/cli.py
+@@ -467,7 +467,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+                     my_inst_pkgs = []
+ 
+                 if my_inst_pkgs:
+-                    self.verbose_logger.log(yum.logginglevels.DEBUG_3,
++                    self.verbose_logger.log(yum.logginglevels.INFO_2,
+                         'Requested dep: %s is provided by installed package', str(arg))
+                     
+                     continue # we don't need to look, we have it
+@@ -490,6 +490,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+                         
+             installable = yum.misc.unique(exactmatch + matched)
+             exactarchlist = self.conf.exactarchlist
++
++            if len(installable) == 0:
++                self.verbose_logger.log(yum.logginglevels.INFO_2,
++                                        'No package %s available.', arg)
+             
+             # we look through each returned possibility and rule out the
+             # ones that we obviously can't use
+diff --git a/output.py b/output.py
+index 0f5eb5a..8aff587 100644
+--- a/output.py
++++ b/output.py
+@@ -21,6 +21,8 @@ import sys
+ import time
+ import logging
+ import types
++import gettext
++import rpm
+ from i18n import _
+ 
+ from urlgrabber.progress import TextMeter
+@@ -42,6 +44,10 @@ class YumOutput:
+     def __init__(self):
+         self.logger = logging.getLogger("yum.cli")
+         self.verbose_logger = logging.getLogger("yum.verbose.cli")
++        if hasattr(rpm, "expandMacro"):
++            self.i18ndomains = rpm.expandMacro("%_i18ndomains").split(":")
++        else:
++            self.i18ndomains = ["redhat-dist"]
+     
+     def printtime(self):
+         months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
+@@ -71,11 +77,16 @@ class YumOutput:
+         
+     def infoOutput(self, pkg):
+         def enc(s):
+-            # this sucks.  what we get back from the rpmdb
+-            # are strings, but they may actually have unicode so we
+-            # can't encode them
++            """Get the translated version from specspo and ensure that
++            it's actually encoded in UTF-8."""
+             if type(s) == unicode:
+-                return s.encode("UTF-8")
++                s = s.encode("UTF-8")
++            if len(s) > 0:
++                for d in self.i18ndomains:
++                    t = gettext.dgettext(d, s)
++                    if t != s:
++                        s = t
++                        break
+             return s
+         print _("Name   : %s") % pkg.name
+         print _("Arch   : %s") % pkg.arch
+@@ -495,7 +506,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
+                 self.lastmsg = msg
+             if te_current == te_total:
+                 print " "
+-        
++
+     def _makefmt(self, percent, ts_current, ts_total, progress = True):
+         l = len(str(ts_total))
+         size = "%s.%s" % (l, l)
+diff --git a/yum/__init__.py b/yum/__init__.py
+index 39121e2..ee31ae1 100644
+--- a/yum/__init__.py
++++ b/yum/__init__.py
+@@ -365,7 +365,7 @@ class YumBase(depsolve.Depsolve):
+             return self._pkgSack
+         
+         if thisrepo is None:
+-            repos = self.repos.listEnabled()
++            repos = 'enabled'
+         else:
+             repos = self.repos.findRepos(thisrepo)
+         
+@@ -385,7 +385,8 @@ class YumBase(depsolve.Depsolve):
+         self.excludePackages()
+         self._pkgSack.excludeArchs(archlist)
+         
+-        #FIXME - this could be faster, too.
++        if repos == 'enabled':
++            repos = self.repos.listEnabled()
+         for repo in repos:
+             self.excludePackages(repo)
+             self.includePackages(repo)
+diff --git a/yum/depsolve.py b/yum/depsolve.py
+index 4075116..08693eb 100644
+--- a/yum/depsolve.py
++++ b/yum/depsolve.py
+@@ -707,7 +707,7 @@ class Depsolve(object):
+             while CheckDeps:
+                 self.cheaterlookup = {}
+                 if self.dsCallback: self.dsCallback.tscheck()
+-                CheckDeps, checkremoves, checkinstalls, missing = self._resolveRequires(errors)
++                CheckDeps, checkinstalls, checkremoves, missing = self._resolveRequires(errors)
+                 CheckInstalls |= checkinstalls
+                 CheckRemoves |= checkremoves
+ 
+diff --git a/yum/packages.py b/yum/packages.py
+index d11816e..5be3722 100644
+--- a/yum/packages.py
++++ b/yum/packages.py
+@@ -628,7 +628,7 @@ class YumHeaderPackage(YumAvailablePackage):
+         self.description = self.hdr['description']
+         self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
+         if not self.pkgid:
+-            self.pkgid = self.hdr[rpm.RPMTAG_SIGMD5]
++            self.pkgid = "%s.%s" %(self.hdr['name'], self.hdr['buildtime'])
+         self.packagesize = self.hdr['size']
+         self.__mode_cache = {}
+         self.__prcoPopulated = False
+diff --git a/yum/yumRepo.py b/yum/yumRepo.py
+index 48ec521..8b8793f 100644
+--- a/yum/yumRepo.py
++++ b/yum/yumRepo.py
+@@ -665,6 +665,9 @@ class YumRepository(Repository, config.RepoConf):
+            file. If any of them are newer then invalidate the cache
+            """
+ 
++        # -1 is special and should never get refreshed
++        if expiration_time == -1 and os.path.exists(myfile):
++            return True
+         val = False
+         if os.path.exists(myfile):
+             cookie_info = os.stat(myfile)
+@@ -701,7 +704,9 @@ class YumRepository(Repository, config.RepoConf):
+             self.dirSetup()
+         except Errors.RepoError, e:
+             raise
+-
++        if not self.mediafunc and self.mediaid and not self.mirrorlist and not self.baseurl:
++            verbose_logger.log(logginglevels.DEBUG_2, "Disabling media repo for non-media-aware frontend")
++            self.enabled = False
+ 
+     def _loadRepoXML(self, text=None):
+         """retrieve/check/read in repomd.xml from the repository"""




More information about the fedora-extras-commits mailing list