[yum] Update to latest HEAD
Zdeněk Pavlas
zpavlas at fedoraproject.org
Wed Jun 20 15:03:41 UTC 2012
commit ee2516aae17cfa16dc477149591f68362b80d83b
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date: Wed Jun 20 17:03:31 2012 +0200
Update to latest HEAD
yum-HEAD.patch | 160 +++++++++++++++++++++++++++++++++++---------------------
yum.spec | 7 ++-
2 files changed, 107 insertions(+), 60 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 441a370..e1b3d73 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -149115,7 +149115,7 @@ index fa3e57c..ea4e683 100644
diff --git a/utils.py b/utils.py
old mode 100644
new mode 100755
-index ced6ba0..08b09fb
+index ced6ba0..e465cf7
--- a/utils.py
+++ b/utils.py
@@ -13,6 +13,9 @@
@@ -149191,10 +149191,24 @@ index ced6ba0..08b09fb
if not pid:
return
-@@ -106,6 +136,16 @@ def get_process_info(pid):
+@@ -63,12 +93,6 @@ def get_process_info(pid):
+ except ValueError, e:
+ return
+
+- # Maybe true if /proc isn't mounted, or not Linux ... or something.
+- if (not os.path.exists("/proc/%d/status" % pid) or
+- not os.path.exists("/proc/stat") or
+- not os.path.exists("/proc/%d/stat" % pid)):
+- return
+-
+ ps = {}
+ for line in open("/proc/%d/status" % pid):
+ if line[-1] != '\n':
+@@ -106,7 +130,21 @@ def get_process_info(pid):
return ps
def show_lock_owner(pid, logger):
+- ps = get_process_info(pid)
+ """Output information about another process that is holding the
+ yum lock.
+
@@ -149205,10 +149219,15 @@ index ced6ba0..08b09fb
+ This is the same as the dictionary returned by
+ :func:`get_process_info`.
+ """
- ps = get_process_info(pid)
++ try:
++ ps = get_process_info(pid)
++ except IOError, e:
++ logger.critical("%s", exception2msg(e))
++ ps = None
if not ps:
return None
-@@ -129,28 +169,9 @@ def show_lock_owner(pid, logger):
+
+@@ -129,28 +167,9 @@ def show_lock_owner(pid, logger):
return ps
@@ -149239,7 +149258,7 @@ index ced6ba0..08b09fb
def __init__(self,name,ver,usage):
YumBaseCli.__init__(self)
self._parser = YumOptionParser(base=self,utils=True,usage=usage)
-@@ -167,11 +188,22 @@ class YumUtilBase(YumBaseCli):
+@@ -167,11 +186,22 @@ class YumUtilBase(YumBaseCli):
self.run_with_package_names.add("yum-utils")
def exUserCancel(self):
@@ -149262,7 +149281,7 @@ index ced6ba0..08b09fb
if e.errno == 32:
self.logger.critical(_('\n\nExiting on Broken Pipe'))
else:
-@@ -180,10 +212,13 @@ class YumUtilBase(YumBaseCli):
+@@ -180,10 +210,13 @@ class YumUtilBase(YumBaseCli):
return 1
def exPluginExit(self, e):
@@ -149279,7 +149298,7 @@ index ced6ba0..08b09fb
exitmsg = exception2msg(e)
if exitmsg:
self.logger.warn('\n\n%s', exitmsg)
-@@ -191,11 +226,20 @@ class YumUtilBase(YumBaseCli):
+@@ -191,11 +224,20 @@ class YumUtilBase(YumBaseCli):
return 1
def exFatal(self, e):
@@ -149300,7 +149319,7 @@ index ced6ba0..08b09fb
try:
self.closeRpmDB()
self.doUnlock()
-@@ -205,13 +249,27 @@ class YumUtilBase(YumBaseCli):
+@@ -205,13 +247,27 @@ class YumUtilBase(YumBaseCli):
def getOptionParser(self):
@@ -149329,7 +149348,7 @@ index ced6ba0..08b09fb
lockerr = ""
while True:
try:
-@@ -233,6 +291,13 @@ class YumUtilBase(YumBaseCli):
+@@ -233,6 +289,13 @@ class YumUtilBase(YumBaseCli):
print "%s - %s (yum - %s)" % (self._utilName,self._utilVer,yum.__version__)
def doUtilConfigSetup(self,args = sys.argv[1:],pluginsTypes=(plugins.TYPE_CORE,)):
@@ -149343,7 +149362,7 @@ index ced6ba0..08b09fb
# Parse only command line options that affect basic yum setup
opts = self._parser.firstParse(args)
-@@ -305,8 +370,9 @@ class YumUtilBase(YumBaseCli):
+@@ -305,8 +368,9 @@ class YumUtilBase(YumBaseCli):
return opts
def doUtilYumSetup(self):
@@ -149355,7 +149374,7 @@ index ced6ba0..08b09fb
# FIXME - we need another way to do this, I think.
try:
self.waitForLock()
-@@ -319,6 +385,11 @@ class YumUtilBase(YumBaseCli):
+@@ -319,6 +383,11 @@ class YumUtilBase(YumBaseCli):
sys.exit(1)
def doUtilBuildTransaction(self, unfinished_transactions_check=True):
@@ -149367,7 +149386,7 @@ index ced6ba0..08b09fb
try:
(result, resultmsgs) = self.buildTransaction(unfinished_transactions_check = unfinished_transactions_check)
except plugins.PluginYumExit, e:
-@@ -361,6 +432,7 @@ class YumUtilBase(YumBaseCli):
+@@ -361,6 +430,7 @@ class YumUtilBase(YumBaseCli):
self.verbose_logger.log(logginglevels.INFO_2, _('\nDependencies Resolved'))
def doUtilTransaction(self):
@@ -156180,7 +156199,7 @@ index aaa4f25..51895fd 100755
continue
diff --git a/yum/misc.py b/yum/misc.py
-index 2f6ddfe..968b5eb 100644
+index 2f6ddfe..4cae42b 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -8,6 +8,7 @@ import os
@@ -156191,7 +156210,15 @@ index 2f6ddfe..968b5eb 100644
import struct
import re
import errno
-@@ -410,6 +411,17 @@ def procgpgkey(rawkey):
+@@ -21,6 +22,7 @@ import fnmatch
+ import bz2
+ import gzip
+ import shutil
++import urllib
+ _available_compression = ['gz', 'bz2']
+ try:
+ import lzma
+@@ -410,6 +412,17 @@ def procgpgkey(rawkey):
# Decode and return
return base64.decodestring(block.getvalue())
@@ -156209,7 +156236,16 @@ index 2f6ddfe..968b5eb 100644
def getgpgkeyinfo(rawkey, multiple=False):
'''Return a dict of info for the given ASCII armoured key text
-@@ -746,6 +758,8 @@ def _decompress_chunked(source, dest, ztype):
+@@ -611,6 +624,8 @@ def getCacheDir(tmpdir='/var/tmp', reuse=True, prefix='yum-'):
+ try:
+ usertup = pwd.getpwuid(uid)
+ username = usertup[0]
++ # we prefer ascii-only paths
++ username = urllib.quote(username)
+ except KeyError:
+ return None # if it returns None then, well, it's bollocksed
+
+@@ -746,6 +761,8 @@ def _decompress_chunked(source, dest, ztype):
data = s_fn.read(1024000)
except IOError:
break
@@ -156218,7 +156254,7 @@ index 2f6ddfe..968b5eb 100644
if not data: break
-@@ -940,14 +954,16 @@ def unlink_f(filename):
+@@ -940,14 +957,16 @@ def unlink_f(filename):
if e.errno != errno.ENOENT:
raise
@@ -156239,7 +156275,7 @@ index 2f6ddfe..968b5eb 100644
def _getloginuid():
""" Get the audit-uid/login-uid, if available. None is returned if there
-@@ -992,9 +1008,17 @@ def setup_locale(override_codecs=True, override_time=False):
+@@ -992,9 +1011,17 @@ def setup_locale(override_codecs=True, override_time=False):
locale.setlocale(locale.LC_ALL, 'C')
if override_codecs:
@@ -156260,7 +156296,7 @@ index 2f6ddfe..968b5eb 100644
def get_my_lang_code():
-@@ -1105,17 +1129,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
+@@ -1105,17 +1132,28 @@ def decompress(filename, dest=None, fn_only=False, check_timestamps=False):
out = filename.replace('.xz', '')
else:
@@ -157601,7 +157637,7 @@ index 2cb1acb..7da6a08 100644
self._md[item] = val
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..1cb4ae2 100644
+index e5e9ece..14f6d5f 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -157805,7 +157841,7 @@ index e5e9ece..1cb4ae2 100644
'http_headers': tuple(self.__headersListFromDict(cache=cache)),
'ssl_verify_peer': self.sslverify,
'ssl_verify_host': self.sslverify,
-@@ -531,9 +609,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -531,12 +609,11 @@ class YumRepository(Repository, config.RepoConf):
if os.path.exists(dpath) and os.path.isdir(dpath):
return
@@ -157815,7 +157851,12 @@ index e5e9ece..1cb4ae2 100644
try:
os.makedirs(dpath, mode=0755)
except OSError, e:
-@@ -751,7 +826,7 @@ class YumRepository(Repository, config.RepoConf):
++ if self.cache and e.errno == errno.EACCES:
++ raise Errors.RepoError, "Cannot access repository dir %s" % dpath
+ msg = "%s: %s %s: %s" % ("Error making cache directory",
+ dpath, "error was", e)
+ raise Errors.RepoError, msg
+@@ -751,7 +828,7 @@ class YumRepository(Repository, config.RepoConf):
def _getFile(self, url=None, relative=None, local=None, start=None, end=None,
copy_local=None, checkfunc=None, text=None, reget='simple',
@@ -157824,7 +157865,7 @@ index e5e9ece..1cb4ae2 100644
"""retrieve file from the mirrorgroup for the repo
relative to local, optionally get range from
start to end, also optionally retrieve from a specific baseurl"""
-@@ -796,6 +871,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -796,6 +873,16 @@ class YumRepository(Repository, config.RepoConf):
except Errors.MediaError, e:
verbose_logger.log(logginglevels.DEBUG_2, "Error getting package from media; falling back to url %s" %(e,))
@@ -157841,7 +157882,7 @@ index e5e9ece..1cb4ae2 100644
if url and scheme != "media":
ugopts = self._default_grabopts(cache=cache)
ug = URLGrabber(progress_obj = self.callback,
-@@ -835,7 +920,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -835,7 +922,8 @@ class YumRepository(Repository, config.RepoConf):
reget = reget,
checkfunc=checkfunc,
http_headers=headers,
@@ -157851,7 +157892,7 @@ index e5e9ece..1cb4ae2 100644
)
except URLGrabError, e:
errstr = "failure: %s from %s: %s" % (relative, self.id, e)
-@@ -847,7 +933,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -847,7 +935,7 @@ class YumRepository(Repository, config.RepoConf):
return result
__get = _getFile
@@ -157860,7 +157901,7 @@ index e5e9ece..1cb4ae2 100644
remote = package.relativepath
local = package.localPkg()
basepath = package.basepath
-@@ -864,6 +950,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -864,6 +952,7 @@ class YumRepository(Repository, config.RepoConf):
text=text,
cache=cache,
size=package.size,
@@ -157868,7 +157909,7 @@ index e5e9ece..1cb4ae2 100644
)
def getHeader(self, package, checkfunc = None, reget = 'simple',
-@@ -1020,7 +1107,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1020,7 +1109,7 @@ class YumRepository(Repository, config.RepoConf):
if grab_can_fail:
return None
raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -157877,7 +157918,7 @@ index e5e9ece..1cb4ae2 100644
misc.unlink_f(tfname)
if grab_can_fail:
return None
-@@ -1260,6 +1347,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1349,9 @@ class YumRepository(Repository, config.RepoConf):
return True
def _check_db_version(self, mdtype, repoXML=None):
@@ -157887,7 +157928,7 @@ index e5e9ece..1cb4ae2 100644
if repoXML is None:
repoXML = self.repoXML
if mdtype in repoXML.repoData:
-@@ -1277,11 +1367,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1369,11 @@ class YumRepository(Repository, config.RepoConf):
return None
if not file_check:
@@ -157902,7 +157943,7 @@ index e5e9ece..1cb4ae2 100644
if not os.path.exists(local):
local = misc.decompress(local, fn_only=True)
compressed = True
-@@ -1302,6 +1392,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1302,6 +1394,17 @@ class YumRepository(Repository, config.RepoConf):
into the delete list, this means metadata can change filename
without us leaking it. """
@@ -157920,7 +157961,7 @@ index e5e9ece..1cb4ae2 100644
def _mdtype_eq(omdtype, odata, nmdtype, ndata):
""" Check if two returns from _get_mdtype_data() are equal. """
if ndata is None:
-@@ -1333,8 +1434,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1333,8 +1436,7 @@ class YumRepository(Repository, config.RepoConf):
# Inited twice atm. ... sue me
self._oldRepoMDData['new_MD_files'] = []
@@ -157930,7 +157971,7 @@ index e5e9ece..1cb4ae2 100644
for mdtype in all_mdtypes:
(nmdtype, ndata) = self._get_mdtype_data(mdtype)
-@@ -1371,43 +1471,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1473,16 @@ class YumRepository(Repository, config.RepoConf):
# No old repomd data, but we might still have uncompressed MD
if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
@@ -157979,7 +158020,7 @@ index e5e9ece..1cb4ae2 100644
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,7 +1494,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,7 +1496,7 @@ class YumRepository(Repository, config.RepoConf):
self._commonRetrieveDataMD(mdtypes)
def _mdpolicy2mdtypes(self):
@@ -157988,7 +158029,7 @@ index e5e9ece..1cb4ae2 100644
'group:primary' : ['primary'],
'group:small' : ["primary", "updateinfo"],
'group:main' : ["primary", "group", "filelists",
-@@ -1436,6 +1509,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1511,7 @@ class YumRepository(Repository, config.RepoConf):
if not mdtypes or 'group:all' in mdtypes:
mdtypes = None
else:
@@ -157996,7 +158037,7 @@ index e5e9ece..1cb4ae2 100644
mdtypes = sorted(list(mdtypes))
return mdtypes
-@@ -1451,12 +1525,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1451,12 +1527,7 @@ class YumRepository(Repository, config.RepoConf):
def _getRepoXML(self):
if self._repoXML:
return self._repoXML
@@ -158010,7 +158051,7 @@ index e5e9ece..1cb4ae2 100644
return self._repoXML
-@@ -1514,7 +1583,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1514,7 +1585,7 @@ class YumRepository(Repository, config.RepoConf):
return self._checkMD(fn, mdtype, openchecksum)
def _checkMD(self, fn, mdtype, openchecksum=False,
@@ -158019,7 +158060,7 @@ index e5e9ece..1cb4ae2 100644
""" Internal function, use .checkMD() from outside yum. """
thisdata = data # So the argument name is nicer
-@@ -1537,6 +1606,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1608,18 @@ class YumRepository(Repository, config.RepoConf):
if size is not None:
size = int(size)
@@ -158038,7 +158079,7 @@ index e5e9ece..1cb4ae2 100644
try: # get the local checksum
l_csum = self._checksum(r_ctype, file, datasize=size)
except Errors.RepoError, e:
-@@ -1551,15 +1632,13 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1551,15 +1634,13 @@ class YumRepository(Repository, config.RepoConf):
return None
raise URLGrabError(-1, 'Metadata file does not match checksum')
@@ -158055,7 +158096,7 @@ index e5e9ece..1cb4ae2 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1575,6 +1654,12 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1575,6 +1656,12 @@ class YumRepository(Repository, config.RepoConf):
# got it, move along
return local
@@ -158068,7 +158109,7 @@ index e5e9ece..1cb4ae2 100644
if self.cache == 1:
if os.path.exists(local):
try:
-@@ -1590,14 +1675,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1590,14 +1677,10 @@ class YumRepository(Repository, config.RepoConf):
"Caching enabled but no local cache of %s from %s" % (local,
self)
@@ -158086,7 +158127,7 @@ index e5e9ece..1cb4ae2 100644
text = "%s/%s" % (self.id, mdtype)
if thisdata.size is None:
reget = None
-@@ -1613,8 +1694,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1696,9 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -158098,7 +158139,7 @@ index e5e9ece..1cb4ae2 100644
if retrieve_can_fail:
return None
raise
-@@ -1624,7 +1706,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1624,7 +1708,6 @@ class YumRepository(Repository, config.RepoConf):
raise Errors.RepoError, \
"Could not retrieve %s matching remote checksum from %s" % (local, self)
else:
@@ -160555,7 +160596,7 @@ index 4dcbea7..bc30bd4 100644
return True
diff --git a/yummain.py b/yummain.py
-index 9f79f4f..e3a232b 100755
+index 9f79f4f..648cf86 100755
--- a/yummain.py
+++ b/yummain.py
@@ -29,13 +29,13 @@ from yum import Errors
@@ -160617,29 +160658,30 @@ index 9f79f4f..e3a232b 100755
lockerr = ""
while True:
try:
-@@ -120,16 +126,16 @@ def main(args):
+@@ -120,16 +126,14 @@ def main(args):
if exception2msg(e) != lockerr:
lockerr = exception2msg(e)
logger.critical(lockerr)
- if (e.errno not in (errno.EPERM, errno.EACCES) and
- not base.conf.exit_on_lock):
+- logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
+- tm = 0.1
+- if show_lock_owner(e.pid, logger):
+- tm = 2
+- time.sleep(tm)
+- elif e.errno in (errno.EPERM, errno.EACCES):
+ if e.errno in (errno.EPERM, errno.EACCES, errno.ENOSPC):
-+ logger.critical(_("Can't create lock file; exiting"))
-+ return 1
+ logger.critical(_("Can't create lock file; exiting"))
+ return 1
+
+ if not base.conf.exit_on_lock:
- logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
- tm = 0.1
- if show_lock_owner(e.pid, logger):
- tm = 2
- time.sleep(tm)
-- elif e.errno in (errno.EPERM, errno.EACCES):
-- logger.critical(_("Can't create lock file; exiting"))
-- return 1
++ logger.critical(_("Another app is currently holding the yum lock; waiting for it to exit..."))
++ show_lock_owner(e.pid, logger)
++ time.sleep(2)
else:
logger.critical(_("Another app is currently holding the yum lock; exiting as configured by exit_on_lock"))
return 1
-@@ -154,7 +160,7 @@ def main(args):
+@@ -154,7 +158,7 @@ def main(args):
for msg in resultmsgs:
verbose_logger.log(logginglevels.INFO_2, '%s', msg)
if unlock(): return 200
@@ -160648,7 +160690,7 @@ index 9f79f4f..e3a232b 100755
elif result == 1:
# Fatal error
for msg in resultmsgs:
-@@ -193,7 +199,7 @@ def main(args):
+@@ -193,7 +197,7 @@ def main(args):
if result == 0:
# Normal exit
if unlock(): return 200
@@ -160657,7 +160699,7 @@ index 9f79f4f..e3a232b 100755
elif result == 1:
# Fatal error
for msg in resultmsgs:
-@@ -238,16 +244,27 @@ def main(args):
+@@ -238,16 +242,27 @@ def main(args):
rpmdb_warn_checks()
return_code = result
if base._ts_save_file:
@@ -160687,7 +160729,7 @@ index 9f79f4f..e3a232b 100755
import hotshot.stats
fn = os.path.expanduser("~/yum.prof")
prof = hotshot.Profile(fn)
-@@ -257,6 +274,11 @@ def hotshot(func, *args, **kwargs):
+@@ -257,6 +272,11 @@ def hotshot(func, *args, **kwargs):
return rc
def cprof(func, *args, **kwargs):
@@ -160699,7 +160741,7 @@ index 9f79f4f..e3a232b 100755
import cProfile, pstats
fn = os.path.expanduser("~/yum.prof")
prof = cProfile.Profile()
-@@ -266,6 +288,10 @@ def cprof(func, *args, **kwargs):
+@@ -266,6 +286,10 @@ def cprof(func, *args, **kwargs):
return rc
def print_stats(stats):
@@ -160710,7 +160752,7 @@ index 9f79f4f..e3a232b 100755
stats.strip_dirs()
stats.sort_stats('time', 'calls')
stats.print_stats(20)
-@@ -273,7 +299,14 @@ def print_stats(stats):
+@@ -273,7 +297,14 @@ def print_stats(stats):
stats.print_stats(40)
def user_main(args, exit_code=False):
diff --git a/yum.spec b/yum.spec
index 8ba36c5..c2511ad 100644
--- a/yum.spec
+++ b/yum.spec
@@ -18,7 +18,7 @@
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 28%{?dist}
+Release: 29%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -313,6 +313,11 @@ exit 0
%endif
%changelog
+* Thu Jun 20 2012 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-29
+- update to latest HEAD.
+- quote uids to keep cachedir ascii-clean. BZ 832195
+- show_lock_owner: report errors if we fail. BZ 745281
+
* Thu Jun 14 2012 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-28
- update to latest HEAD.
- No async downloading when --cacheonly. BZ 830523
More information about the scm-commits
mailing list