rpms/yum/devel yum-6hr-metadata_expire.patch, NONE, 1.1 yum-HEAD.patch, 1.6, 1.7 yum.spec, 1.232, 1.233

James Antill james at fedoraproject.org
Thu Dec 18 20:42:59 UTC 2008


Author: james

Update of /cvs/pkgs/rpms/yum/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9136

Modified Files:
	yum-HEAD.patch yum.spec 
Added Files:
	yum-6hr-metadata_expire.patch 
Log Message:
* Thu Dec 18 2008 James Antill <james at fedoraproject.org> - 3.2.20-8
- merge latest from upstream
- move to 6hr metadata


yum-6hr-metadata_expire.patch:

--- NEW FILE yum-6hr-metadata_expire.patch ---
diff --git a/yum/config.py b/yum/config.py
index 2219605..13efd9e 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -653,7 +653,7 @@ class YumConf(StartupConf):
     #  Time in seconds (1.5h), yum-updatesd runs once per. hour by default
     # this time means we don't do interactive network checks/updates if
     # yum-updatesd is running.
-    metadata_expire = SecondsOption(60 * 90)
+    metadata_expire = SecondsOption(60 * 60 * 6) # 6 hours
     mirrorlist_expire = SecondsOption(86400) # time in seconds (1 day)
     rpm_check_debug = BoolOption(True)
     disable_excludes = ListOption()    

yum-HEAD.patch:

View full diff with command:
/usr/bin/cvs -f diff  -kk -u -N -r 1.6 -r 1.7 yum-HEAD.patch
Index: yum-HEAD.patch
===================================================================
RCS file: /cvs/pkgs/rpms/yum/devel/yum-HEAD.patch,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- yum-HEAD.patch	8 Dec 2008 16:18:54 -0000	1.6
+++ yum-HEAD.patch	18 Dec 2008 20:42:58 -0000	1.7
@@ -253,18 +253,19 @@
 diff --git a/output.py b/output.py
 old mode 100644
 new mode 100755
-index 502aa4b..b6bd005
+index 502aa4b..3416459
 --- a/output.py
 +++ b/output.py
-@@ -39,6 +39,7 @@ from yum.rpmtrans import RPMBaseCallback
+@@ -38,7 +38,7 @@ from yum import logginglevels, _
+ from yum.rpmtrans import RPMBaseCallback
  from yum.packageSack import packagesNewestByNameArch
  
- from textwrap import fill
-+from yum.i18n import utf8_width, utf8_width_fill
+-from textwrap import fill
++from yum.i18n import utf8_width, utf8_width_fill, utf8_text_fill
  
  def _term_width():
      """ Simple terminal width, limit to 20 chars. and make 0 == 80. """
-@@ -75,42 +76,7 @@ class YumTerm:
+@@ -75,42 +75,7 @@ class YumTerm:
      __enabled = True
  
      if hasattr(urlgrabber.progress, 'terminal_width_cached'):
@@ -308,7 +309,7 @@
  
      __cap_names = {
          'underline' : 'smul',
-@@ -138,8 +104,90 @@ class YumTerm:
+@@ -138,8 +103,90 @@ class YumTerm:
          'cyan' : 6,
          'white' : 7
          }
@@ -400,7 +401,7 @@
          # Curses isn't available on all platforms
          try:
              import curses
-@@ -165,7 +213,7 @@ class YumTerm:
+@@ -165,7 +212,7 @@ class YumTerm:
  
          if not hasattr(urlgrabber.progress, 'terminal_width_cached'):
              self.columns = curses.tigetnum('cols')
@@ -409,7 +410,7 @@
          
          # Look up string capabilities.
          for cap_name in self.MODE:
-@@ -192,6 +240,9 @@ class YumTerm:
+@@ -192,6 +239,9 @@ class YumTerm:
              for (color, val) in self.__ansi_colors.items():
                  self.BG_COLOR[color] = curses.tparm(set_bg_ansi, val) or ''
  
@@ -419,7 +420,7 @@
      def _tigetstr(self, cap_name):
          # String capabilities can include "delays" of the form "$<2>".
          # For any modern terminal, we should be able to just ignore
-@@ -199,7 +250,7 @@ class YumTerm:
+@@ -199,7 +249,7 @@ class YumTerm:
          cap = self._ctigetstr(cap_name) or ''
          return re.sub(r'\$<\d+>[/*]?', '', cap)
  
@@ -428,7 +429,7 @@
          if not self.__enabled:
              return haystack
  
-@@ -208,7 +259,10 @@ class YumTerm:
+@@ -208,7 +258,10 @@ class YumTerm:
  
          render = lambda match: beg + match.group() + end
          for needle in needles:
