[yum] update to latest HEAD.
James Antill
james at fedoraproject.org
Tue Apr 23 19:09:38 UTC 2013
commit d8627581bfc4d69bfc85061d4b841a610cf03875
Author: James Antill <james at and.org>
Date: Tue Apr 23 15:09:30 2013 -0400
update to latest HEAD.
- A fix for environments and not installed groups. BZ 928859.
- Add downloadonly option to download prompt.
yum-HEAD.patch | 301 ++++++++++++++++++++++++++++++++++----------------------
yum.spec | 7 +-
2 files changed, 190 insertions(+), 118 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 5b69994..8e08b99 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -99,7 +99,7 @@ index 2f6154e..2e5a052 100644
diff --git a/cli.py b/cli.py
old mode 100644
new mode 100755
-index 6056d38..ba2e343
+index 6056d38..c8a5554
--- a/cli.py
+++ b/cli.py
@@ -25,7 +25,7 @@ import sys
@@ -381,7 +381,7 @@ index 6056d38..ba2e343
# at this point we know the args are valid - we don't know their meaning
# but we know we're not being sent garbage
-@@ -435,14 +511,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -435,14 +511,30 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
try:
self._getTs(needTsRemove)
except yum.Errors.YumBaseError, e:
@@ -407,10 +407,16 @@ index 6056d38..ba2e343
+ errors. A negative return code indicates that errors
+ occurred in the pre-transaction checks
+ """
++ def _downloadonly_userconfirm(self):
++ return self.userconfirm(prompt=_('Is this ok [y/d/N]: '),
++ extra={'downloadonly' :
++ (u'd', _('d'), _('download'),
++ _('downloadonly'))})
++
# just make sure there's not, well, nothing to do
if len(self.tsInfo) == 0:
self.verbose_logger.info(_('Trying to run the transaction but nothing to do. Exiting.'))
-@@ -453,7 +539,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -453,7 +545,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
lsts = self.listTransaction()
if self.verbose_logger.isEnabledFor(yum.logginglevels.INFO_1):
self.verbose_logger.log(yum.logginglevels.INFO_1, lsts)
@@ -419,7 +425,7 @@ index 6056d38..ba2e343
# If we are in quiet, and assumeyes isn't on we want to output
# at least the transaction list anyway.
self.logger.warn(lsts)
-@@ -463,7 +549,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -463,7 +555,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
rmpkgs = []
stuff_to_download = False
install_only = True
@@ -427,7 +433,7 @@ index 6056d38..ba2e343
for txmbr in self.tsInfo.getMembers():
if txmbr.ts_state not in ('i', 'u'):
install_only = False
-@@ -471,7 +556,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -471,7 +562,6 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
if po:
rmpkgs.append(po)
else:
@@ -435,7 +441,7 @@ index 6056d38..ba2e343
stuff_to_download = True
po = txmbr.po
if po:
-@@ -489,19 +573,30 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -489,19 +579,40 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
else:
self.reportDownloadSize(downloadpkgs, install_only)
@@ -454,13 +460,24 @@ index 6056d38..ba2e343
if self._promptWanted():
- if not self.userconfirm():
- self.verbose_logger.info(_('Exiting on user Command'))
-+ if self.conf.assumeno or not self.userconfirm():
++ uc = None
++ if not self.conf.assumeno:
++ uc = _downloadonly_userconfirm(self)
++
++ if not uc:
+ self.verbose_logger.info(_('Exiting on user command'))
return -1
++ elif uc == 'downloadonly':
++ self.conf.downloadonly = True
- self.verbose_logger.log(yum.logginglevels.INFO_2,
+- self.verbose_logger.log(yum.logginglevels.INFO_2,
- _('Downloading Packages:'))
-+ _('Downloading packages:'))
++ if self.conf.downloadonly:
++ self.verbose_logger.log(yum.logginglevels.INFO_2,
++ _('Background downloading packages, then exiting:'))
++ else:
++ self.verbose_logger.log(yum.logginglevels.INFO_2,
++ _('Downloading packages:'))
problems = self.downloadPkgs(downloadpkgs, callback_total=self.download_callback_total_cb)
if len(problems) > 0:
@@ -470,7 +487,7 @@ index 6056d38..ba2e343
for key in problems:
errors = yum.misc.unique(problems[key])
for error in errors:
-@@ -520,8 +615,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -520,8 +631,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
rcd_st = time.time()
self.verbose_logger.log(yum.logginglevels.INFO_2,
@@ -481,7 +498,7 @@ index 6056d38..ba2e343
if msgs:
rpmlib_only = True
for msg in msgs:
-@@ -532,19 +628,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -532,19 +644,23 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
print _("ERROR You need to update rpm to handle:")
else:
print _('ERROR with transaction check vs depsolve:')
@@ -508,7 +525,7 @@ index 6056d38..ba2e343
if not self.conf.diskspacecheck:
self.tsInfo.probFilterFlags.append(rpm.RPMPROB_FILTER_DISKSPACE)
-@@ -556,16 +656,16 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -556,16 +672,16 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
del testcb
if len(tserrors) > 0:
@@ -528,7 +545,7 @@ index 6056d38..ba2e343
# unset the sigquit handler
signal.signal(signal.SIGQUIT, signal.SIG_DFL)
-@@ -595,7 +695,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -595,7 +711,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
if self.conf.debuglevel < 2:
cb.display.output = False
@@ -537,7 +554,7 @@ index 6056d38..ba2e343
resultobject = self.runTransaction(cb=cb)
self.verbose_logger.debug('Transaction time: %0.3f' % (time.time() - ts_st))
-@@ -609,12 +709,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -609,12 +725,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return resultobject.return_code
def gpgsigcheck(self, pkgs):
@@ -557,7 +574,7 @@ index 6056d38..ba2e343
for po in pkgs:
result, errmsg = self.sigCheckPkg(po)
-@@ -623,7 +725,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -623,7 +741,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
continue
elif result == 1:
@@ -567,7 +584,7 @@ index 6056d38..ba2e343
raise yum.Errors.YumBaseError, \
_('Refusing to automatically import keys when running ' \
'unattended.\nUse "-y" to override.')
-@@ -691,12 +794,62 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -691,12 +810,62 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
", ".join(matches))
self.verbose_logger.log(yum.logginglevels.INFO_2, msg)
@@ -636,7 +653,7 @@ index 6056d38..ba2e343
# get the list of available packages
# iterate over the user's list
# add packages to Transaction holding class if they match.
-@@ -710,11 +863,36 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -710,11 +879,36 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
for arg in userlist:
if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or
os.path.exists(arg))):
@@ -675,7 +692,7 @@ index 6056d38..ba2e343
except yum.Errors.InstallError:
self.verbose_logger.log(yum.logginglevels.INFO_2,
_('No package %s%s%s available.'),
-@@ -723,6 +901,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -723,6 +917,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self._maybeYouMeant(arg)
else:
done = True
@@ -683,7 +700,7 @@ index 6056d38..ba2e343
if len(self.tsInfo) > oldcount:
change = len(self.tsInfo) - oldcount
return 2, [P_('%d package to install', '%d packages to install', change) % change]
-@@ -732,9 +911,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -732,9 +927,27 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, [_('Nothing to do')]
def updatePkgs(self, userlist, quiet=0, update_to=False):
@@ -714,7 +731,7 @@ index 6056d38..ba2e343
# if there is no userlist, then do global update below
# this is probably 90% of the calls
# if there is a userlist then it's for updating pkgs, not obsoleting
-@@ -745,34 +942,46 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -745,34 +958,46 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
else:
# go through the userlist - look for items that are local rpms. If we find them
@@ -778,7 +795,7 @@ index 6056d38..ba2e343
level = 'diff'
if userlist and userlist[0] in ('full', 'diff', 'different'):
-@@ -831,6 +1040,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -831,6 +1056,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
continue
nayi = napkg.yumdb_info
@@ -786,7 +803,7 @@ index 6056d38..ba2e343
for apkg in self.pkgSack.searchPkgTuple(napkg.pkgtup):
if ('checksum_type' in nayi and
'checksum_data' in nayi and
-@@ -861,19 +1071,58 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -861,19 +1087,58 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
dupdates.extend(self.downgrade(name=n, epoch=e, ver=v, rel=r))
if dupdates:
@@ -853,7 +870,7 @@ index 6056d38..ba2e343
if not rms:
self._checkMaybeYouMeant(arg, always_output=False, rpmdb_only=True)
all_rms.extend(rms)
-@@ -884,12 +1133,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -884,12 +1149,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, [_('No Packages marked for removal')]
def downgradePkgs(self, userlist):
@@ -881,7 +898,7 @@ index 6056d38..ba2e343
for arg in userlist:
if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or
os.path.exists(arg))):
-@@ -905,26 +1166,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -905,26 +1182,44 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.term.MODE['bold'], arg,
self.term.MODE['normal'])
self._maybeYouMeant(arg)
@@ -930,7 +947,7 @@ index 6056d38..ba2e343
except yum.Errors.ReinstallRemoveError:
self._checkMaybeYouMeant(arg, always_output=False)
except yum.Errors.ReinstallInstallError, e:
-@@ -940,22 +1219,38 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -940,22 +1235,38 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
except yum.Errors.ReinstallError, e:
assert False, "Shouldn't happen, but just in case"
self.verbose_logger.log(yum.logginglevels.INFO_2, e)
@@ -973,7 +990,7 @@ index 6056d38..ba2e343
installing = False
for pkg in filelist:
-@@ -971,23 +1266,29 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -971,23 +1282,29 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 2, [_('Package(s) to install')]
return 0, [_('Nothing to do')]
@@ -1019,7 +1036,7 @@ index 6056d38..ba2e343
pkgnarrow = 'all'
done_hidden_available = False
-@@ -1003,7 +1304,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1003,7 +1320,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
pkgnarrow = extcmds.pop(0)
ypl = self.doPackageLists(pkgnarrow=pkgnarrow, patterns=extcmds,
@@ -1028,7 +1045,7 @@ index 6056d38..ba2e343
if self.conf.showdupesfromrepos:
ypl.available += ypl.reinstall_available
-@@ -1017,8 +1318,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1017,8 +1334,25 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return ypl
def search(self, args):
@@ -1056,7 +1073,7 @@ index 6056d38..ba2e343
# call the yum module search function with lists of tags to search
# and what to search for
-@@ -1053,7 +1371,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1053,7 +1387,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
print ""
else:
mkeys = set(keys)
@@ -1065,7 +1082,7 @@ index 6056d38..ba2e343
okeys = keys
pos.add(po)
akeys.update(keys)
-@@ -1104,13 +1422,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1104,13 +1438,24 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.logger.warning(_('Warning: No matches found for: %s'), arg)
if not akeys:
@@ -1093,7 +1110,7 @@ index 6056d38..ba2e343
pkgs = []
for arg in args:
if (arg.endswith('.rpm') and (yum.misc.re_remote_url(arg) or
-@@ -1118,10 +1447,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1118,10 +1463,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
thispkg = yum.packages.YumUrlPackage(self, self.ts, arg)
pkgs.append(thispkg)
elif self.conf.showdupesfromrepos:
@@ -1108,7 +1125,7 @@ index 6056d38..ba2e343
except yum.Errors.PackageSackError:
pass
-@@ -1131,10 +1462,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1131,10 +1478,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 0, []
def provides(self, args):
@@ -1132,7 +1149,7 @@ index 6056d38..ba2e343
old_sdup = self.conf.showdupesfromrepos
# For output, as searchPackageProvides() is always in showdups mode
self.conf.showdupesfromrepos = True
-@@ -1147,6 +1487,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1147,6 +1503,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
paths = set(sys.path + os.environ['PATH'].split(':'))
nargs = []
for arg in args:
@@ -1141,7 +1158,7 @@ index 6056d38..ba2e343
if yum.misc.re_filename(arg) or yum.misc.re_glob(arg):
continue
for path in paths:
-@@ -1158,25 +1500,82 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1158,25 +1516,82 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.conf.showdupesfromrepos = old_sdup
if len(matching) == 0:
@@ -1230,7 +1247,7 @@ index 6056d38..ba2e343
hdrcode = pkgcode = xmlcode = dbcode = expccode = 0
pkgresults = hdrresults = xmlresults = dbresults = expcresults = []
msg = self.fmtKeyValFill(_('Cleaning repos: '),
-@@ -1184,7 +1583,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1184,7 +1599,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
self.verbose_logger.log(yum.logginglevels.INFO_2, msg)
if 'all' in userlist:
self.verbose_logger.log(yum.logginglevels.INFO_2,
@@ -1239,7 +1256,7 @@ index 6056d38..ba2e343
pkgcode, pkgresults = self.cleanPackages()
hdrcode, hdrresults = self.cleanHeaders()
xmlcode, xmlresults = self.cleanMetadata()
-@@ -1200,10 +1599,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1200,10 +1615,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return code, []
if 'headers' in userlist:
@@ -1252,7 +1269,7 @@ index 6056d38..ba2e343
pkgcode, pkgresults = self.cleanPackages()
if 'metadata' in userlist:
self.logger.debug(_('Cleaning up xml metadata'))
-@@ -1228,138 +1627,265 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1228,138 +1643,265 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return code, []
def returnGroupLists(self, userlist):
@@ -1262,10 +1279,10 @@ index 6056d38..ba2e343
+ :param extcmds: a list of names or wildcards specifying
+ groups to list
+ :return: (exit_code, [ errors ])
-+
-+ exit_code is::
- uservisible=1
++ exit_code is::
++
+ 0 = we're done, exit
+ 1 = we've errored, exit with error string
+ 2 = we've got work yet to do, onto the next stage
@@ -1600,17 +1617,17 @@ index 6056d38..ba2e343
continue
if not pkgs_used:
-@@ -1368,17 +1894,61 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1368,17 +1910,61 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return 2, [P_('%d package to Install', '%d packages to Install', len(pkgs_used)) % len(pkgs_used)]
def removeGroups(self, grouplist):
- """Remove only packages of the named group(s). Do not recurse."""
+ """Mark the packages in the given groups for removal.
-+
+
+ :param grouplist: a list of names or wildcards specifying
+ groups to be removed
+ :return: (exit_code, [ errors ])
-
++
+ exit_code is::
+
+ 0 = we're done, exit
@@ -1670,7 +1687,7 @@ index 6056d38..ba2e343
if not pkgs_used:
return 0, [_('No packages to remove from groups')]
-@@ -1389,7 +1959,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1389,7 +1975,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
def _promptWanted(self):
# shortcut for the always-off/always-on options
@@ -1679,7 +1696,7 @@ index 6056d38..ba2e343
return False
if self.conf.alwaysprompt:
return True
-@@ -1397,10 +1967,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1397,10 +1983,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
# prompt if:
# package was added to fill a dependency
# package is being removed
@@ -1691,7 +1708,7 @@ index 6056d38..ba2e343
txmbr.name not in self.extcmds:
return True
-@@ -1408,11 +1977,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1408,11 +1993,11 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return False
def usage(self):
@@ -1705,7 +1722,7 @@ index 6056d38..ba2e343
sys.stdout.write(self.optparser.get_usage())
def _installable(self, pkg, ematch=False):
-@@ -1468,9 +2037,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
+@@ -1468,9 +2053,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
return False
class YumOptionParser(OptionParser):
@@ -1717,7 +1734,7 @@ index 6056d38..ba2e343
def __init__(self,base, **kwargs):
# check if this is called with a utils=True/False parameter
-@@ -1488,13 +2057,23 @@ class YumOptionParser(OptionParser):
+@@ -1488,13 +2073,23 @@ class YumOptionParser(OptionParser):
self._addYumBasicOptions()
def error(self, msg):
@@ -1743,7 +1760,7 @@ index 6056d38..ba2e343
try:
args = _filtercmdline(
('--noplugins','--version','-q', '-v', "--quiet", "--verbose"),
-@@ -1521,7 +2100,15 @@ class YumOptionParser(OptionParser):
+@@ -1521,7 +2116,15 @@ class YumOptionParser(OptionParser):
return ret
def setupYumConfig(self, args=None):
@@ -1760,7 +1777,7 @@ index 6056d38..ba2e343
if not args:
(opts, cmds) = self.parse_args()
else:
-@@ -1533,16 +2120,30 @@ class YumOptionParser(OptionParser):
+@@ -1533,16 +2136,30 @@ class YumOptionParser(OptionParser):
try:
# config file is parsed and moving us forward
# set some things in it.
@@ -1797,7 +1814,7 @@ index 6056d38..ba2e343
self.base.conf.cache = 1
if opts.obsoletes:
-@@ -1610,10 +2211,6 @@ class YumOptionParser(OptionParser):
+@@ -1610,10 +2227,6 @@ class YumOptionParser(OptionParser):
self.base.usage()
sys.exit(1)
@@ -1808,7 +1825,7 @@ index 6056d38..ba2e343
# Disable all gpg key checking, if requested.
if opts.nogpgcheck:
# Altering the normal configs. doesn't work too well, esp. with
-@@ -1623,7 +2220,7 @@ class YumOptionParser(OptionParser):
+@@ -1623,7 +2236,7 @@ class YumOptionParser(OptionParser):
repo._override_sigchecks = True
except ValueError, e:
@@ -1817,7 +1834,7 @@ index 6056d38..ba2e343
self.base.usage()
sys.exit(1)
-@@ -1640,10 +2237,18 @@ class YumOptionParser(OptionParser):
+@@ -1640,10 +2253,18 @@ class YumOptionParser(OptionParser):
sys.exit(1)
def getRoot(self,opts):
@@ -1837,7 +1854,7 @@ index 6056d38..ba2e343
if os.access(opts.installroot+'/'+opts.conffile, os.R_OK):
opts.conffile = opts.installroot+'/'+opts.conffile
elif opts.conffile == '/etc/yum/yum.conf':
-@@ -1701,6 +2306,9 @@ class YumOptionParser(OptionParser):
+@@ -1701,6 +2322,9 @@ class YumOptionParser(OptionParser):
group.add_option("--showduplicates", dest="showdupesfromrepos",
action="store_true",
help=_("show duplicates, in repos, in list/search commands"))
@@ -1847,7 +1864,7 @@ index 6056d38..ba2e343
group.add_option("-e", "--errorlevel", dest="errorlevel", default=None,
help=_("error output level"), type='int',
metavar='[error level]')
-@@ -1713,6 +2321,10 @@ class YumOptionParser(OptionParser):
+@@ -1713,6 +2337,10 @@ class YumOptionParser(OptionParser):
help=_("verbose operation"))
group.add_option("-y", "--assumeyes", dest="assumeyes",
action="store_true", help=_("answer yes for all questions"))
@@ -1858,7 +1875,7 @@ index 6056d38..ba2e343
group.add_option("--version", action="store_true",
help=_("show Yum version and exit"))
group.add_option("--installroot", help=_("set install root"),
-@@ -1748,9 +2360,29 @@ class YumOptionParser(OptionParser):
+@@ -1748,9 +2376,29 @@ class YumOptionParser(OptionParser):
help=_("control whether color is used"))
group.add_option("", "--releasever", dest="releasever", default=None,
help=_("set value of $releasever in yum config and repo files"))
@@ -4490,7 +4507,7 @@ index f1e06e8..b319963 100644
complete -F _yum -o filenames yum yummain.py
diff --git a/output.py b/output.py
-index b6aa277..020e2b6 100755
+index b6aa277..e17194c 100755
--- a/output.py
+++ b/output.py
@@ -1,6 +1,6 @@
@@ -5017,20 +5034,69 @@ index b6aa277..020e2b6 100755
elif key not in highlight_na:
highlight = highlight_modes.get('not in', 'normal')
elif pkg.verEQ(highlight_na[key]):
-@@ -679,8 +961,11 @@ class YumOutput:
-
+@@ -676,17 +958,23 @@ class YumOutput:
+ return 1, ['No Packages to list']
+ return 0, []
- def userconfirm(self):
+-
+-
+- def userconfirm(self):
- """gets a yes or no from the user, defaults to No"""
-+ """Get a yes or no from the user, and default to No
-
-+ :return: True if the user selects yes, and False if the user
-+ selects no
++ def userconfirm(self, prompt=_('Is this ok [y/N]: '), extra={}):
++ """Get a yes or no from the user, and default to No, and maybe more.
++
++ :param extra: a dict of ui responses to a list of their inputs.
++ :return: the UI response or None for no. At it's simplest this is 'yes' or None
+ """
- yui = (to_unicode(_('y')), to_unicode(_('yes')))
- nui = (to_unicode(_('n')), to_unicode(_('no')))
- aui = (yui[0], yui[1], nui[0], nui[1])
-@@ -739,27 +1024,58 @@ class YumOutput:
++
++ # Allow the one letter english versions in all langs.
++ yui = (u'y', to_unicode(_('y')), to_unicode(_('yes')))
++ nui = (u'n', to_unicode(_('n')), to_unicode(_('no')))
++ aui = set(yui + nui)
++ for xui in extra:
++ aui.update(extra[xui])
+
+- yui = (to_unicode(_('y')), to_unicode(_('yes')))
+- nui = (to_unicode(_('n')), to_unicode(_('no')))
+- aui = (yui[0], yui[1], nui[0], nui[1])
+ while True:
+ try:
+- choice = raw_input(_('Is this ok [y/N]: '))
++ choice = raw_input(prompt)
+ except UnicodeEncodeError:
+ raise
+ except UnicodeDecodeError:
+@@ -697,17 +985,19 @@ class YumOutput:
+ choice = choice.lower()
+ if len(choice) == 0 or choice in aui:
+ break
+- # If the enlish one letter names don't mix, allow them too
+- if u'y' not in aui and u'y' == choice:
+- choice = yui[0]
+- break
+- if u'n' not in aui and u'n' == choice:
+- break
+
+- if len(choice) == 0 or choice not in yui:
+- return False
+- else:
+- return True
++ if not choice:
++ # Default, maybe configure this?
++ # Would need to never allow default=yes as that's really bad.
++ return None
++
++ if choice in yui:
++ return 'yes'
++ for xui in extra:
++ if choice in extra[xui]:
++ return xui
++
++ return None
+
+ def _cli_confirm_gpg_key_import(self, keydict):
+ # FIXME what should we be printing here?
+@@ -739,27 +1029,58 @@ class YumOutput:
return ret
def _calcDataPkgColumns(self, data, pkg_names, pkg_names2pkgs,
@@ -5093,7 +5159,7 @@ index b6aa277..020e2b6 100755
continue
for (apkg, ipkg) in sorted(pkg_names2pkgs[item],
key=lambda x: x[1] or x[0]):
-@@ -770,18 +1086,38 @@ class YumOutput:
+@@ -770,18 +1091,38 @@ class YumOutput:
else:
highlight = False
self.simpleEnvraList(ipkg or apkg, ui_overflow=True,
@@ -5136,7 +5202,7 @@ index b6aa277..020e2b6 100755
if group.ui_description:
print _(' Description: %s') % to_unicode(group.ui_description)
if group.langonly:
-@@ -795,7 +1131,8 @@ class YumOutput:
+@@ -795,7 +1136,8 @@ class YumOutput:
if verb:
data = {'envra' : {}, 'rid' : {}}
for (section_name, pkg_names) in sections:
@@ -5146,7 +5212,7 @@ index b6aa277..020e2b6 100755
data = [data['envra'], data['rid']]
columns = self.calcColumns(data)
columns = (-columns[0], -columns[1])
-@@ -804,11 +1141,77 @@ class YumOutput:
+@@ -804,11 +1146,77 @@ class YumOutput:
if len(pkg_names) > 0:
print section_name
self._displayPkgsFromNames(pkg_names, verb, pkg_names2pkgs,
@@ -5227,7 +5293,7 @@ index b6aa277..020e2b6 100755
verb = self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)
for pkg in sorted(results):
print _("package: %s") % pkg.compactPrint()
-@@ -832,7 +1235,18 @@ class YumOutput:
+@@ -832,7 +1240,18 @@ class YumOutput:
print " provider: %s" % po.compactPrint()
def format_number(self, number, SI=0, space=' '):
@@ -5247,7 +5313,7 @@ index b6aa277..020e2b6 100755
symbols = [ ' ', # (none)
'k', # kilo
'M', # mega
-@@ -870,16 +1284,31 @@ class YumOutput:
+@@ -870,16 +1289,31 @@ class YumOutput:
@staticmethod
def format_time(seconds, use_hours=0):
@@ -5285,7 +5351,7 @@ index b6aa277..020e2b6 100755
if self.conf.showdupesfromrepos:
msg = '%s : ' % po
else:
-@@ -923,7 +1352,15 @@ class YumOutput:
+@@ -923,7 +1357,15 @@ class YumOutput:
item = self._enc(item)
can_overflow = False
else:
@@ -5302,7 +5368,7 @@ index b6aa277..020e2b6 100755
if matchfor:
item = self._sub_highlight(item, highlight, matchfor,
-@@ -935,14 +1372,34 @@ class YumOutput:
+@@ -935,14 +1377,34 @@ class YumOutput:
print '\n\n'
def matchcallback_verbose(self, po, values, matchfor=None):
@@ -5338,7 +5404,7 @@ index b6aa277..020e2b6 100755
for pkg in packages:
# Just to be on the safe side, if for some reason getting
# the package size fails, log the error and don't report download
-@@ -971,18 +1428,18 @@ class YumOutput:
+@@ -971,18 +1433,18 @@ class YumOutput:
if (not error):
if locsize:
@@ -5365,7 +5431,7 @@ index b6aa277..020e2b6 100755
totsize = 0
error = False
for pkg in packages:
-@@ -997,13 +1454,19 @@ class YumOutput:
+@@ -997,13 +1459,19 @@ class YumOutput:
self.logger.error(_('There was an error calculating installed size'))
break
if (not error):
@@ -5390,7 +5456,7 @@ index b6aa277..020e2b6 100755
self.tsInfo.makelists(True, True)
pkglist_lines = []
data = {'n' : {}, 'v' : {}, 'r' : {}}
-@@ -1032,8 +1495,7 @@ class YumOutput:
+@@ -1032,8 +1500,7 @@ class YumOutput:
for (d, v) in (("n",len(n)), ("v",len(evr)), ("r",len(repoid))):
data[d].setdefault(v, 0)
data[d][v] += 1
@@ -5400,7 +5466,7 @@ index b6aa277..020e2b6 100755
return a_wid
for (action, pkglist) in [(_('Installing'), self.tsInfo.installed),
-@@ -1102,19 +1564,72 @@ class YumOutput:
+@@ -1102,19 +1569,72 @@ class YumOutput:
Transaction Summary
%s
""") % ('=' * self.term.columns))
@@ -5483,7 +5549,7 @@ index b6aa277..020e2b6 100755
out = ''
self.tsInfo.makelists()
-@@ -1179,17 +1694,19 @@ Transaction Summary
+@@ -1179,17 +1699,19 @@ Transaction Summary
return out
def setupProgressCallbacks(self):
@@ -5506,7 +5572,7 @@ index b6aa277..020e2b6 100755
callback = CacheProgressCallback()
# setup our failure report for failover
-@@ -1200,13 +1717,14 @@ Transaction Summary
+@@ -1200,13 +1722,14 @@ Transaction Summary
interrupt_callback = self.interrupt_callback
if hasattr(self, 'prerepoconf'):
self.prerepoconf.progressbar = progressbar
@@ -5522,7 +5588,7 @@ index b6aa277..020e2b6 100755
self.repos.callback = callback
self.repos.setFailureCallback(failure_callback)
self.repos.setInterruptCallback(interrupt_callback)
-@@ -1216,10 +1734,12 @@ Transaction Summary
+@@ -1216,10 +1739,12 @@ Transaction Summary
self.dsCallback = dscb
def setupProgessCallbacks(self):
@@ -5536,27 +5602,27 @@ index b6aa277..020e2b6 100755
confirm_func = self._cli_confirm_gpg_key_import
gpg_import_func = self.getKeyForRepo
gpgca_import_func = self.getCAKeyForRepo
-@@ -1233,14 +1753,12 @@ Transaction Summary
+@@ -1233,14 +1758,12 @@ Transaction Summary
self.repos.gpgca_import_func = gpgca_import_func
def interrupt_callback(self, cbobj):
- '''Handle CTRL-C's during downloads
--
-- If a CTRL-C occurs a URLGrabError will be raised to push the download
-- onto the next mirror.
--
-- If two CTRL-C's occur in quick succession then yum will exit.
+ '''Handle CTRL-C's during downloads. If a CTRL-C occurs a
+ URLGrabError will be raised to push the download onto the next
+ mirror. If two CTRL-C's occur in quick succession then yum
+ will exit.
+- If a CTRL-C occurs a URLGrabError will be raised to push the download
+- onto the next mirror.
+-
+- If two CTRL-C's occur in quick succession then yum will exit.
+-
- @param cbobj: urlgrabber callback obj
+ :param cbobj: :class:`urlgrabber.grabber.CallbackObject`
'''
delta_exit_chk = 2.0 # Delta between C-c's so we treat as exit
delta_exit_str = _("two") # Human readable version of above
-@@ -1253,7 +1771,7 @@ Transaction Summary
+@@ -1253,7 +1776,7 @@ Transaction Summary
# For translators: This is output like:
# Current download cancelled, interrupt (ctrl-c) again within two seconds
# to exit.
@@ -5565,7 +5631,7 @@ index b6aa277..020e2b6 100755
msg = _("""
Current download cancelled, %sinterrupt (ctrl-c) again%s within %s%s%s seconds
to exit.
-@@ -1269,6 +1787,14 @@ to exit.
+@@ -1269,6 +1792,14 @@ to exit.
def download_callback_total_cb(self, remote_pkgs, remote_size,
download_start_timestamp):
@@ -5580,7 +5646,7 @@ index b6aa277..020e2b6 100755
if len(remote_pkgs) <= 1:
return
if not hasattr(urlgrabber.progress, 'TerminalLine'):
-@@ -1434,10 +1960,21 @@ to exit.
+@@ -1434,10 +1965,21 @@ to exit.
return tids, printall
def historyListCmd(self, extcmds):
@@ -5590,9 +5656,9 @@ index b6aa277..020e2b6 100755
+
+ :param extcmds: list of extra command line arguments
+ :return: (exit_code, [errors])
-+
-+ exit_code is::
++ exit_code is::
++
+ 0 = we're done, exit
+ 1 = we've errored, exit with error string
+ """
@@ -5603,7 +5669,7 @@ index b6aa277..020e2b6 100755
return 1, ['Failed history list']
limit = 20
-@@ -1564,6 +2101,16 @@ to exit.
+@@ -1564,6 +2106,16 @@ to exit.
return old[0]
def historyInfoCmd(self, extcmds):
@@ -5620,7 +5686,7 @@ index b6aa277..020e2b6 100755
def str2int(x):
try:
return int(x)
-@@ -1656,6 +2203,9 @@ to exit.
+@@ -1656,6 +2208,9 @@ to exit.
def _hpkg2from_repo(self, hpkg):
""" Given a pkg, find the ipkg.ui_from_repo ... if none, then
get an apkg. ... and put a ? in there. """
@@ -5630,7 +5696,7 @@ index b6aa277..020e2b6 100755
ipkgs = self.rpmdb.searchPkgTuple(hpkg.pkgtup)
if not ipkgs:
apkgs = self.pkgSack.searchPkgTuple(hpkg.pkgtup)
-@@ -1672,13 +2222,12 @@ to exit.
+@@ -1672,13 +2227,12 @@ to exit.
'o' : _('Updated'), 'n' : _('Downgraded')}
_pkg_states_available = {'i' : _('Installed'), 'e' : _('Not installed'),
'o' : _('Older'), 'n' : _('Newer')}
@@ -5647,7 +5713,7 @@ index b6aa277..020e2b6 100755
prefix = " " * prefix_len
if was_installed:
_pkg_states = _pkg_states_installed
-@@ -1702,9 +2251,11 @@ to exit.
+@@ -1702,9 +2256,11 @@ to exit.
else:
(hibeg, hiend) = self._highlight('normal')
state = utf8_width_fill(state, _pkg_states['maxlen'])
@@ -5661,7 +5727,7 @@ index b6aa277..020e2b6 100755
if type(old.tid) == type([]):
print _("Transaction ID :"), "%u..%u" % (old.tid[0], old.tid[-1])
-@@ -1778,8 +2329,8 @@ to exit.
+@@ -1778,8 +2334,8 @@ to exit.
default_addons = set(['config-main', 'config-repos', 'saved_tx'])
non_default = set(addon_info).difference(default_addons)
if len(non_default) > 0:
@@ -5672,7 +5738,7 @@ index b6aa277..020e2b6 100755
if old.trans_with:
# This is _possible_, but not common
-@@ -1794,7 +2345,9 @@ to exit.
+@@ -1794,7 +2350,9 @@ to exit.
print _("Packages Skipped:")
pkg_max_len = max((len(str(hpkg)) for hpkg in old.trans_skip))
for hpkg in old.trans_skip:
@@ -5683,7 +5749,7 @@ index b6aa277..020e2b6 100755
if old.rpmdb_problems:
print _("Rpmdb Problems:")
-@@ -1833,6 +2386,13 @@ to exit.
+@@ -1833,6 +2391,13 @@ to exit.
'Updated' : _('Updated'),
}
def historyInfoCmdPkgsAltered(self, old, pats=[]):
@@ -5697,7 +5763,7 @@ index b6aa277..020e2b6 100755
last = None
# Note that these don't use _simple_pkg() because we are showing what
# happened to them in the transaction ... not the difference between the
-@@ -1886,6 +2446,10 @@ to exit.
+@@ -1886,6 +2451,10 @@ to exit.
self._hpkg2from_repo(hpkg))
def historySummaryCmd(self, extcmds):
@@ -5708,7 +5774,7 @@ index b6aa277..020e2b6 100755
tids, printall = self._history_list_transactions(extcmds)
if tids is None:
return 1, ['Failed history info']
-@@ -1946,6 +2510,10 @@ to exit.
+@@ -1946,6 +2515,10 @@ to exit.
utf8_width_fill(uiacts, 16, 16), count)
def historyAddonInfoCmd(self, extcmds):
@@ -5719,7 +5785,7 @@ index b6aa277..020e2b6 100755
tid = None
if len(extcmds) > 1:
tid = extcmds[1]
-@@ -1983,16 +2551,19 @@ to exit.
+@@ -1983,16 +2556,19 @@ to exit.
for item in extcmds[2:]:
if item in addon_info:
@@ -5745,7 +5811,7 @@ index b6aa277..020e2b6 100755
tids = self.history.search(extcmds)
limit = None
if extcmds and not tids:
-@@ -2078,9 +2649,94 @@ to exit.
+@@ -2078,9 +2654,94 @@ to exit.
if lastdbv.end_rpmdbversion != rpmdbv:
self._rpmdb_warn_checks()
@@ -5841,7 +5907,7 @@ index b6aa277..020e2b6 100755
def __init__(self, ayum=None):
"""requires yum-cli log and errorlog functions as arguments"""
-@@ -2089,6 +2745,25 @@ class DepSolveProgressCallBack:
+@@ -2089,6 +2750,25 @@ class DepSolveProgressCallBack:
self.ayum = ayum
def pkgAdded(self, pkgtup, mode):
@@ -5867,7 +5933,7 @@ index b6aa277..020e2b6 100755
modedict = { 'i': _('installed'),
'u': _('an update'),
'e': _('erased'),
-@@ -2104,43 +2779,86 @@ class DepSolveProgressCallBack:
+@@ -2104,43 +2784,86 @@ class DepSolveProgressCallBack:
modeterm)
def start(self):
@@ -5958,7 +6024,7 @@ index b6aa277..020e2b6 100755
needname, needflags, needversion = reqTup
yb = self.ayum
-@@ -2225,46 +2943,106 @@ class DepSolveProgressCallBack:
+@@ -2225,46 +2948,106 @@ class DepSolveProgressCallBack:
return msg
def procConflict(self, name, confname):
@@ -6070,7 +6136,7 @@ index b6aa277..020e2b6 100755
def _pkgname_ui(ayum, pkgname, ts_states=None):
""" Get more information on a simple pkgname, if we can. We need to search
-@@ -2316,10 +3094,7 @@ def _pkgname_ui(ayum, pkgname, ts_states=None):
+@@ -2316,10 +3099,7 @@ def _pkgname_ui(ayum, pkgname, ts_states=None):
return pkgname
class YumCliRPMCallBack(RPMBaseCallback):
@@ -6082,7 +6148,7 @@ index b6aa277..020e2b6 100755
width = property(lambda x: _term_width())
-@@ -2337,21 +3112,34 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -2337,21 +3117,34 @@ class YumCliRPMCallBack(RPMBaseCallback):
# Installing things have pkg objects passed to the events, so only need to
# lookup for erased/obsoleted.
def pkgname_ui(self, pkgname, ts_states=('e', 'od', 'ud', None)):
@@ -6127,7 +6193,7 @@ index b6aa277..020e2b6 100755
if type(package) not in types.StringTypes:
pkgname = str(package)
-@@ -2363,9 +3151,25 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -2363,9 +3156,25 @@ class YumCliRPMCallBack(RPMBaseCallback):
percent = 0
else:
percent = (te_current*100L)/te_total
@@ -6154,7 +6220,7 @@ index b6aa277..020e2b6 100755
pkgname=pkgname, wid1=wid1)
msg = fmt % (utf8_width_fill(process, wid1, wid1),
utf8_width_fill(pkgname, wid2, wid2))
-@@ -2377,6 +3181,11 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -2377,6 +3186,11 @@ class YumCliRPMCallBack(RPMBaseCallback):
print " "
def scriptout(self, package, msgs):
@@ -6166,7 +6232,7 @@ index b6aa277..020e2b6 100755
if msgs:
sys.stdout.write(to_unicode(msgs))
sys.stdout.flush()
-@@ -2396,7 +3205,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -2396,7 +3210,7 @@ class YumCliRPMCallBack(RPMBaseCallback):
pnl = utf8_width(pkgname)
overhead = (2 * l) + 2 # Length of done, above
@@ -6175,7 +6241,7 @@ index b6aa277..020e2b6 100755
overhead += 1 # Space between pn and done
overhead += 2 # Ends for progress
overhead += 1 # Space for end
-@@ -2429,8 +3238,30 @@ class YumCliRPMCallBack(RPMBaseCallback):
+@@ -2429,8 +3243,30 @@ class YumCliRPMCallBack(RPMBaseCallback):
wid2 = pnl
return fmt, wid1, wid2
@@ -186050,7 +186116,7 @@ index c1af4ad..e3e3956 100644
pass
diff --git a/yum/__init__.py b/yum/__init__.py
-index 99039e0..766f960 100644
+index 99039e0..543ca2d 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -21,6 +21,7 @@ The Yum RPM software updater.
@@ -187496,7 +187562,7 @@ index 99039e0..766f960 100644
urlgrabber.grabber.reset_curl_obj()
+ if downloadonly and not errors: # caller handles errors
-+ self.verbose_logger.info(_('exiting because --downloadonly specified'))
++ self.verbose_logger.info(_('exiting because "Download Only" specified'))
+ sys.exit(self.exit_code)
return errors
@@ -193359,10 +193425,10 @@ index 9889bf6..76a258d 100755
Setup the yum translation domain and make _() and P_() translation wrappers
diff --git a/yum/igroups.py b/yum/igroups.py
new file mode 100644
-index 0000000..6a04f3a
+index 0000000..467aa7b
--- /dev/null
+++ b/yum/igroups.py
-@@ -0,0 +1,267 @@
+@@ -0,0 +1,268 @@
+#! /usr/bin/python -tt
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
@@ -193537,7 +193603,8 @@ index 0000000..6a04f3a
+ fo.write("%u\n" % len(evgrp.grp_names))
+ for grpname in sorted(evgrp.grp_names):
+ fo.write("%s\n" % grpname)
-+ if self.groups[grpname].environment == evgrp.evgid:
++ if (grpname in self.groups and
++ self.groups[grpname].environment == evgrp.evgid):
+ fo.write("%s\n" % "true")
+ else:
+ fo.write("%s\n" % "false")
diff --git a/yum.spec b/yum.spec
index 9d1a3d9..4bc67b0 100644
--- a/yum.spec
+++ b/yum.spec
@@ -41,7 +41,7 @@ BuildRequires: bash-completion
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 85%{?dist}
+Release: 86%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -402,6 +402,11 @@ exit 0
%endif
%changelog
+* Tue Apr 23 2013 James Antill <james at fedoraproject.org> - 3.4.3-86
+- update to latest HEAD.
+- A fix for environments and not installed groups. BZ 928859.
+- Add downloadonly option to download prompt.
+
* Fri Apr 19 2013 James Antill <james at fedoraproject.org> - 3.4.3-85
- update to latest HEAD.
- A couple of fixes for yum-cron using security.
More information about the scm-commits
mailing list