rpms/yum/devel yum-big-head.patch,1.5,1.6 yum.spec,1.211,1.212
Seth Vidal (skvidal)
fedora-extras-commits at redhat.com
Wed Apr 16 11:54:18 UTC 2008
Author: skvidal
Update of /cvs/extras/rpms/yum/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28791
Modified Files:
yum-big-head.patch yum.spec
Log Message:
actually add the patch
yum-big-head.patch:
Index: yum-big-head.patch
===================================================================
RCS file: /cvs/extras/rpms/yum/devel/yum-big-head.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- yum-big-head.patch 15 Apr 2008 13:12:08 -0000 1.5
+++ yum-big-head.patch 16 Apr 2008 11:54:08 -0000 1.6
@@ -24,7 +24,7 @@
class RPMInstallCallback:
diff --git a/cli.py b/cli.py
-index 741fcc7..0454c9a 100644
+index 741fcc7..9d093c1 100644
--- a/cli.py
+++ b/cli.py
@@ -40,11 +40,13 @@ import rpmUtils.arch
@@ -59,7 +59,81 @@
matching = self.searchGenerator(searchlist, args,
showdups=dups, keys=True)
-@@ -896,11 +899,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -801,20 +804,21 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+ uservisible=0
+
+ installed, available = self.doGroupLists(uservisible=uservisible)
+-
++ mylang = yum.misc.get_my_lang_code()
++
+ if len(installed) > 0:
+ self.verbose_logger.log(yum.logginglevels.INFO_2,
+ _('Installed Groups:'))
+ for group in installed:
+ self.verbose_logger.log(yum.logginglevels.INFO_2, ' %s',
+- group.name)
++ group.nameByLang(mylang))
+
+ if len(available) > 0:
+ self.verbose_logger.log(yum.logginglevels.INFO_2,
+ _('Available Groups:'))
+ for group in available:
+ self.verbose_logger.log(yum.logginglevels.INFO_2, ' %s',
+- group.name)
++ group.nameByLang(mylang))
+
+
+ return 0, [_('Done')]
+@@ -822,10 +826,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+ def returnGroupInfo(self, userlist):
+ """returns complete information on a list of groups"""
+ for strng in userlist:
+- group = self.comps.return_group(strng)
+- if group:
++ group_matched = False
++ for group in self.comps.return_groups(strng):
+ self.displayPkgsInGroups(group)
+- else:
++ group_matched = True
++
++ if not group_matched:
+ self.logger.error(_('Warning: Group %s does not exist.'), strng)
+
+ return 0, []
+@@ -836,18 +842,22 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+ pkgs_used = []
+
+ for group_string in grouplist:
+- group = self.comps.return_group(group_string)
+- if not group:
+- self.logger.critical(_('Warning: Group %s does not exist.'), group_string)
+- continue
++ group_matched = False
++ for group in self.comps.return_groups(group_string):
++ group_matched = True
++
+
+- try:
+- txmbrs = self.selectGroup(group.groupid)
+- except yum.Errors.GroupsError:
+- self.logger.critical(_('Warning: Group %s does not exist.'), group_string)
++ try:
++ txmbrs = self.selectGroup(group.groupid)
++ except yum.Errors.GroupsError:
++ self.logger.critical(_('Warning: Group %s does not exist.'), group_string)
++ continue
++ else:
++ pkgs_used.extend(txmbrs)
++
++ if not group_matched:
++ self.logger.error(_('Warning: Group %s does not exist.'), group_strng)
+ continue
+- else:
+- pkgs_used.extend(txmbrs)
+
+ if not pkgs_used:
+ return 0, [_('No packages in any requested group available to install or update')]
+@@ -896,11 +906,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
def usage(self):
''' Print out command line usage '''
@@ -73,7 +147,7 @@
def _installable(self, pkg, ematch=False):
-@@ -1088,6 +1091,10 @@ class YumOptionParser(OptionParser):
+@@ -1088,6 +1098,10 @@ class YumOptionParser(OptionParser):
root = '/'
return root
@@ -84,7 +158,7 @@
def _addYumBasicOptions(self):
def repo_optcb(optobj, opt, value, parser):
'''Callback for the enablerepo and disablerepo option.
-@@ -1098,7 +1105,16 @@ class YumOptionParser(OptionParser):
+@@ -1098,7 +1112,16 @@ class YumOptionParser(OptionParser):
dest = eval('parser.values.%s' % optobj.dest)
dest.append((opt, value))
@@ -102,7 +176,7 @@
self.add_option("-t", "--tolerant", action="store_true",
help=_("be tolerant of errors"))
self.add_option("-C", dest="cacheonly", action="store_true",
-@@ -1119,7 +1135,7 @@ class YumOptionParser(OptionParser):
+@@ -1119,7 +1142,7 @@ class YumOptionParser(OptionParser):
self.add_option("-q", "--quiet", dest="quiet", action="store_true",
help=_("quiet operation"))
self.add_option("-v", "--verbose", dest="verbose", action="store_true",
@@ -111,8 +185,19 @@
self.add_option("-y", dest="assumeyes", action="store_true",
help=_("answer yes for all questions"))
self.add_option("--version", action="store_true",
+diff --git a/etc/yum.logrotate b/etc/yum.logrotate
+index 1e28f64..e587f96 100644
+--- a/etc/yum.logrotate
++++ b/etc/yum.logrotate
+@@ -2,5 +2,6 @@
+ missingok
+ notifempty
+ size 30k
++ yearly
+ create 0600 root root
+ }
diff --git a/output.py b/output.py
-index 532a06e..cc80301 100644
+index 532a06e..c0cbb02 100644
--- a/output.py
+++ b/output.py
@@ -23,13 +23,13 @@ import logging
@@ -127,7 +212,7 @@
from urlgrabber.progress import TextMeter
from urlgrabber.grabber import URLGrabError
-from yum.misc import sortPkgObj, prco_tuple_to_string
-+from yum.misc import sortPkgObj, prco_tuple_to_string, to_str, to_unicode_maybe
++from yum.misc import sortPkgObj, prco_tuple_to_string, to_str, to_unicode_maybe, get_my_lang_code
from rpmUtils.miscutils import checkSignals
from yum.constants import *
@@ -162,8 +247,17 @@
except:
choice = ''
choice = choice.lower()
-@@ -370,21 +372,22 @@ class YumOutput:
- print _(' Description: %s') % group.description.encode("UTF-8")
+@@ -365,26 +367,28 @@ class YumOutput:
+
+
+ def displayPkgsInGroups(self, group):
+- print _('\nGroup: %s') % group.name
+- if group.description != "":
+- print _(' Description: %s') % group.description.encode("UTF-8")
++ mylang = get_my_lang_code()
++ print _('\nGroup: %s') % group.nameByLang(mylang)
++ if group.descriptionByLang(mylang) != "":
++ print _(' Description: %s') % to_unicode_maybe(group.descriptionByLang(mylang))
if len(group.mandatory_packages) > 0:
print _(' Mandatory Packages:')
- for item in group.mandatory_packages:
@@ -188,7 +282,7 @@
for item, cond in group.conditional_packages.iteritems():
print ' %s' % (item,)
-@@ -747,7 +750,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -747,7 +751,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
fmt = self._makefmt(percent, ts_current, ts_total)
msg = fmt % (process, pkgname)
if msg != self.lastmsg:
@@ -197,7 +291,7 @@
sys.stdout.flush()
self.lastmsg = msg
if te_current == te_total:
-@@ -755,7 +758,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -755,7 +759,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
def scriptout(self, package, msgs):
if msgs:
@@ -8790,10 +8884,10 @@
res, msg = self.runOperation(['update', 'bar'], [p.required, p.installed_noarch],
diff --git a/test/yum-release-i18n-test.sh b/test/yum-release-i18n-test.sh
new file mode 100755
-index 0000000..8faa387
+index 0000000..8e4eaca
--- /dev/null
+++ b/test/yum-release-i18n-test.sh
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,151 @@
+#!/bin/bash -e
+
+#######################################################
@@ -8846,28 +8940,28 @@
+ echo $beg_hdr
+ echo "Doing: LANG=$lang yum --enablerepo=development $@"
+ echo $end_hdr
-+ LANG=$lang yum --enablerepo=development $@
++ LANG=$lang yum --enablerepo=development "$@"
+}
+scmd()
+{
+ echo $beg_hdr
+ echo "Doing: LANG=$lang $SUDO_CMD yum $@"
+ echo $end_hdr
-+ LANG=$lang $SUDO_CMD yum $@
++ LANG=$lang $SUDO_CMD yum "$@"
+}
+lcmd()
+{
+ $LIVNA && echo $beg_hdr
+ $LIVNA && echo "Doing: LANG=$lang yum --enablerepo=livna $@"
+ $LIVNA && echo $end_hdr
-+ $LIVNA && LANG=$lang yum --enablerepo=livna $@
++ $LIVNA && LANG=$lang yum --enablerepo=livna "$@"
+}
+lscmd()
+{
+ $LIVNA && echo $beg_hdr
+ $LIVNA && echo "Doing: LANG=$lang $SUDO_CMD yum --enablerepo=livna $@"
+ $LIVNA && echo $end_hdr
-+ $LIVNA && LANG=$lang $SUDO_CMD yum --enablerepo=livna $@
++ $LIVNA && LANG=$lang $SUDO_CMD yum --enablerepo=livna "$@"
+}
+
+tst()
@@ -8881,6 +8975,22 @@
+ cmd info afflib libselinux linux $PKG_BAD ¶
+ cmd info afflib libselinux linux $PKG_BAD ¶ | cat
+
++ cmd grouplist
++ cmd grouplist | cat
++ # Games and Entertainment joy
++ lcmd grouplist
++ lcmd grouplist | cat
++
++ cmd groupinfo 'Games and Entertainment'
++ cmd groupinfo 'Games and Entertainment' | cat
++ cmd groupinfo 'à¬àଳ à¬à¬¬à¬ ମନàରà¬àà¬à¬¨'
++ cmd groupinfo 'à¬àଳ à¬à¬¬à¬ ମନàରà¬àà¬à¬¨' | cat
++ # Games and Entertainment joy
++ lcmd groupinfo 'Games and Entertainment'
++ lcmd groupinfo 'Games and Entertainment' | cat
++ lcmd groupinfo 'à¬àଳ à¬à¬¬à¬ ମନàରà¬àà¬à¬¨'
++ lcmd groupinfo 'à¬àଳ à¬à¬¬à¬ ମନàରà¬àà¬à¬¨' | cat
++
+ $FULL_PKG_OUTPUT && cmd list
+ $FULL_PKG_OUTPUT && cmd list | cat
+ $FULL_PKG_OUTPUT && cmd info
@@ -8943,7 +9053,7 @@
import yum.plugins as plugins
diff --git a/yum/__init__.py b/yum/__init__.py
-index 270f79f..a4b9dd1 100644
+index 270f79f..6bde7b5 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -63,7 +63,7 @@ warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning)
@@ -8966,40 +9076,264 @@
if debuglevel != None:
startupconf.debuglevel = debuglevel
-@@ -759,11 +761,30 @@ class YumBase(depsolve.Depsolve):
- def runTransaction(self, cb):
- """takes an rpm callback object, performs the transaction"""
-
-+ def _tup2str(x):
-+ # Convert stuff like:
-+ # ('installing package FOO needs XMB on the Y filesystem',
-+ # (9, '/', 131633152L))
-+ if type(x) == type(tuple):
-+ return x[0]
-+ return x
-+
+@@ -762,10 +764,17 @@ class YumBase(depsolve.Depsolve):
self.plugins.run('pretrans')
errors = self.ts.run(cb.callback, '')
- if errors:
- errstring = '\n'.join(errors)
+- raise Errors.YumBaseError, errstring
+-
+ # ts.run() exit codes are, hmm, "creative": None means all ok, empty
+ # list means some errors happened in the transaction and non-empty
+ # list that there were errors preventing the ts from starting...
+ if errors is None:
+ pass
+ elif len(errors) == 0:
-+ errstring = _('Warning: errors occurred during transaction.')
-+ raise Errors.YumBaseError, errstring
++ errstring = _('Warning: scriptlet or other non-fatal errors occurred during transaction.')
++ self.verbose_logger.debug(errstring)
+ else:
-+ errstring = '\n'.join(map(_tup2str, errors))
-+ raise Errors.YumBaseError, errstring
++ raise Errors.YumBaseError, errors
+
-+ errstring = '\n'.join(map(_tup2str, errors))
- raise Errors.YumBaseError, errstring
-
if not self.conf.keepcache:
-@@ -2206,6 +2227,8 @@ class YumBase(depsolve.Depsolve):
+ self.cleanUsedHeadersPackages()
+
+@@ -1717,107 +1726,109 @@ class YumBase(depsolve.Depsolve):
+
+ txmbrs_used = []
+
+- thisgroup = self.comps.return_group(grpid)
+- if not thisgroup:
++ thesegroups = self.comps.return_groups(grpid)
++ if not thesegroups:
+ raise Errors.GroupsError, _("No Group named %s exists") % grpid
+
+- thisgroup.toremove = True
+- pkgs = thisgroup.packages
+- for pkg in thisgroup.packages:
+- txmbrs = self.remove(name=pkg)
+- txmbrs_used.extend(txmbrs)
+- for txmbr in txmbrs:
+- txmbr.groups.append(thisgroup.groupid)
+-
++ for thisgroup in thesegroups:
++ thisgroup.toremove = True
++ pkgs = thisgroup.packages
++ for pkg in thisgroup.packages:
++ txmbrs = self.remove(name=pkg)
++ txmbrs_used.extend(txmbrs)
++ for txmbr in txmbrs:
++ txmbr.groups.append(thisgroup.groupid)
++
+ return txmbrs_used
+
+ def groupUnremove(self, grpid):
+ """unmark any packages in the group from being removed"""
+
+
+- thisgroup = self.comps.return_group(grpid)
+- if not thisgroup:
++ thesegroups = self.comps.return_groups(grpid)
++ if not thesegroups:
+ raise Errors.GroupsError, _("No Group named %s exists") % grpid
+
+- thisgroup.toremove = False
+- pkgs = thisgroup.packages
+- for pkg in thisgroup.packages:
+- for txmbr in self.tsInfo:
+- if txmbr.po.name == pkg and txmbr.po.state in TS_INSTALL_STATES:
+- try:
+- txmbr.groups.remove(grpid)
+- except ValueError:
+- self.verbose_logger.log(logginglevels.DEBUG_1,
+- _("package %s was not marked in group %s"), txmbr.po,
+- grpid)
+- continue
+-
+- # if there aren't any other groups mentioned then remove the pkg
+- if len(txmbr.groups) == 0:
+- self.tsInfo.remove(txmbr.po.pkgtup)
++ for thisgroup in thesegroups:
++ thisgroup.toremove = False
++ pkgs = thisgroup.packages
++ for pkg in thisgroup.packages:
++ for txmbr in self.tsInfo:
++ if txmbr.po.name == pkg and txmbr.po.state in TS_INSTALL_STATES:
++ try:
++ txmbr.groups.remove(grpid)
++ except ValueError:
++ self.verbose_logger.log(logginglevels.DEBUG_1,
++ _("package %s was not marked in group %s"), txmbr.po,
++ grpid)
++ continue
++
++ # if there aren't any other groups mentioned then remove the pkg
++ if len(txmbr.groups) == 0:
++ self.tsInfo.remove(txmbr.po.pkgtup)
+
+
+ def selectGroup(self, grpid):
+ """mark all the packages in the group to be installed
+ returns a list of transaction members it added to the transaction
+ set"""
+-
+- txmbrs_used = []
+-
++
+ if not self.comps.has_group(grpid):
+ raise Errors.GroupsError, _("No Group named %s exists") % grpid
+-
+- thisgroup = self.comps.return_group(grpid)
+
+- if not thisgroup:
++ txmbrs_used = []
++ thesegroups = self.comps.return_groups(grpid)
++
++ if not thesegroups:
+ raise Errors.GroupsError, _("No Group named %s exists") % grpid
+-
+- if thisgroup.selected:
+- return txmbrs_used
+-
+- thisgroup.selected = True
+-
+- pkgs = []
+- if 'mandatory' in self.conf.group_package_types:
+- pkgs.extend(thisgroup.mandatory_packages)
+- if 'default' in self.conf.group_package_types:
+- pkgs.extend(thisgroup.default_packages)
+- if 'optional' in self.conf.group_package_types:
+- pkgs.extend(thisgroup.optional_packages)
+
+- for pkg in pkgs:
+- self.verbose_logger.log(logginglevels.DEBUG_2,
+- _('Adding package %s from group %s'), pkg, thisgroup.groupid)
+- try:
+- txmbrs = self.install(name = pkg)
+- except Errors.InstallError, e:
+- self.verbose_logger.debug(_('No package named %s available to be installed'),
+- pkg)
+- else:
+- txmbrs_used.extend(txmbrs)
+- for txmbr in txmbrs:
+- txmbr.groups.append(thisgroup.groupid)
+-
+- if self.conf.enable_group_conditionals:
+- for condreq, cond in thisgroup.conditional_packages.iteritems():
+- if self.isPackageInstalled(cond):
+- try:
+- txmbrs = self.install(name = condreq)
+- except Errors.InstallError:
+- # we don't care if the package doesn't exist
+- continue
++ for thisgroup in thesegroups:
++ if thisgroup.selected:
++ continue
++
++ thisgroup.selected = True
++
++ pkgs = []
++ if 'mandatory' in self.conf.group_package_types:
++ pkgs.extend(thisgroup.mandatory_packages)
++ if 'default' in self.conf.group_package_types:
++ pkgs.extend(thisgroup.default_packages)
++ if 'optional' in self.conf.group_package_types:
++ pkgs.extend(thisgroup.optional_packages)
++
++ for pkg in pkgs:
++ self.verbose_logger.log(logginglevels.DEBUG_2,
++ _('Adding package %s from group %s'), pkg, thisgroup.groupid)
++ try:
++ txmbrs = self.install(name = pkg)
++ except Errors.InstallError, e:
++ self.verbose_logger.debug(_('No package named %s available to be installed'),
++ pkg)
++ else:
+ txmbrs_used.extend(txmbrs)
+ for txmbr in txmbrs:
+ txmbr.groups.append(thisgroup.groupid)
+- continue
+- # Otherwise we hook into tsInfo.add
+- pkgs = self.pkgSack.searchNevra(name=condreq)
+- if pkgs:
+- pkgs = self.bestPackagesFromList(pkgs)
+- if self.tsInfo.conditionals.has_key(cond):
+- self.tsInfo.conditionals[cond].extend(pkgs)
+- else:
+- self.tsInfo.conditionals[cond] = pkgs
++
++ if self.conf.enable_group_conditionals:
++ for condreq, cond in thisgroup.conditional_packages.iteritems():
++ if self.isPackageInstalled(cond):
++ try:
++ txmbrs = self.install(name = condreq)
++ except Errors.InstallError:
++ # we don't care if the package doesn't exist
++ continue
++ txmbrs_used.extend(txmbrs)
++ for txmbr in txmbrs:
++ txmbr.groups.append(thisgroup.groupid)
++ continue
++ # Otherwise we hook into tsInfo.add
++ pkgs = self.pkgSack.searchNevra(name=condreq)
++ if pkgs:
++ pkgs = self.bestPackagesFromList(pkgs)
++ if self.tsInfo.conditionals.has_key(cond):
++ self.tsInfo.conditionals[cond].extend(pkgs)
++ else:
++ self.tsInfo.conditionals[cond] = pkgs
+
+ return txmbrs_used
+
+@@ -1827,27 +1838,28 @@ class YumBase(depsolve.Depsolve):
+ if not self.comps.has_group(grpid):
+ raise Errors.GroupsError, _("No Group named %s exists") % grpid
+
+- thisgroup = self.comps.return_group(grpid)
+- if not thisgroup:
++ thesegroups = self.comps.return_groups(grpid)
++ if not thesegroups:
+ raise Errors.GroupsError, _("No Group named %s exists") % grpid
+
+- thisgroup.selected = False
+-
+- for pkgname in thisgroup.packages:
+-
+- for txmbr in self.tsInfo:
+- if txmbr.po.name == pkgname and txmbr.po.state in TS_INSTALL_STATES:
+- try:
+- txmbr.groups.remove(grpid)
+- except ValueError:
+- self.verbose_logger.log(logginglevels.DEBUG_1,
+- _("package %s was not marked in group %s"), txmbr.po,
+- grpid)
+- continue
+-
+- # if there aren't any other groups mentioned then remove the pkg
+- if len(txmbr.groups) == 0:
+- self.tsInfo.remove(txmbr.po.pkgtup)
++ for thisgroup in thesegroups:
++ thisgroup.selected = False
++
++ for pkgname in thisgroup.packages:
++
++ for txmbr in self.tsInfo:
++ if txmbr.po.name == pkgname and txmbr.po.state in TS_INSTALL_STATES:
++ try:
++ txmbr.groups.remove(grpid)
++ except ValueError:
++ self.verbose_logger.log(logginglevels.DEBUG_1,
++ _("package %s was not marked in group %s"), txmbr.po,
++ grpid)
++ continue
++
++ # if there aren't any other groups mentioned then remove the pkg
++ if len(txmbr.groups) == 0:
++ self.tsInfo.remove(txmbr.po.pkgtup)
+
+
+
+@@ -2206,6 +2218,8 @@ class YumBase(depsolve.Depsolve):
if thispkgobsdict.has_key(po.pkgtup):
obsoleting = thispkgobsdict[po.pkgtup][0]
obsoleting_pkg = self.getPackageObject(obsoleting)
@@ -9008,15 +9342,126 @@
self.install(po=obsoleting_pkg)
continue
-@@ -2619,7 +2642,7 @@ class YumBase(depsolve.Depsolve):
+@@ -2433,6 +2447,10 @@ class YumBase(depsolve.Depsolve):
+ ver=nevra_dict['version'], rel=nevra_dict['release'])
+
+ if len(pkgs) == 0:
++ # FIXME we should give the caller some nice way to hush this warning
++ # probably just a kwarg of 'silence_warnings' or something
++ # b/c when this is called from groupRemove() it makes a lot of
++ # garbage noise
+ self.logger.warning(_("No package matched to remove"))
+
+ for po in pkgs:
+@@ -2619,7 +2637,7 @@ class YumBase(depsolve.Depsolve):
rawkey = urlgrabber.urlread(keyurl, limit=9999)
except urlgrabber.grabber.URLGrabError, e:
raise Errors.YumBaseError(_('GPG key retrieval failed: ') +
- str(e))
-+ unicode(e))
++ unicode(str(e), 'UTF-8', 'replace'))
# Parse the key
try:
+@@ -2749,14 +2767,13 @@ class YumBase(depsolve.Depsolve):
+ probs = self.downloadPkgs(dlpkgs)
+
+ except IndexError:
+- raise Errors.YumBaseError, _("Unable to find a suitable mirror.")
++ raise Errors.YumBaseError, [_("Unable to find a suitable mirror.")]
+ if len(probs) > 0:
+- errstr = _("Errors were encountered while downloading packages.")
++ errstr = [_("Errors were encountered while downloading packages.")]
+ for key in probs:
+ errors = misc.unique(probs[key])
+ for error in errors:
+- msg = "%s: %s" % (key, error)
+- errstr += '\n%s' % msg
++ errstr.append("%s: %s" % (key, error))
+
+ raise Errors.YumDownloadError, errstr
+ return dlpkgs
+diff --git a/yum/comps.py b/yum/comps.py
+index fe4a022..f9b94ed 100755
+--- a/yum/comps.py
++++ b/yum/comps.py
+@@ -71,19 +71,36 @@ class Group(object):
+ return lst
+
+ packages = property(_packageiter)
+-
++
++ def _expand_languages(self, lang):
++ import gettext
++ languages = [lang]
++
++ if 'C' not in languages:
++ languages.append('C')
++
++ # now normalize and expand the languages
++ nelangs = []
++ for lang in languages:
++ for nelang in gettext._expand_lang(lang):
++ if nelang not in nelangs:
++ nelangs.append(nelang)
++ return nelangs
++
+ def nameByLang(self, lang):
+- if self.translated_name.has_key[lang]:
+- return self.translated_name[lang]
+- else:
+- return self.name
++
++ for langcode in self._expand_languages(lang):
++ if self.translated_name.has_key(langcode):
++ return self.translated_name[langcode]
++
++ return self.name
+
+
+ def descriptionByLang(self, lang):
+- if self.translated_description.has_key[lang]:
+- return self.translated_description[lang]
+- else:
+- return self.description
++ for langcode in self._expand_languages(lang):
++ if self.translated_description.has_key(langcode):
++ return self.translated_description[langcode]
++ return self.description
+
+ def parse(self, elem):
+ for child in elem:
+@@ -367,7 +384,7 @@ class Comps(object):
+
+
+ def has_group(self, grpid):
+- exists = self.return_group(grpid)
++ exists = self.return_groups(grpid)
+
+ if exists:
+ return True
+@@ -388,6 +405,22 @@ class Comps(object):
+
+ return None
+
++ def return_groups(self, grpid):
++ returns = {}
++ if self._groups.has_key(grpid):
++ thisgroup = self._groups[grpid]
++ returns[thisgroup.groupid] = thisgroup
++
++ # do matches against group names and ids, too
++ for group in self.groups:
++ names = [ group.name, group.groupid ]
++ names.extend(group.translated_name.values())
++ if grpid in names:
++ returns[group.groupid] = group
++
++ return returns.values()
++
++
+
+ def add(self, srcfile = None):
+ if not srcfile:
diff --git a/yum/config.py b/yum/config.py
index ea7c158..fecdfe3 100644
--- a/yum/config.py
@@ -9079,7 +9524,7 @@
+ import __builtin__
+ __builtin__.__dict__['_'] = dummy_wrapper
diff --git a/yum/misc.py b/yum/misc.py
-index 44f85d4..d710ad1 100644
+index 44f85d4..2b4dbfb 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -20,11 +20,29 @@ import gpgme
@@ -9125,7 +9570,7 @@
# we've got nothing so far, so... we glob for the file that MIGHT have
# this kernels and then look up the file in our rpmdb
fns = glob.glob('/boot/vmlinuz*%s*' % ver)
-@@ -515,11 +529,26 @@ def find_ts_remaining(timestamp, yumlibpath='/var/lib/yum'):
+@@ -515,11 +529,35 @@ def find_ts_remaining(timestamp, yumlibpath='/var/lib/yum'):
return to_complete_items
@@ -9136,8 +9581,9 @@
if not isinstance(obj, unicode):
- obj = unicode(obj, encoding)
+ obj = unicode(obj, encoding, errors)
-+ return obj
-+
+ return obj
+
+-
+def to_unicode_maybe(obj, encoding='utf-8', errors='replace'):
+ ''' Don't ask don't tell, only use when you must '''
+ try:
@@ -9151,9 +9597,18 @@
+ # their __str__ methods.
+ if not isinstance(obj, basestring):
+ obj = str(obj)
- return obj
-
-
++ return obj
++
++def get_my_lang_code():
++ import locale
++ mylang = locale.getlocale()
++ if mylang == (None, None): # odd :)
++ mylang = 'C'
++ else:
++ mylang = '.'.join(mylang)
++
++ return mylang
++
diff --git a/yum/plugins.py b/yum/plugins.py
index 0a7f57a..99c2740 100644
--- a/yum/plugins.py
@@ -9244,6 +9699,31 @@
@catchSqliteException
def close(self):
+diff --git a/yum/yumRepo.py b/yum/yumRepo.py
+index 65ecb50..0074d11 100644
+--- a/yum/yumRepo.py
++++ b/yum/yumRepo.py
+@@ -965,7 +965,19 @@ class YumRepository(Repository, config.RepoConf):
+ """ Check if two returns from _get_mdtype_data() are equal. """
+ if ndata is None:
+ return False
+- return omdtype == nmdtype and odata.checksum == ndata.checksum
++ if omdtype != nmdtype:
++ return False
++ if odata.checksum != ndata.checksum:
++ return False
++ # If we turn --unique-md-filenames on without chaning the data,
++ # then we'll get different filenames, but the same checksum.
++ # Atm. just say they are different, to make sure we delete the
++ # old files.
++ orname = os.path.basename(odata.location[1])
++ nrname = os.path.basename(ndata.location[1])
++ if orname != nrname:
++ return False
++ return True
+
+ all_mdtypes = self.retrieved.keys()
+ if mdtypes is None:
diff --git a/yumcommands.py b/yumcommands.py
index 0afcf66..9dce44f 100644
--- a/yumcommands.py
Index: yum.spec
===================================================================
RCS file: /cvs/extras/rpms/yum/devel/yum.spec,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -r1.211 -r1.212
--- yum.spec 16 Apr 2008 01:06:34 -0000 1.211
+++ yum.spec 16 Apr 2008 11:54:08 -0000 1.212
@@ -3,7 +3,7 @@
Summary: RPM installer/updater
Name: yum
Version: 3.2.14
-Release: 9%{?dist}
+Release: 10%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://linux.duke.edu/projects/yum/download/3.2/%{name}-%{version}.tar.gz
More information about the fedora-extras-commits
mailing list