@@ -440,7 +441,7 @@
          return haystack
      def sub_norm(self, haystack, beg, needles, **kwds):
          return self.sub(haystack, beg, self.MODE['normal'], needles, **kwds)
-@@ -217,7 +271,7 @@ class YumTerm:
+@@ -217,7 +270,7 @@ class YumTerm:
          return self.sub_norm(haystack, self.MODE[mode], needles, **kwds)
  
      def sub_bold(self, haystack, needles, **kwds):
@@ -449,7 +450,7 @@
      
      def sub_fg(self, haystack, color, needles, **kwds):
          return self.sub_norm(haystack, self.FG_COLOR[color], needles, **kwds)
-@@ -263,14 +317,39 @@ class YumOutput:
+@@ -263,14 +316,39 @@ class YumOutput:
          progressbar(current, total, name)
  
      def _highlight(self, highlight):
@@ -493,7 +494,7 @@
      @staticmethod
      def _calc_columns_spaces_helps(current, data_tups, left):
          """ Spaces left on the current field will help how many pkgs? """
-@@ -299,7 +378,7 @@ class YumOutput:
+@@ -299,7 +377,7 @@ class YumOutput:
          if columns is None:
              columns = [1] * cols
  
@@ -502,7 +503,7 @@
          while total_width > 0:
              # Find which field all the spaces left will help best
              helps = 0
-@@ -339,28 +418,45 @@ class YumOutput:
+@@ -339,28 +417,45 @@ class YumOutput:
              return (u"-", -width)
          return (u"", width)
  
@@ -555,7 +556,7 @@
          data.append(val)
          return msg % tuple(data)
  
-@@ -370,12 +466,10 @@ class YumOutput:
+@@ -370,12 +465,10 @@ class YumOutput:
  
          if columns is None:
              columns = (-40, -22, -16) # Old default
@@ -570,7 +571,7 @@
          print self.fmtColumns(columns)
  
      def simpleEnvraList(self, pkg, ui_overflow=False,
-@@ -385,17 +479,15 @@ class YumOutput:
+@@ -385,31 +478,30 @@ class YumOutput:
  
          if columns is None:
              columns = (-63, -16) # Old default
@@ -590,8 +591,19 @@
 +        keylen = utf8_width(key)
          cols = self.term.columns
          nxt = ' ' * (keylen - 2) + ': '
-         ret = fill(val, width=cols,
-@@ -409,7 +501,7 @@ class YumOutput:
+-        ret = fill(val, width=cols,
+-                   initial_indent=key, subsequent_indent=nxt)
++        ret = utf8_text_fill(val, width=cols,
++                             initial_indent=key, subsequent_indent=nxt)
+         if ret.count("\n") > 1 and keylen > (cols / 3):
+             # If it's big, redo it again with a smaller subsequent off
+-            ret = fill(val, width=cols,
+-                       initial_indent=key, subsequent_indent='     ...: ')
++            ret = utf8_text_fill(val, width=cols,
++                                 initial_indent=key,
++                                 subsequent_indent='     ...: ')
+         return ret
+     
      def fmtSection(self, name, fill='='):
          name = to_str(name)
          cols = self.term.columns - 2
@@ -696,7 +708,38 @@
                                           columns=columns)
      
      def displayPkgsInGroups(self, group):
-@@ -686,7 +790,8 @@ class YumOutput:
+@@ -659,18 +763,15 @@ class YumOutput:
+     
+         thresh = 999
+         depth = 0
++        max_depth = len(symbols) - 1
+     
+-        # we want numbers between 
+-        while number > thresh:
++        # we want numbers between 0 and thresh, but don't exceed the length
++        # of our list.  In that event, the formatting will be screwed up,
++        # but it'll still show the right number.
++        while number > thresh and depth < max_depth:
+             depth  = depth + 1
+             number = number / step
+     
+-        # just in case someone needs more than 1000 yottabytes!
+-        diff = depth - len(symbols) + 1
+-        if diff > 0:
+-            depth = depth - diff
+-            number = number * thresh**depth
+-    
+         if type(number) == type(1) or type(number) == type(1L):
+             format = '%i%s%s'
+         elif number < 9.95:
+@@ -680,13 +781,14 @@ class YumOutput:
+         else:
+             format = '%.0f%s%s'
+     
+-        return(format % (number, space, symbols[depth]))
++        return(format % (float(number or 0), space, symbols[depth]))
+ 
+     @staticmethod
      def format_time(seconds, use_hours=0):
          return urlgrabber.progress.format_time(seconds, use_hours)
  
@@ -706,7 +749,7 @@
          """ Output search/provides type callback matches. po is the pkg object,
              values are the things in the po that we've matched.
              If matchfor is passed, all the strings in that list will be
-@@ -699,7 +804,9 @@ class YumOutput:
+@@ -699,7 +801,9 @@ class YumOutput:
[...3860 lines suppressed...]
+@@ -40,6 +40,7 @@ except ImportError:
+             raise ValueError, "Bad checksum type"
+ 
+ from Errors import MiscError
++from i18n import to_unicode, to_unicode_maybe, to_utf8, to_str
+ 
+ _share_data_store   = {}
+ _share_data_store_u = {}
+@@ -177,15 +178,14 @@ class Checksums:
          Length and the result(s) when complete. """
  
      def __init__(self, checksums=None, ignore_missing=False):
@@ -20288,7 +20734,7 @@
              if sumtype in done:
                  continue
  
-@@ -198,6 +197,8 @@ class Checksums:
+@@ -198,6 +198,8 @@ class Checksums:
              done.add(sumtype)
              self._sumtypes.append(sumtype)
              self._sumalgos.append(sumalgo)
@@ -20297,7 +20743,7 @@
  
      def __len__(self):
          return self._len
-@@ -218,9 +219,22 @@ class Checksums:
+@@ -218,9 +220,22 @@ class Checksums:
              ret[sumtype] = sumdata.hexdigest()
          return ret
  
@@ -20321,6 +20767,41 @@
  
  class AutoFileChecksums:
      """ Generate checksum(s), on given file/fileobject. Pretending to be a file
+@@ -763,34 +778,6 @@ def setup_locale(override_codecs=True, override_time=False):
+         sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
+         sys.stdout.errors = 'replace'
+ 
+-def to_unicode(obj, encoding='utf-8', errors='replace'):
+-    ''' convert a 'str' to 'unicode' '''
+-    if isinstance(obj, basestring):
+-        if not isinstance(obj, unicode):
+-            obj = unicode(obj, encoding, errors)
+-    return obj
+-
+-def to_utf8(obj, errors='replace'):
+-    '''convert 'unicode' to an encoded utf-8 byte string '''
+-    if isinstance(obj, unicode):
+-        obj = obj.encode('utf-8', errors)
+-    return obj
+-
+-# Don't use this, to_unicode should just work now
+-def to_unicode_maybe(obj, encoding='utf-8', errors='replace'):
+-    ''' Don't ask don't tell, only use when you must '''
+-    try:
+-        return to_unicode(obj, encoding, errors)
+-    except UnicodeEncodeError:
+-        return obj
+-
+-def to_str(obj):
+-    """ Convert something to a string, if it isn't one. """
+-    # NOTE: unicode counts as a string just fine. We just want objects to call
+-    # their __str__ methods.
+-    if not isinstance(obj, basestring):
+-        obj = str(obj)
+-    return obj
+ 
+ def get_my_lang_code():
+     mylang = locale.getlocale()
 diff --git a/yum/packages.py b/yum/packages.py
 index 48dfc8d..acfb9f0 100644
 --- a/yum/packages.py
@@ -20336,6 +20817,83 @@
          self.description = misc.share_data(self.hdr['description'])
          self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
          if not self.pkgid:
+diff --git a/yum/parser.py b/yum/parser.py
+index ca5a068..4f297c3 100644
+--- a/yum/parser.py
++++ b/yum/parser.py
+@@ -58,6 +58,9 @@ class ConfigPreProcessor:
+     def __init__(self, configfile, vars=None):
+         # put the vars away in a helpful place
+         self._vars = vars
++
++        # used to track the current ini-section
++        self._section = None
+         
+         # set some file-like object attributes for ConfigParser
+         # these just make confpp look more like a real file object.
+@@ -129,6 +132,10 @@ class ConfigPreProcessor:
+                         # whooohoo a valid include line.. push it on the stack
+                         fo = self._pushfile( url )
+                 else:
++                    # check if the current line starts a new section
++                    secmatch = re.match( r'\s*\[(?P<section>.*)\]', line )
++                    if secmatch:
++			self._section = secmatch.group('section')
+                     # line didn't match include=, just return it as is
+                     # for the ConfigParser
+                     break
+@@ -156,8 +163,7 @@ class ConfigPreProcessor:
+             return url
+         else:
+             return urlparse.urljoin( self.geturl(), url )
+-    
+-    
++
+     def _pushfile( self, url ):
+         """
+         Opens the url specified, pushes it on the stack, and 
+@@ -169,8 +175,12 @@ class ConfigPreProcessor:
+         # absolutize this url using the including files url
+         # as a base url.
+         absurl = self._absurl(url)
++
++        # get the current section to add it to the included
++        # url's name.
++        includetuple = (absurl, self._section)
+         # check if this has previously been included.
+-        if self._urlalreadyincluded(absurl):
++        if self._isalreadyincluded(includetuple):
+             return None
+         try:
+             fo = urlgrabber.grabber.urlopen(absurl)
+@@ -179,7 +189,7 @@ class ConfigPreProcessor:
+         if fo is not None:
+             self.name = absurl
+             self._incstack.append( fo )
+-            self._alreadyincluded.append(absurl)
++            self._alreadyincluded.append(includetuple)
+         else:
+             raise Errors.ConfigError, \
+                   'Error accessing file for config %s' % (absurl)
+@@ -199,13 +209,13 @@ class ConfigPreProcessor:
+             self.name = None
+     
+     
+-    def _urlalreadyincluded( self, url ):
++    def _isalreadyincluded( self, tuple ):
+         """
+-        Checks if the url has already been included at all.. this 
+-        does not necessarily have to be recursive
++        Checks if the tuple describes an include that was already done.
++        This does not necessarily have to be recursive
+         """
+-        for eurl in self._alreadyincluded:
+-            if eurl == url: return 1
++        for etuple in self._alreadyincluded:
++            if etuple == tuple: return 1
+         return 0
+     
+     
 diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
 index 35a7801..04ab346 100644
 --- a/yum/pgpmsg.py
@@ -20444,9 +21002,18 @@
              self._changelog = result
              return
 diff --git a/yum/update_md.py b/yum/update_md.py
-index b1d7388..25613e9 100644
+index b1d7388..a2b2008 100644
 --- a/yum/update_md.py
 +++ b/yum/update_md.py
+@@ -24,7 +24,7 @@ Update metadata (updateinfo.xml) parsing.
+ import sys
+ import gzip
+ 
+-from textwrap import wrap
++from yum.i18n import utf8_text_wrap
+ from yum.yumRepo import YumRepository
+ from yum.misc import to_xml
+ 
 @@ -95,7 +95,7 @@ class UpdateNotice(object):
              for bz in bzs:
                  buglist += " %s%s\n\t    :" % (bz['id'], bz.has_key('title')
@@ -20456,7 +21023,7 @@
  
          # Add our CVE references
          cves = filter(lambda r: r['type'] == 'cve', self._md['references'])
-@@ -103,7 +103,7 @@ class UpdateNotice(object):
+@@ -103,11 +103,11 @@ class UpdateNotice(object):
              cvelist = "       CVEs :"
              for cve in cves:
                  cvelist += " %s\n\t    :" % cve['id']
@@ -20464,7 +21031,13 @@
 +            head += cvelist[: - 1].rstrip() + '\n'
  
          if self._md['description'] is not None:
-             desc = wrap(self._md['description'], width=64,
+-            desc = wrap(self._md['description'], width=64,
+-                        subsequent_indent=' ' * 12 + ': ')
++            desc = utf8_text_wrap(self._md['description'], width=64,
++                                  subsequent_indent=' ' * 12 + ': ')
+             head += "Description : %s\n" % '\n'.join(desc)
+ 
+         #  Get a list of arches we care about:
 @@ -119,7 +119,7 @@ class UpdateNotice(object):
                  if file['arch'] not in arches:
                      continue


Index: yum.spec
===================================================================
RCS file: /cvs/pkgs/rpms/yum/devel/yum.spec,v
retrieving revision 1.232
retrieving revision 1.233
diff -u -r1.232 -r1.233
--- yum.spec	8 Dec 2008 16:18:55 -0000	1.232
+++ yum.spec	18 Dec 2008 20:42:59 -0000	1.233
@@ -3,7 +3,7 @@
 Summary: RPM installer/updater
 Name: yum
 Version: 3.2.20
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2+
 Group: System Environment/Base
 Source0: http://yum.baseurl.org/download/3.2/%{name}-%{version}.tar.gz
@@ -13,6 +13,7 @@
 Patch1: yum-mirror-priority.patch
 Patch2: yum-manpage-files.patch
 Patch3: yum-multilib-policy-best.patch
+Patch4: yum-6hr-metadata_expire.patch
 
 # Patches from 3.2.X HEAD
 Patch101: yum-HEAD.patch
@@ -59,6 +60,8 @@
 %patch2 -p0
 %patch3 -p0
 
+%patch4 -p1
+
 %patch101 -p1
 
 %build
@@ -108,6 +111,10 @@
 %dir /usr/lib/yum-plugins
 
 %changelog
+* Thu Dec 18 2008 James Antill <james at fedoraproject.org> - 3.2.20-8
+- merge latest from upstream
+- move to 6hr metadata
+
 * Mon Dec  8 2008 Seth Vidal <skvidal at fedoraproject.org> - 3.2.20-7
 - merge patch from upstream and remove now old obsoletes patch
 




More information about the fedora-extras-commits mailing list