[yum] update to latest HEAD
James Antill
james at fedoraproject.org
Wed May 21 21:04:12 UTC 2014
commit 13cd8412befb3afa0ce64d968ca3868bbf39f93d
Author: James Antill <james at and.org>
Date: Wed May 21 17:04:01 2014 -0400
update to latest HEAD
- Check /usr for writability before running a transaction.
- Add repo= arguments to almost all RepoError raises, so we don't print unknown.
- Add/fix upgrade-minimal typos from man page.
- Replace vars in include lines in .repo files. BZ 977380.
- Make --setopt handle spaces properly. BZ 1094373
- Fix traceback when the history dir is empty. BZ 875610
yum-HEAD.patch | 878 ++++++++++++++++++++++++++++++++++++--------------------
yum.spec | 11 +-
2 files changed, 570 insertions(+), 319 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index eb0bb98..66f69bd 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -109,7 +109,7 @@ index 2f6154e..2e5a052 100644
diff --git a/cli.py b/cli.py
old mode 100644
new mode 100755
-index 6056d38..c1ef023
+index 6056d38..aa73278
--- a/cli.py
+++ b/cli.py
@@ -25,7 +25,7 @@ import sys
@@ -225,7 +225,7 @@ index 6056d38..c1ef023
+ if len(vals) < 2:
+ bad_setopt_ne.append(item)
+ continue
-+ k,v = vals
++ k, v = [i.strip() for i in vals]
+ period = k.rfind('.')
if period != -1:
repo = k[:period]
@@ -2820,14 +2820,14 @@ index 0000000..7ce1aef
+ the mailing list, yum at lists.baseurl.org, or consult bugzilla.
+.fi
diff --git a/docs/yum.8 b/docs/yum.8
-index 1a8202a..3f028f8 100644
+index 1a8202a..86df6b0 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -25,6 +25,8 @@ gnome\-packagekit application\&.
.br
.I \fR * update-to [package1] [package2] [\&.\&.\&.]
.br
-+.I \fR * minimal-update [package1] [package2] [\&.\&.\&.]
++.I \fR * update-minimal [package1] [package2] [\&.\&.\&.]
+.br
.I \fR * check\-update
.br
@@ -3619,7 +3619,7 @@ index 1a8202a..3f028f8 100644
http://yum.baseurl.org/wiki/Faq
yum search yum
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
-index 515aa73..4ec7689 100644
+index 515aa73..c39544d 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -64,7 +64,7 @@ options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
@@ -4027,7 +4027,7 @@ index 515aa73..4ec7689 100644
\fBcolor_search_match \fR
The colorization/highlighting for text matches in search.
Default is `bold'.
-@@ -587,14 +799,98 @@ be downloaded. The updates list is what is printed when you run "yum update",
+@@ -587,15 +799,104 @@ be downloaded. The updates list is what is printed when you run "yum update",
Default is `normal'.
See color_list_installed_older for possible values.
@@ -4095,7 +4095,7 @@ index 515aa73..4ec7689 100644
+\fBfssnap_automatic_pre\fR
+Should yum try to automatically create a snapshot before it runs a transaction.
+Boolean (1, 0, True, False, yes, no) Defaults to False
-+
+
+.IP
+\fBfssnap_automatic_post\fR
+Should yum try to automatically create a snapshot after it runs a transaction.
@@ -4123,10 +4123,16 @@ index 515aa73..4ec7689 100644
+shouldn't be needed as yum should always solve or fail, however it has been
+observed that it can loop forever with very large system upgrades. Setting
+this to `0' (or "<forever>") makes yum try forever. Default is `100'.
-
++
++.IP
++\fBusr_w_check\fR
++Either `0' or `1'. Set this to `0' to disable the checking for writability on
++/usr in the installroot (when going into the depsolving stage). Default is `1'
++(perform the check).
.SH "[repository] OPTIONS"
-@@ -668,6 +964,10 @@ value of mirrorlist is copied to metalink (if metalink is not set).
+ .LP
+@@ -668,6 +969,10 @@ value of mirrorlist is copied to metalink (if metalink is not set).
Either `1' or `0'. This tells yum whether or not use this repository.
.IP
@@ -4137,7 +4143,7 @@ index 515aa73..4ec7689 100644
\fBgpgcheck\fR
Either `1' or `0'. This tells yum whether or not it should perform a GPG
signature check on the packages gotten from this repository.
-@@ -702,12 +1002,18 @@ key will be automatically imported without user confirmation.
+@@ -702,12 +1007,18 @@ key will be automatically imported without user confirmation.
Same as the [main] \fBexclude\fR option but only for this repository.
Substitution variables, described below, are honored here.
@@ -4160,7 +4166,7 @@ index 515aa73..4ec7689 100644
.IP
\fBenablegroups\fR
-@@ -755,6 +1061,20 @@ repository.
+@@ -755,6 +1066,20 @@ repository.
Overrides the \fBbandwidth\fR option from the [main] section for this
repository.
@@ -4181,7 +4187,7 @@ index 515aa73..4ec7689 100644
.IP
\fBsslcacert \fR
-@@ -776,6 +1096,10 @@ repository.
+@@ -776,6 +1101,10 @@ repository.
Overrides the \fBsslclientkey\fR option from the [main] section for this
repository.
@@ -4192,7 +4198,7 @@ index 515aa73..4ec7689 100644
.IP
\fBmetadata_expire \fR
-@@ -783,6 +1107,11 @@ Overrides the \fBmetadata_expire\fR option from the [main] section for this
+@@ -783,6 +1112,11 @@ Overrides the \fBmetadata_expire\fR option from the [main] section for this
repository.
.IP
@@ -4204,7 +4210,7 @@ index 515aa73..4ec7689 100644
\fBmirrorlist_expire \fR
Overrides the \fBmirrorlist_expire\fR option from the [main] section for this
repository.
-@@ -824,7 +1153,16 @@ as greater/less than any other. defaults to 1000
+@@ -824,7 +1158,16 @@ as greater/less than any other. defaults to 1000
If set to True yum will continue running if this repository cannot be
contacted for any reason. This should be set carefully as all repos are consulted
for any given command. Defaults to False.
@@ -4221,7 +4227,7 @@ index 515aa73..4ec7689 100644
.SH "URL INCLUDE SYNTAX"
.LP
-@@ -861,8 +1199,8 @@ package.
+@@ -861,8 +1204,8 @@ package.
.IP
\fB$arch\fR
@@ -187026,7 +187032,7 @@ index abd203f..854baf3 100644
- 3.4.1
- umask bug fix.
diff --git a/yum/Errors.py b/yum/Errors.py
-index c1af4ad..2c2f022 100644
+index c1af4ad..f69c061 100644
--- a/yum/Errors.py
+++ b/yum/Errors.py
@@ -18,7 +18,7 @@
@@ -187047,7 +187053,17 @@ index c1af4ad..2c2f022 100644
def __unicode__(self):
return '%s' % to_unicode(self.value)
-@@ -79,9 +79,20 @@ class RepoError(YumBaseError):
+@@ -74,14 +74,32 @@ class DepError(YumBaseError):
+ pass
+
+ class RepoError(YumBaseError):
+- pass
++ def __init__(self, value=None, repo=None):
++ Exception.__init__(self)
++ self.value = value
++ if repo is not None:
++ self.repo = repo
+
class DuplicateRepoError(RepoError):
pass
@@ -187055,10 +187071,13 @@ index c1af4ad..2c2f022 100644
class NoMoreMirrorsRepoError(RepoError):
- pass
-
-+ def __init__(self, value=None, errors=None):
++ # Weird backcompat. on argument ordering.
++ def __init__(self, value=None, errors=None, repo=None):
+ Exception.__init__(self)
+ self._value = value
+ self.errors = errors
++ if repo is not None:
++ self.repo = repo
+
+ @property
+ def value(self):
@@ -187070,7 +187089,7 @@ index c1af4ad..2c2f022 100644
class ConfigError(YumBaseError):
pass
-@@ -94,6 +105,9 @@ class GroupsError(YumBaseError):
+@@ -94,6 +112,9 @@ class GroupsError(YumBaseError):
class InstallError(YumBaseError):
pass
@@ -187081,7 +187100,7 @@ index c1af4ad..2c2f022 100644
pass
diff --git a/yum/__init__.py b/yum/__init__.py
-index 99039e0..ac01435 100644
+index 99039e0..bf13f40 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -21,6 +21,7 @@ The Yum RPM software updater.
@@ -187644,7 +187663,17 @@ index 99039e0..ac01435 100644
repo.groups_added = False
self._comps = val
-@@ -813,6 +936,21 @@ class YumBase(depsolve.Depsolve):
+@@ -801,7 +924,8 @@ class YumBase(depsolve.Depsolve):
+ continue
+
+ if not repo.ready():
+- raise Errors.RepoError, "Repository '%s' not yet setup" % repo
++ raise Errors.RepoError("Repository '%s' not yet setup" % repo,
++ repo=repo)
+ try:
+ groupremote = repo.getGroupLocation()
+ except Errors.RepoMDError, e:
+@@ -813,6 +937,21 @@ class YumBase(depsolve.Depsolve):
overwrite = self.conf.overwrite_groups
self._comps = comps.Comps(overwrite_groups = overwrite)
@@ -187666,7 +187695,7 @@ index 99039e0..ac01435 100644
for repo in reposWithGroups:
if repo.groups_added: # already added the groups from this repo
continue
-@@ -820,16 +958,14 @@ class YumBase(depsolve.Depsolve):
+@@ -820,16 +959,14 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.log(logginglevels.DEBUG_4,
_('Adding group file from repository: %s'), repo)
groupfile = repo.getGroups()
@@ -187688,7 +187717,7 @@ index 99039e0..ac01435 100644
self.logger.critical(msg)
else:
repo.groups_added = True
-@@ -837,7 +973,10 @@ class YumBase(depsolve.Depsolve):
+@@ -837,7 +974,10 @@ class YumBase(depsolve.Depsolve):
if self._comps.compscount == 0:
raise Errors.GroupsError, _('No Groups Available in any repository')
@@ -187700,7 +187729,7 @@ index 99039e0..ac01435 100644
self.verbose_logger.debug('group time: %0.3f' % (time.time() - group_st))
return self._comps
-@@ -868,22 +1007,72 @@ class YumBase(depsolve.Depsolve):
+@@ -868,22 +1008,72 @@ class YumBase(depsolve.Depsolve):
# feed it into _tags.add()
self._tags.add(repo.id, tag_sqlite)
except (Errors.RepoError, Errors.PkgTagsError), e:
@@ -187775,7 +187804,7 @@ index 99039e0..ac01435 100644
# properties so they auto-create themselves with defaults
repos = property(fget=lambda self: self._getRepos(),
fset=lambda self, value: setattr(self, "_repos", value),
-@@ -921,16 +1110,31 @@ class YumBase(depsolve.Depsolve):
+@@ -921,16 +1111,31 @@ class YumBase(depsolve.Depsolve):
fdel=lambda self: setattr(self, "_history", None),
doc="Yum History Object")
@@ -187811,7 +187840,7 @@ index 99039e0..ac01435 100644
necessary = False
# I can't think of a nice way of doing this, we have to have the sack here
-@@ -951,25 +1155,37 @@ class YumBase(depsolve.Depsolve):
+@@ -951,25 +1156,37 @@ class YumBase(depsolve.Depsolve):
self.repos.populateSack(mdtype='filelists')
def yumUtilsMsg(self, func, prog):
@@ -187860,7 +187889,7 @@ index 99039e0..ac01435 100644
self.logger.critical(msg)
self.yumUtilsMsg(self.logger.critical, "yum-complete-transaction")
time.sleep(3)
-@@ -1004,7 +1220,7 @@ class YumBase(depsolve.Depsolve):
+@@ -1004,7 +1221,7 @@ class YumBase(depsolve.Depsolve):
# If transaction was changed by postresolve plugins then we should run skipbroken again
(rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False )
@@ -187869,7 +187898,7 @@ index 99039e0..ac01435 100644
self.tsInfo.pkgSack.dropCachedData()
# FIXME: This is horrible, see below and yummain. Maybe create a real
-@@ -1044,6 +1260,39 @@ class YumBase(depsolve.Depsolve):
+@@ -1044,6 +1261,39 @@ class YumBase(depsolve.Depsolve):
if first.verEQ(other):
continue
msg = _('Protected multilib versions: %s != %s')
@@ -187909,7 +187938,7 @@ index 99039e0..ac01435 100644
xrestring.append(msg % (first, other))
if xrestring:
rescode = 1
-@@ -1227,7 +1476,7 @@ class YumBase(depsolve.Depsolve):
+@@ -1227,7 +1477,7 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.info(msg)
self.skipped_packages.extend(skipped_list) # make the skipped packages public
else:
@@ -187918,7 +187947,7 @@ index 99039e0..ac01435 100644
self.verbose_logger.info("Skip-broken could not solve problems")
return 1, orig_restring
return rescode, restring
-@@ -1242,13 +1491,15 @@ class YumBase(depsolve.Depsolve):
+@@ -1242,13 +1492,15 @@ class YumBase(depsolve.Depsolve):
if None in pkgtup:
return None
return pkgtup
@@ -187938,7 +187967,7 @@ index 99039e0..ac01435 100644
if pkgtup is None:
return
self._not_found_i[pkgtup] = YumNotFoundPackage(pkgtup)
-@@ -1267,7 +1518,7 @@ class YumBase(depsolve.Depsolve):
+@@ -1267,7 +1519,7 @@ class YumBase(depsolve.Depsolve):
for pkg in txmbr.obsoleted_by:
# check if the obsoleting txmbr is in the transaction
# else remove the obsoleted txmbr
@@ -187947,7 +187976,7 @@ index 99039e0..ac01435 100644
if not self.tsInfo.exists(pkg.pkgtup):
self.verbose_logger.debug('SKIPBROKEN: Remove extra obsoleted %s (%s)' % (txmbr.po,pkg) )
self.tsInfo.remove(txmbr.po.pkgtup)
-@@ -1275,14 +1526,14 @@ class YumBase(depsolve.Depsolve):
+@@ -1275,14 +1527,14 @@ class YumBase(depsolve.Depsolve):
def _checkUpdatedLeftovers(self):
"""
If multiple packages is updated the same package
@@ -187964,7 +187993,7 @@ index 99039e0..ac01435 100644
if not self.tsInfo.exists(pkg.pkgtup):
self.verbose_logger.debug('SKIPBROKEN: Remove extra updated %s (%s)' % (txmbr.po,pkg) )
self.tsInfo.remove(txmbr.po.pkgtup)
-@@ -1379,9 +1630,19 @@ class YumBase(depsolve.Depsolve):
+@@ -1379,9 +1631,19 @@ class YumBase(depsolve.Depsolve):
def _getDepsToRemove(self,po, deptree, toRemove):
for dep in deptree.get(po, []): # Loop trough all deps of po
@@ -187984,7 +188013,7 @@ index 99039e0..ac01435 100644
toRemove.add(dep)
self._getDepsToRemove(dep, deptree, toRemove)
-@@ -1454,7 +1715,46 @@ class YumBase(depsolve.Depsolve):
+@@ -1454,7 +1716,46 @@ class YumBase(depsolve.Depsolve):
return probs
def runTransaction(self, cb):
@@ -188032,7 +188061,7 @@ index 99039e0..ac01435 100644
self.plugins.run('pretrans')
-@@ -1516,10 +1816,23 @@ class YumBase(depsolve.Depsolve):
+@@ -1516,10 +1817,23 @@ class YumBase(depsolve.Depsolve):
pass
self._ts_save_file = None
@@ -188056,7 +188085,7 @@ index 99039e0..ac01435 100644
# make resultobject - just a plain yumgenericholder object
resultobject = misc.GenericHolder()
-@@ -1544,8 +1857,7 @@ class YumBase(depsolve.Depsolve):
+@@ -1544,8 +1858,7 @@ class YumBase(depsolve.Depsolve):
errors=errors)
@@ -188066,7 +188095,7 @@ index 99039e0..ac01435 100644
self.cleanUsedHeadersPackages()
for i in ('ts_all_fn', 'ts_done_fn'):
-@@ -1567,13 +1879,35 @@ class YumBase(depsolve.Depsolve):
+@@ -1567,13 +1880,35 @@ class YumBase(depsolve.Depsolve):
self.plugins.run('posttrans')
# sync up what just happened versus what is in the rpmdb
if not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST):
@@ -188107,7 +188136,7 @@ index 99039e0..ac01435 100644
# check to see that the rpmdb and the tsInfo roughly matches
# push package object metadata outside of rpmdb into yumdb
# delete old yumdb metadata entries
-@@ -1584,24 +1918,58 @@ class YumBase(depsolve.Depsolve):
+@@ -1584,24 +1919,58 @@ class YumBase(depsolve.Depsolve):
# that there is not also an install of this pkg in the tsInfo (reinstall)
# for any kind of install add from_repo to the yumdb, and the cmdline
# and the install reason
@@ -188168,7 +188197,7 @@ index 99039e0..ac01435 100644
if hasattr(self, 'args') and self.args:
po.yumdb_info.command_line = ' '.join(self.args)
elif hasattr(self, 'cmds') and self.cmds:
-@@ -1630,6 +1998,10 @@ class YumBase(depsolve.Depsolve):
+@@ -1630,6 +1999,10 @@ class YumBase(depsolve.Depsolve):
if md:
po.yumdb_info.from_repo_timestamp = str(md.timestamp)
@@ -188179,7 +188208,7 @@ index 99039e0..ac01435 100644
loginuid = misc.getloginuid()
if txmbr.updates or txmbr.downgrades or txmbr.reinstall:
if txmbr.updates:
-@@ -1640,11 +2012,16 @@ class YumBase(depsolve.Depsolve):
+@@ -1640,11 +2013,16 @@ class YumBase(depsolve.Depsolve):
opo = po
if 'installed_by' in opo.yumdb_info:
po.yumdb_info.installed_by = opo.yumdb_info.installed_by
@@ -188196,7 +188225,7 @@ index 99039e0..ac01435 100644
# Remove old ones after installing new ones, so we can copy values.
for txmbr in self.tsInfo:
if txmbr.output_state in TS_INSTALL_STATES:
-@@ -1662,10 +2039,13 @@ class YumBase(depsolve.Depsolve):
+@@ -1662,10 +2040,13 @@ class YumBase(depsolve.Depsolve):
' but is not!' % txmbr.po))
# Note: Get Panu to do te.Failed() so we don't have to
txmbr.output_state = TS_FAILED
@@ -188210,7 +188239,7 @@ index 99039e0..ac01435 100644
self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po)
self.plugins.run('postverifytrans')
-@@ -1680,10 +2060,11 @@ class YumBase(depsolve.Depsolve):
+@@ -1680,10 +2061,11 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st))
def costExcludePackages(self):
@@ -188226,7 +188255,7 @@ index 99039e0..ac01435 100644
# if all the repo.costs are equal then don't bother running things
costs = {}
for r in self.repos.listEnabled():
-@@ -1705,10 +2086,12 @@ class YumBase(depsolve.Depsolve):
+@@ -1705,10 +2087,12 @@ class YumBase(depsolve.Depsolve):
done = True
def excludePackages(self, repo=None):
@@ -188242,7 +188271,7 @@ index 99039e0..ac01435 100644
if "all" in self.conf.disable_excludes:
return
-@@ -1735,9 +2118,14 @@ class YumBase(depsolve.Depsolve):
+@@ -1735,9 +2119,14 @@ class YumBase(depsolve.Depsolve):
self.pkgSack.addPackageExcluder(repoid, exid,'exclude.match', match)
def includePackages(self, repo):
@@ -188260,7 +188289,7 @@ index 99039e0..ac01435 100644
includelist = repo.getIncludePkgList()
if len(includelist) == 0:
-@@ -1757,8 +2145,11 @@ class YumBase(depsolve.Depsolve):
+@@ -1757,8 +2146,11 @@ class YumBase(depsolve.Depsolve):
self.pkgSack.addPackageExcluder(repo.id, exid, 'exclude.marked')
def doLock(self, lockfile = YUM_PID_FILE):
@@ -188274,7 +188303,7 @@ index 99039e0..ac01435 100644
if self.conf.uid != 0:
# If we are a user, assume we are using the root cache ... so don't
# bother locking.
-@@ -1773,39 +2164,39 @@ class YumBase(depsolve.Depsolve):
+@@ -1773,39 +2165,39 @@ class YumBase(depsolve.Depsolve):
lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra /
mypid=str(os.getpid())
@@ -188342,7 +188371,7 @@ index 99039e0..ac01435 100644
# if we're not root then we don't lock - just return nicely
# Note that we can get here from __del__, so if we haven't created
# YumBase.conf we don't want to do so here as creating stuff inside
-@@ -1830,31 +2221,74 @@ class YumBase(depsolve.Depsolve):
+@@ -1830,31 +2222,74 @@ class YumBase(depsolve.Depsolve):
self._unlock(lockfile)
self._lockfile = None
@@ -188429,7 +188458,7 @@ index 99039e0..ac01435 100644
failed = False
if type(fo) is types.InstanceType:
-@@ -1877,10 +2311,10 @@ class YumBase(depsolve.Depsolve):
+@@ -1877,10 +2312,10 @@ class YumBase(depsolve.Depsolve):
cursize = os.stat(fo)[6]
totsize = long(po.size)
if cursize >= totsize and not po.repo.cache:
@@ -188443,7 +188472,7 @@ index 99039e0..ac01435 100644
os.unlink(fo)
if raiseError:
-@@ -1894,9 +2328,16 @@ class YumBase(depsolve.Depsolve):
+@@ -1894,9 +2329,16 @@ class YumBase(depsolve.Depsolve):
def verifyChecksum(self, fo, checksumType, csum):
@@ -188463,7 +188492,7 @@ index 99039e0..ac01435 100644
try:
filesum = misc.checksum(checksumType, fo)
except Errors.MiscError, e:
-@@ -1908,13 +2349,26 @@ class YumBase(depsolve.Depsolve):
+@@ -1908,13 +2350,26 @@ class YumBase(depsolve.Depsolve):
return 0
def downloadPkgs(self, pkglist, callback=None, callback_total=None):
@@ -188491,7 +188520,7 @@ index 99039e0..ac01435 100644
if a is None:
return -1
if b is None:
-@@ -1925,12 +2379,11 @@ class YumBase(depsolve.Depsolve):
+@@ -1925,12 +2380,11 @@ class YumBase(depsolve.Depsolve):
return 1
return 0
@@ -188506,7 +188535,7 @@ index 99039e0..ac01435 100644
# We close the history DB here because some plugins (presto) use
# threads. And sqlite really doesn't like threads. And while I don't
-@@ -1943,116 +2396,215 @@ class YumBase(depsolve.Depsolve):
+@@ -1943,116 +2397,215 @@ class YumBase(depsolve.Depsolve):
self.history.close()
self.plugins.run('predownload', pkglist=pkglist)
@@ -188811,7 +188840,7 @@ index 99039e0..ac01435 100644
if type(fo) is types.InstanceType:
fo = fo.filename
-@@ -2076,9 +2628,12 @@ class YumBase(depsolve.Depsolve):
+@@ -2076,9 +2629,12 @@ class YumBase(depsolve.Depsolve):
return 1
def downloadHeader(self, po):
@@ -188826,7 +188855,18 @@ index 99039e0..ac01435 100644
if hasattr(po, 'pkgtype') and po.pkgtype == 'local':
return
-@@ -2122,15 +2677,17 @@ class YumBase(depsolve.Depsolve):
+@@ -2097,8 +2653,8 @@ class YumBase(depsolve.Depsolve):
+ return
+ else:
+ if self.conf.cache:
+- raise Errors.RepoError, \
+- _('Header not in local cache and caching-only mode enabled. Cannot download %s') % po.hdrpath
++ raise Errors.RepoError(_('Header not in local cache and caching-only mode enabled. Cannot download %s') % po.hdrpath,
++ repo=repo)
+
+ if self.dsCallback: self.dsCallback.downloadHeader(po.name)
+
+@@ -2122,15 +2678,17 @@ class YumBase(depsolve.Depsolve):
return
def sigCheckPkg(self, po):
@@ -188852,7 +188892,7 @@ index 99039e0..ac01435 100644
if self._override_sigchecks:
check = False
hasgpgkey = 0
-@@ -2181,6 +2738,9 @@ class YumBase(depsolve.Depsolve):
+@@ -2181,6 +2739,9 @@ class YumBase(depsolve.Depsolve):
return result, msg
def cleanUsedHeadersPackages(self):
@@ -188862,7 +188902,7 @@ index 99039e0..ac01435 100644
filelist = []
for txmbr in self.tsInfo:
if txmbr.po.state not in TS_INSTALL_STATES:
-@@ -2189,6 +2749,8 @@ class YumBase(depsolve.Depsolve):
+@@ -2189,6 +2750,8 @@ class YumBase(depsolve.Depsolve):
continue
if txmbr.po.repoid not in self.repos.repos:
continue
@@ -188871,7 +188911,7 @@ index 99039e0..ac01435 100644
# make sure it's not a local file
repo = self.repos.repos[txmbr.po.repoid]
-@@ -2218,27 +2780,42 @@ class YumBase(depsolve.Depsolve):
+@@ -2218,27 +2781,42 @@ class YumBase(depsolve.Depsolve):
_('%s removed'), fn)
def cleanHeaders(self):
@@ -188916,7 +188956,7 @@ index 99039e0..ac01435 100644
cachedir = self.conf.persistdir + "/rpmdb-indexes/"
if not os.path.exists(cachedir):
filelist = []
-@@ -2271,9 +2848,31 @@ class YumBase(depsolve.Depsolve):
+@@ -2271,9 +2849,31 @@ class YumBase(depsolve.Depsolve):
return 0, [msg]
def doPackageLists(self, pkgnarrow='all', patterns=None, showdups=None,
@@ -188951,7 +188991,7 @@ index 99039e0..ac01435 100644
if showdups is None:
showdups = self.conf.showdupesfromrepos
ygh = misc.GenericHolder(iter=pkgnarrow)
-@@ -2295,6 +2894,8 @@ class YumBase(depsolve.Depsolve):
+@@ -2295,6 +2895,8 @@ class YumBase(depsolve.Depsolve):
ndinst = {} # Newest versions by name.arch
for po in self.rpmdb.returnPackages(patterns=patterns,
ignore_case=ic):
@@ -188960,7 +189000,7 @@ index 99039e0..ac01435 100644
dinst[po.pkgtup] = po
if showdups:
continue
-@@ -2304,8 +2905,13 @@ class YumBase(depsolve.Depsolve):
+@@ -2304,8 +2906,13 @@ class YumBase(depsolve.Depsolve):
installed = dinst.values()
if showdups:
@@ -188975,7 +189015,7 @@ index 99039e0..ac01435 100644
else:
try:
avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
-@@ -2323,16 +2929,31 @@ class YumBase(depsolve.Depsolve):
+@@ -2323,16 +2930,31 @@ class YumBase(depsolve.Depsolve):
key = (pkg.name, pkg.arch)
if pkg.pkgtup in dinst:
reinstall_available.append(pkg)
@@ -189010,7 +189050,7 @@ index 99039e0..ac01435 100644
if len(matches) > 1:
updates.append(matches[0])
self.verbose_logger.log(logginglevels.DEBUG_1,
-@@ -2352,13 +2973,19 @@ class YumBase(depsolve.Depsolve):
+@@ -2352,13 +2974,19 @@ class YumBase(depsolve.Depsolve):
elif pkgnarrow == 'installed':
installed = self.rpmdb.returnPackages(patterns=patterns,
ignore_case=ic)
@@ -189031,7 +189071,7 @@ index 99039e0..ac01435 100644
else:
try:
avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
-@@ -2392,9 +3019,21 @@ class YumBase(depsolve.Depsolve):
+@@ -2392,9 +3020,21 @@ class YumBase(depsolve.Depsolve):
avail = set(avail)
for po in self.rpmdb.returnPackages(patterns=patterns,
ignore_case=ic):
@@ -189053,7 +189093,7 @@ index 99039e0..ac01435 100644
# obsoleting packages (and what they obsolete)
elif pkgnarrow == 'obsoletes':
self.conf.obsoletes = 1
-@@ -2402,6 +3041,7 @@ class YumBase(depsolve.Depsolve):
+@@ -2402,6 +3042,7 @@ class YumBase(depsolve.Depsolve):
for (pkgtup, instTup) in self.up.getObsoletesTuples():
(n,a,e,v,r) = pkgtup
pkgs = self.pkgSack.searchNevra(name=n, arch=a, ver=v, rel=r, epoch=e)
@@ -189061,7 +189101,7 @@ index 99039e0..ac01435 100644
instpo = self.getInstalledPackageObject(instTup)
for po in pkgs:
obsoletes.append(po)
-@@ -2433,7 +3073,12 @@ class YumBase(depsolve.Depsolve):
+@@ -2433,7 +3074,12 @@ class YumBase(depsolve.Depsolve):
recentlimit = now-(self.conf.recent*86400)
if showdups:
avail = self.pkgSack.returnPackages(patterns=patterns,
@@ -189075,7 +189115,7 @@ index 99039e0..ac01435 100644
else:
try:
avail = self.pkgSack.returnNewestByNameArch(patterns=patterns,
-@@ -2461,14 +3106,13 @@ class YumBase(depsolve.Depsolve):
+@@ -2461,14 +3107,13 @@ class YumBase(depsolve.Depsolve):
def findDeps(self, pkgs):
@@ -189095,7 +189135,7 @@ index 99039e0..ac01435 100644
results = {}
for pkg in pkgs:
-@@ -2495,10 +3139,22 @@ class YumBase(depsolve.Depsolve):
+@@ -2495,10 +3140,22 @@ class YumBase(depsolve.Depsolve):
# pre 3.2.10 API used to always showdups, so that's the default atm.
def searchGenerator(self, fields, criteria, showdups=True, keys=False,
searchtags=True, searchrpmdb=True):
@@ -189122,7 +189162,7 @@ index 99039e0..ac01435 100644
sql_fields = []
for f in fields:
sql_fields.append(RPM_TO_SQLITE.get(f, f))
-@@ -2614,7 +3270,7 @@ class YumBase(depsolve.Depsolve):
+@@ -2614,7 +3271,7 @@ class YumBase(depsolve.Depsolve):
# ...but without showdups we want to output _just_ #3, which requires
# we find the newest EVR po for the best "matching value". Without keys
# it's the same, except we just want the newest EVR.
@@ -189131,7 +189171,7 @@ index 99039e0..ac01435 100644
# either, so it's pretty thankless. HTH. HAND.
# By default just sort using package sorting
sort_func = operator.itemgetter(0)
-@@ -2661,6 +3317,14 @@ class YumBase(depsolve.Depsolve):
+@@ -2661,6 +3318,14 @@ class YumBase(depsolve.Depsolve):
yield (po, vs)
def searchPackageTags(self, criteria):
@@ -189146,7 +189186,7 @@ index 99039e0..ac01435 100644
results = {} # name = [(criteria, taglist)]
for c in criteria:
c = c.lower()
-@@ -2677,11 +3341,16 @@ class YumBase(depsolve.Depsolve):
+@@ -2677,11 +3342,16 @@ class YumBase(depsolve.Depsolve):
return results
def searchPackages(self, fields, criteria, callback=None):
@@ -189168,7 +189208,7 @@ index 99039e0..ac01435 100644
warnings.warn(_('searchPackages() will go away in a future version of Yum.\
Use searchGenerator() instead. \n'),
Errors.YumFutureDeprecationWarning, stacklevel=2)
-@@ -2700,13 +3369,23 @@ class YumBase(depsolve.Depsolve):
+@@ -2700,13 +3370,23 @@ class YumBase(depsolve.Depsolve):
def searchPackageProvides(self, args, callback=None,
callback_has_matchfor=False):
@@ -189196,7 +189236,7 @@ index 99039e0..ac01435 100644
else:
isglob = True
canBeFile = misc.re_filename(arg)
-@@ -2723,7 +3402,7 @@ class YumBase(depsolve.Depsolve):
+@@ -2723,7 +3403,7 @@ class YumBase(depsolve.Depsolve):
where = self.returnPackagesByDep(arg)
else:
usedDepString = False
@@ -189205,7 +189245,7 @@ index 99039e0..ac01435 100644
self.verbose_logger.log(logginglevels.DEBUG_1,
P_('Searching %d package', 'Searching %d packages', len(where)), len(where))
-@@ -2817,29 +3496,170 @@ class YumBase(depsolve.Depsolve):
+@@ -2817,29 +3497,170 @@ class YumBase(depsolve.Depsolve):
return matches
@@ -189398,7 +189438,7 @@ index 99039e0..ac01435 100644
installed.append(grp)
else:
if uservisible:
-@@ -2847,34 +3667,97 @@ class YumBase(depsolve.Depsolve):
+@@ -2847,34 +3668,97 @@ class YumBase(depsolve.Depsolve):
available.append(grp)
else:
available.append(grp)
@@ -189504,7 +189544,7 @@ index 99039e0..ac01435 100644
thesegroups = self.comps.return_groups(grpid)
if not thesegroups:
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -2898,18 +3781,53 @@ class YumBase(depsolve.Depsolve):
+@@ -2898,18 +3782,53 @@ class YumBase(depsolve.Depsolve):
self.tsInfo.remove(txmbr.po.pkgtup)
@@ -189568,7 +189608,7 @@ index 99039e0..ac01435 100644
txmbrs_used = []
thesegroups = self.comps.return_groups(grpid)
-@@ -2920,12 +3838,18 @@ class YumBase(depsolve.Depsolve):
+@@ -2920,12 +3839,18 @@ class YumBase(depsolve.Depsolve):
if group_package_types:
package_types = group_package_types
@@ -189587,7 +189627,7 @@ index 99039e0..ac01435 100644
pkgs = []
if 'mandatory' in package_types:
pkgs.extend(thisgroup.mandatory_packages)
-@@ -2934,12 +3858,56 @@ class YumBase(depsolve.Depsolve):
+@@ -2934,12 +3859,56 @@ class YumBase(depsolve.Depsolve):
if 'optional' in package_types:
pkgs.extend(thisgroup.optional_packages)
@@ -189645,7 +189685,7 @@ index 99039e0..ac01435 100644
except Errors.InstallError, e:
self.verbose_logger.debug(_('No package named %s available to be installed'),
pkg)
-@@ -2953,7 +3921,9 @@ class YumBase(depsolve.Depsolve):
+@@ -2953,7 +3922,9 @@ class YumBase(depsolve.Depsolve):
group_conditionals = enable_group_conditionals
count_cond_test = 0
@@ -189656,7 +189696,7 @@ index 99039e0..ac01435 100644
for condreq, cond in thisgroup.conditional_packages.iteritems():
if self.isPackageInstalled(cond):
try:
-@@ -2990,17 +3960,23 @@ class YumBase(depsolve.Depsolve):
+@@ -2990,17 +3961,23 @@ class YumBase(depsolve.Depsolve):
if cond not in self.tsInfo.conditionals:
self.tsInfo.conditionals[cond] = []
self.tsInfo.conditionals[cond].extend(pkgs)
@@ -189687,7 +189727,7 @@ index 99039e0..ac01435 100644
if not self.comps.has_group(grpid):
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -3008,7 +3984,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3008,7 +3985,8 @@ class YumBase(depsolve.Depsolve):
thesegroups = self.comps.return_groups(grpid)
if not thesegroups:
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
@@ -189697,7 +189737,7 @@ index 99039e0..ac01435 100644
for thisgroup in thesegroups:
thisgroup.selected = False
-@@ -3034,13 +4011,114 @@ class YumBase(depsolve.Depsolve):
+@@ -3034,13 +4012,114 @@ class YumBase(depsolve.Depsolve):
for pkg in self.tsInfo.conditionals.get(txmbr.name, []):
self.tsInfo.remove(pkg.pkgtup)
@@ -189818,7 +189858,7 @@ index 99039e0..ac01435 100644
# look it up in the self.localPackages first:
for po in self.localPackages:
if po.pkgtup == pkgtup:
-@@ -3049,7 +4127,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3049,7 +4128,7 @@ class YumBase(depsolve.Depsolve):
pkgs = self.pkgSack.searchPkgTuple(pkgtup)
if len(pkgs) == 0:
@@ -189827,7 +189867,7 @@ index 99039e0..ac01435 100644
if allow_missing: # This can happen due to excludes after .up has
return None # happened.
raise Errors.DepError, _('Package tuple %s could not be found in packagesack') % str(pkgtup)
-@@ -3065,13 +4143,21 @@ class YumBase(depsolve.Depsolve):
+@@ -3065,13 +4144,21 @@ class YumBase(depsolve.Depsolve):
return result
def getInstalledPackageObject(self, pkgtup):
@@ -189854,7 +189894,7 @@ index 99039e0..ac01435 100644
raise Errors.RpmDBError, _('Package tuple %s could not be found in rpmdb') % str(pkgtup)
# Dito. FIXME from getPackageObject() for len() > 1 ... :)
-@@ -3079,9 +4165,11 @@ class YumBase(depsolve.Depsolve):
+@@ -3079,9 +4166,11 @@ class YumBase(depsolve.Depsolve):
return po
def gpgKeyCheck(self):
@@ -189868,7 +189908,7 @@ index 99039e0..ac01435 100644
gpgkeyschecked = self.conf.cachedir + '/.gpgkeyschecked.yum'
if os.path.exists(gpgkeyschecked):
return 1
-@@ -3106,9 +4194,13 @@ class YumBase(depsolve.Depsolve):
+@@ -3106,9 +4195,13 @@ class YumBase(depsolve.Depsolve):
return 1
def returnPackagesByDep(self, depstring):
@@ -189884,7 +189924,7 @@ index 99039e0..ac01435 100644
if not depstring:
return []
-@@ -3132,12 +4224,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3132,12 +4225,23 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError, _('Invalid version flag from: %s') % str(depstring)
depflags = SYMBOLFLAGS[flagsymbol]
@@ -189911,7 +189951,7 @@ index 99039e0..ac01435 100644
# we get all sorts of randomness here
errstring = depstring
if type(depstring) not in types.StringTypes:
-@@ -3149,16 +4252,22 @@ class YumBase(depsolve.Depsolve):
+@@ -3149,16 +4253,22 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError, _('No Package found for %s') % errstring
ps = ListPackageSack(pkglist)
@@ -189938,7 +189978,7 @@ index 99039e0..ac01435 100644
if not depstring:
return []
-@@ -3182,14 +4291,53 @@ class YumBase(depsolve.Depsolve):
+@@ -3182,14 +4292,53 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError, _('Invalid version flag from: %s') % str(depstring)
depflags = SYMBOLFLAGS[flagsymbol]
@@ -189994,7 +190034,7 @@ index 99039e0..ac01435 100644
if len(pkglist) == 0:
-@@ -3198,14 +4346,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3198,14 +4347,23 @@ class YumBase(depsolve.Depsolve):
if len(pkglist) == 1:
return pkglist[0]
@@ -190024,7 +190064,7 @@ index 99039e0..ac01435 100644
returnlist = []
compatArchList = self.arch.get_arch_list(arch)
multiLib = []
-@@ -3222,9 +4379,9 @@ class YumBase(depsolve.Depsolve):
+@@ -3222,9 +4380,9 @@ class YumBase(depsolve.Depsolve):
singleLib.append(po)
# we now have three lists. find the best package(s) of each
@@ -190037,7 +190077,7 @@ index 99039e0..ac01435 100644
if single_name and multi and single and multi.name != single.name:
# Sinlge _must_ match multi, if we want a single package name
-@@ -3238,7 +4395,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3238,7 +4396,7 @@ class YumBase(depsolve.Depsolve):
# if there's a noarch and it's newer than the multilib, we want
# just the noarch. otherwise, we want multi + single
elif multi:
@@ -190046,7 +190086,7 @@ index 99039e0..ac01435 100644
if best.arch == "noarch":
returnlist.append(no)
else:
-@@ -3246,7 +4403,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3246,7 +4404,7 @@ class YumBase(depsolve.Depsolve):
if single: returnlist.append(single)
# similar for the non-multilib case
elif single:
@@ -190055,7 +190095,7 @@ index 99039e0..ac01435 100644
if best.arch == "noarch":
returnlist.append(no)
else:
-@@ -3350,28 +4507,71 @@ class YumBase(depsolve.Depsolve):
+@@ -3350,28 +4508,71 @@ class YumBase(depsolve.Depsolve):
done = True
slow = next_func(slow)
@@ -190137,7 +190177,7 @@ index 99039e0..ac01435 100644
try:
txmbrs = self.groupRemove(group_string)
except yum.Errors.GroupsError:
-@@ -3387,6 +4587,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3387,6 +4588,8 @@ class YumBase(depsolve.Depsolve):
assert pattern[0] == '@'
grpid = pattern[1:]
@@ -190146,7 +190186,7 @@ index 99039e0..ac01435 100644
thesegroups = self.comps.return_groups(grpid)
if not thesegroups:
raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
-@@ -3398,7 +4600,11 @@ class YumBase(depsolve.Depsolve):
+@@ -3398,7 +4601,11 @@ class YumBase(depsolve.Depsolve):
def _minus_deselect(self, pattern):
""" Remove things from the transaction, like kickstart. """
assert pattern[0] == '-'
@@ -190159,7 +190199,7 @@ index 99039e0..ac01435 100644
if pat and pat[0] == '@':
pat = pat[1:]
-@@ -3437,14 +4643,87 @@ class YumBase(depsolve.Depsolve):
+@@ -3437,14 +4644,87 @@ class YumBase(depsolve.Depsolve):
if flag not in self.tsInfo.probFilterFlags:
self.tsInfo.probFilterFlags.append(flag)
@@ -190253,7 +190293,7 @@ index 99039e0..ac01435 100644
pkgs = []
was_pattern = False
if po:
-@@ -3464,9 +4743,14 @@ class YumBase(depsolve.Depsolve):
+@@ -3464,9 +4744,14 @@ class YumBase(depsolve.Depsolve):
if kwargs['pattern'] and kwargs['pattern'][0] == '@':
return self._at_groupinstall(kwargs['pattern'])
@@ -190268,7 +190308,7 @@ index 99039e0..ac01435 100644
ignore_case=False)
pkgs.extend(mypkgs)
# if we have anything left unmatched, let's take a look for it
-@@ -3477,20 +4761,14 @@ class YumBase(depsolve.Depsolve):
+@@ -3477,20 +4762,14 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.debug(_('Checking for virtual provide or file-provide for %s'),
arg)
@@ -190297,7 +190337,7 @@ index 99039e0..ac01435 100644
else:
nevra_dict = self._nevra_kwarg_parse(kwargs)
-@@ -3499,6 +4777,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3499,6 +4778,8 @@ class YumBase(depsolve.Depsolve):
ver=nevra_dict['version'], rel=nevra_dict['release'])
self._add_not_found_a(pkgs, nevra_dict)
@@ -190306,7 +190346,7 @@ index 99039e0..ac01435 100644
if pkgs:
# if was_pattern or nevra-dict['arch'] is none, take the list
# of arches based on our multilib_compat config and
-@@ -3577,17 +4857,21 @@ class YumBase(depsolve.Depsolve):
+@@ -3577,17 +4858,21 @@ class YumBase(depsolve.Depsolve):
continue
# make sure this shouldn't be passed to update:
@@ -190332,7 +190372,7 @@ index 99039e0..ac01435 100644
obsoleting_pkg = self._test_loop(po, self._pkg2obspkg)
if obsoleting_pkg is not None:
# this is not a definitive check but it'll make sure we don't
-@@ -3600,23 +4884,23 @@ class YumBase(depsolve.Depsolve):
+@@ -3600,23 +4885,23 @@ class YumBase(depsolve.Depsolve):
already_obs = pkgs[0]
if already_obs:
@@ -190363,7 +190403,7 @@ index 99039e0..ac01435 100644
continue
# make sure we don't have a name.arch of this already installed
-@@ -3630,8 +4914,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3630,8 +4915,8 @@ class YumBase(depsolve.Depsolve):
found = True
break
if not found:
@@ -190374,7 +190414,7 @@ index 99039e0..ac01435 100644
tx_return.extend(txmbrs)
continue
-@@ -3719,19 +5003,47 @@ class YumBase(depsolve.Depsolve):
+@@ -3719,19 +5004,47 @@ class YumBase(depsolve.Depsolve):
return txmbr
def update(self, po=None, requiringPo=None, update_to=False, **kwargs):
@@ -190429,7 +190469,7 @@ index 99039e0..ac01435 100644
tx_return = []
if not po and not kwargs: # update everything (the easy case)
self.verbose_logger.log(logginglevels.DEBUG_2, _('Updating Everything'))
-@@ -3765,7 +5077,15 @@ class YumBase(depsolve.Depsolve):
+@@ -3765,7 +5078,15 @@ class YumBase(depsolve.Depsolve):
if new is None:
continue
tx_return.extend(self.update(po=new))
@@ -190446,7 +190486,7 @@ index 99039e0..ac01435 100644
return tx_return
# complications
-@@ -3787,13 +5107,16 @@ class YumBase(depsolve.Depsolve):
+@@ -3787,13 +5108,16 @@ class YumBase(depsolve.Depsolve):
return self._minus_deselect(kwargs['pattern'])
if kwargs['pattern'] and kwargs['pattern'][0] == '@':
@@ -190465,7 +190505,7 @@ index 99039e0..ac01435 100644
if not instpkgs and not availpkgs:
depmatches = []
-@@ -3805,6 +5128,8 @@ class YumBase(depsolve.Depsolve):
+@@ -3805,6 +5129,8 @@ class YumBase(depsolve.Depsolve):
except yum.Errors.YumBaseError, e:
self.logger.critical(_('%s') % e)
@@ -190474,7 +190514,7 @@ index 99039e0..ac01435 100644
if update_to:
availpkgs.extend(depmatches)
else:
-@@ -3816,9 +5141,12 @@ class YumBase(depsolve.Depsolve):
+@@ -3816,9 +5142,12 @@ class YumBase(depsolve.Depsolve):
try:
if update_to:
m = []
@@ -190488,7 +190528,7 @@ index 99039e0..ac01435 100644
m = self.pkgSack.returnNewestByNameArch(patterns=pats)
except Errors.PackageSackError:
m = []
-@@ -3843,7 +5171,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3843,7 +5172,7 @@ class YumBase(depsolve.Depsolve):
availpkgs = self._compare_providers(availpkgs, requiringPo)
availpkgs = map(lambda x: x[0], availpkgs)
elif not availpkgs:
@@ -190497,7 +190537,7 @@ index 99039e0..ac01435 100644
# for any thing specified
# get the list of available pkgs matching it (or take the po)
-@@ -3879,6 +5207,7 @@ class YumBase(depsolve.Depsolve):
+@@ -3879,6 +5208,7 @@ class YumBase(depsolve.Depsolve):
if obsoleting_pkg is None:
continue
obs_pkgs.append(obsoleting_pkg)
@@ -190505,7 +190545,7 @@ index 99039e0..ac01435 100644
for obsoleting_pkg in packagesNewestByName(obs_pkgs):
tx_return.extend(self.install(po=obsoleting_pkg))
for available_pkg in availpkgs:
-@@ -3920,11 +5249,29 @@ class YumBase(depsolve.Depsolve):
+@@ -3920,11 +5250,29 @@ class YumBase(depsolve.Depsolve):
tx_return.append(txmbr)
for available_pkg in availpkgs:
@@ -190535,7 +190575,7 @@ index 99039e0..ac01435 100644
self.verbose_logger.log(logginglevels.DEBUG_2, _('Not Updating Package that is obsoleted: %s'), available_pkg)
tx_return.extend(self.update(po=obsoleting_pkg))
continue
-@@ -3985,11 +5332,18 @@ class YumBase(depsolve.Depsolve):
+@@ -3985,11 +5333,18 @@ class YumBase(depsolve.Depsolve):
return tx_return
def remove(self, po=None, **kwargs):
@@ -190559,7 +190599,7 @@ index 99039e0..ac01435 100644
if not po and not kwargs:
raise Errors.RemoveError, 'Nothing specified to remove'
-@@ -4008,6 +5362,10 @@ class YumBase(depsolve.Depsolve):
+@@ -4008,6 +5363,10 @@ class YumBase(depsolve.Depsolve):
return self._at_groupremove(kwargs['pattern'])
(e,m,u) = self.rpmdb.matchPackageNames([kwargs['pattern']])
@@ -190570,7 +190610,7 @@ index 99039e0..ac01435 100644
pkgs.extend(e)
pkgs.extend(m)
if u:
-@@ -4018,6 +5376,10 @@ class YumBase(depsolve.Depsolve):
+@@ -4018,6 +5377,10 @@ class YumBase(depsolve.Depsolve):
except yum.Errors.YumBaseError, e:
self.logger.critical(_('%s') % e)
@@ -190581,7 +190621,7 @@ index 99039e0..ac01435 100644
if not depmatches:
arg = to_unicode(arg)
self.logger.critical(_('No Match for argument: %s') % to_unicode(arg))
-@@ -4055,17 +5417,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4055,17 +5418,19 @@ class YumBase(depsolve.Depsolve):
return tx_return
def installLocal(self, pkg, po=None, updateonly=False):
@@ -190611,7 +190651,7 @@ index 99039e0..ac01435 100644
# read in the package into a YumLocalPackage Object
# append it to self.localPackages
# check if it can be installed or updated based on nevra versus rpmdb
-@@ -4183,16 +5547,15 @@ class YumBase(depsolve.Depsolve):
+@@ -4183,16 +5548,15 @@ class YumBase(depsolve.Depsolve):
return tx_return
def reinstallLocal(self, pkg, po=None):
@@ -190636,7 +190676,7 @@ index 99039e0..ac01435 100644
if not po:
try:
po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg,
-@@ -4215,13 +5578,29 @@ class YumBase(depsolve.Depsolve):
+@@ -4215,13 +5579,29 @@ class YumBase(depsolve.Depsolve):
return self.reinstall(po=po)
def reinstall(self, po=None, **kwargs):
@@ -190669,7 +190709,7 @@ index 99039e0..ac01435 100644
tx_mbrs = []
if po: # The po, is the "available" po ... we want the installed po
tx_mbrs.extend(self.remove(pkgtup=po.pkgtup))
-@@ -4240,10 +5619,11 @@ class YumBase(depsolve.Depsolve):
+@@ -4240,10 +5620,11 @@ class YumBase(depsolve.Depsolve):
# pkgs that are obsolete.
old_conf_obs = self.conf.obsoletes
self.conf.obsoletes = False
@@ -190683,7 +190723,7 @@ index 99039e0..ac01435 100644
self.conf.obsoletes = old_conf_obs
if len(members) == 0:
self.tsInfo.remove(item.pkgtup)
-@@ -4259,16 +5639,15 @@ class YumBase(depsolve.Depsolve):
+@@ -4259,16 +5640,15 @@ class YumBase(depsolve.Depsolve):
return tx_mbrs
def downgradeLocal(self, pkg, po=None):
@@ -190708,7 +190748,7 @@ index 99039e0..ac01435 100644
if not po:
try:
po = YumUrlPackage(self, ts=self.rpmdb.readOnlyTS(), url=pkg,
-@@ -4309,13 +5688,19 @@ class YumBase(depsolve.Depsolve):
+@@ -4309,13 +5689,19 @@ class YumBase(depsolve.Depsolve):
return False
def downgrade(self, po=None, **kwargs):
@@ -190735,7 +190775,7 @@ index 99039e0..ac01435 100644
if not po and not kwargs:
raise Errors.DowngradeError, 'Nothing specified to downgrade'
-@@ -4397,6 +5782,10 @@ class YumBase(depsolve.Depsolve):
+@@ -4397,6 +5783,10 @@ class YumBase(depsolve.Depsolve):
# installed version. Indexed fromn the latest installed pkgtup.
downgrade_apkgs = {}
for pkg in sorted(apkgs):
@@ -190746,7 +190786,7 @@ index 99039e0..ac01435 100644
na = (pkg.name, pkg.arch)
# Here we allow downgrades from .i386 => .noarch, or .i586 => .i386
-@@ -4421,6 +5810,9 @@ class YumBase(depsolve.Depsolve):
+@@ -4421,6 +5811,9 @@ class YumBase(depsolve.Depsolve):
warned_nas.add(na)
continue
@@ -190756,7 +190796,7 @@ index 99039e0..ac01435 100644
if pkg.verGE(lipkg):
if na not in warned_nas:
msg = _('Only Upgrade available on package: %s') % pkg
-@@ -4457,7 +5849,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4457,7 +5850,7 @@ class YumBase(depsolve.Depsolve):
if e and v and r:
evr = '%s:%s-%s' % (e, v, r)
elif v and r:
@@ -190765,7 +190805,7 @@ index 99039e0..ac01435 100644
elif e and v:
evr = '%s:%s' % (e, v)
elif v: # e and r etc. is just too weird to print
-@@ -4500,12 +5892,24 @@ class YumBase(depsolve.Depsolve):
+@@ -4500,12 +5893,24 @@ class YumBase(depsolve.Depsolve):
return returndict
@@ -190793,7 +190833,7 @@ index 99039e0..ac01435 100644
old_conf_obs = self.conf.obsoletes
self.conf.obsoletes = False
done = False
-@@ -4515,19 +5919,46 @@ class YumBase(depsolve.Depsolve):
+@@ -4515,19 +5920,46 @@ class YumBase(depsolve.Depsolve):
done = True
for pkg in transaction.trans_data:
if pkg.state == 'Downgrade':
@@ -190840,7 +190880,7 @@ index 99039e0..ac01435 100644
if self.install(pkgtup=pkg.pkgtup):
done = True
for pkg in transaction.trans_data:
-@@ -4538,8 +5969,14 @@ class YumBase(depsolve.Depsolve):
+@@ -4538,8 +5970,14 @@ class YumBase(depsolve.Depsolve):
return done
def history_undo(self, transaction):
@@ -190857,7 +190897,7 @@ index 99039e0..ac01435 100644
# NOTE: This is somewhat basic atm. ... for instance we don't check
# that we are going from the old new version. However it's still
# better than the RHN rollback code, and people pay for that :).
-@@ -4616,7 +6053,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4616,7 +6054,7 @@ class YumBase(depsolve.Depsolve):
except urlgrabber.grabber.URLGrabError, e:
raise Errors.YumBaseError(_('GPG key retrieval failed: ') +
@@ -190866,7 +190906,7 @@ index 99039e0..ac01435 100644
# check for a .asc file accompanying it - that's our gpg sig on the key
# suck it down and do the check
-@@ -4649,7 +6086,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4649,7 +6087,7 @@ class YumBase(depsolve.Depsolve):
keys_info = misc.getgpgkeyinfo(rawkey, multiple=True)
except ValueError, e:
raise Errors.YumBaseError(_('Invalid GPG Key from %s: %s') %
@@ -190875,7 +190915,7 @@ index 99039e0..ac01435 100644
keys = []
for keyinfo in keys_info:
thiskey = {}
-@@ -4674,39 +6111,49 @@ class YumBase(depsolve.Depsolve):
+@@ -4674,39 +6112,49 @@ class YumBase(depsolve.Depsolve):
if pkgs:
pkgs = sorted(pkgs)[-1]
msg = (_('Importing %s key 0x%s:\n'
@@ -190943,7 +190983,7 @@ index 99039e0..ac01435 100644
user_cb_fail = False
for keyurl in keyurls:
keys = self._retrievePublicKey(keyurl, repo)
-@@ -4725,7 +6172,9 @@ class YumBase(depsolve.Depsolve):
+@@ -4725,7 +6173,9 @@ class YumBase(depsolve.Depsolve):
# Try installing/updating GPG key
self._getKeyImportMessage(info, keyurl)
rc = False
@@ -190954,7 +190994,7 @@ index 99039e0..ac01435 100644
rc = True
# grab the .sig/.asc for the keyurl, if it exists
-@@ -4751,8 +6200,8 @@ class YumBase(depsolve.Depsolve):
+@@ -4751,8 +6201,8 @@ class YumBase(depsolve.Depsolve):
ts = self.rpmdb.readOnlyTS()
result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key']))
if result != 0:
@@ -190965,7 +191005,7 @@ index 99039e0..ac01435 100644
self.logger.info(_('Key imported successfully'))
key_installed = True
-@@ -4760,18 +6209,20 @@ class YumBase(depsolve.Depsolve):
+@@ -4760,18 +6210,20 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError, _("Didn't install any keys")
if not key_installed:
@@ -190991,7 +191031,7 @@ index 99039e0..ac01435 100644
def _getAnyKeyForRepo(self, repo, destdir, keyurl_list, is_cakey=False, callback=None):
"""
-@@ -4788,6 +6239,18 @@ class YumBase(depsolve.Depsolve):
+@@ -4788,6 +6240,18 @@ class YumBase(depsolve.Depsolve):
"""
key_installed = False
@@ -191010,7 +191050,7 @@ index 99039e0..ac01435 100644
user_cb_fail = False
for keyurl in keyurl_list:
keys = self._retrievePublicKey(keyurl, repo, getSig=not is_cakey)
-@@ -4819,8 +6282,11 @@ class YumBase(depsolve.Depsolve):
+@@ -4819,8 +6283,11 @@ class YumBase(depsolve.Depsolve):
if not key_installed:
self._getKeyImportMessage(info, keyurl, keytype)
rc = False
@@ -191023,7 +191063,7 @@ index 99039e0..ac01435 100644
elif callback:
rc = callback({"repo": repo, "userid": info['userid'],
"hexkeyid": info['hexkeyid'], "keyurl": keyurl,
-@@ -4835,7 +6301,8 @@ class YumBase(depsolve.Depsolve):
+@@ -4835,7 +6302,8 @@ class YumBase(depsolve.Depsolve):
# Import the key
result = misc.import_key_to_pubring(info['raw_key'], info['hexkeyid'], gpgdir=destdir)
if not result:
@@ -191033,7 +191073,7 @@ index 99039e0..ac01435 100644
self.logger.info(_('Key imported successfully'))
key_installed = True
# write out the key id to imported_cakeys in the repos basedir
-@@ -4851,36 +6318,35 @@ class YumBase(depsolve.Depsolve):
+@@ -4851,36 +6319,35 @@ class YumBase(depsolve.Depsolve):
pass
if not key_installed and user_cb_fail:
@@ -191086,7 +191126,7 @@ index 99039e0..ac01435 100644
self._getAnyKeyForRepo(repo, repo.gpgcadir, repo.gpgcakey, is_cakey=True, callback=callback)
def _limit_installonly_pkgs(self):
-@@ -4889,7 +6355,7 @@ class YumBase(depsolve.Depsolve):
+@@ -4889,7 +6356,7 @@ class YumBase(depsolve.Depsolve):
New in 3.2.24: Obey yumdb_info.installonly data. """
def _sort_and_filter_installonly(pkgs):
@@ -191095,7 +191135,7 @@ index 99039e0..ac01435 100644
using the yumdb. """
ret_beg = []
ret_mid = []
-@@ -4917,6 +6383,10 @@ class YumBase(depsolve.Depsolve):
+@@ -4917,6 +6384,10 @@ class YumBase(depsolve.Depsolve):
if self.conf.installonly_limit < 1 :
return
@@ -191106,7 +191146,7 @@ index 99039e0..ac01435 100644
toremove = []
# We "probably" want to use either self.ts or self.rpmdb.ts if either
-@@ -4926,23 +6396,30 @@ class YumBase(depsolve.Depsolve):
+@@ -4926,23 +6397,30 @@ class YumBase(depsolve.Depsolve):
# so self.rpmdb.ts should be valid.
ts = self.rpmdb.readOnlyTS()
(cur_kernel_v, cur_kernel_r) = misc.get_running_kernel_version_release(ts)
@@ -191145,7 +191185,7 @@ index 99039e0..ac01435 100644
for po in installed:
if (po.version, po.release) == (cur_kernel_v, cur_kernel_r):
# don't remove running
-@@ -4959,19 +6436,22 @@ class YumBase(depsolve.Depsolve):
+@@ -4959,19 +6437,22 @@ class YumBase(depsolve.Depsolve):
txmbr.depends_on.append(rel)
def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None):
@@ -191181,7 +191221,7 @@ index 99039e0..ac01435 100644
if not callback:
callback = callbacks.ProcessTransNoOutputCallback()
-@@ -5062,8 +6542,8 @@ class YumBase(depsolve.Depsolve):
+@@ -5062,8 +6543,8 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumRPMCheckError, retmsgs
retmsgs = [_('ERROR with transaction check vs depsolve:')]
retmsgs.extend(msgs)
@@ -191192,7 +191232,7 @@ index 99039e0..ac01435 100644
raise Errors.YumRPMCheckError,retmsgs
tsConf = {}
-@@ -5114,13 +6594,19 @@ class YumBase(depsolve.Depsolve):
+@@ -5114,13 +6595,19 @@ class YumBase(depsolve.Depsolve):
return results
def add_enable_repo(self, repoid, baseurls=[], mirrorlist=None, **kwargs):
@@ -191219,7 +191259,7 @@ index 99039e0..ac01435 100644
# out of place fixme - maybe we should make this the default repo addition
# routine and use it from getReposFromConfigFile(), etc.
newrepo = yumRepo.YumRepository(repoid)
-@@ -5167,9 +6653,15 @@ class YumBase(depsolve.Depsolve):
+@@ -5167,9 +6654,15 @@ class YumBase(depsolve.Depsolve):
def setCacheDir(self, force=False, tmpdir=None, reuse=True,
suffix='/$basearch/$releasever'):
@@ -191238,7 +191278,7 @@ index 99039e0..ac01435 100644
if not force and os.geteuid() == 0:
return True # We are root, not forced, so happy with the global dir.
if tmpdir is None:
-@@ -5179,7 +6671,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5179,7 +6672,7 @@ class YumBase(depsolve.Depsolve):
try:
cachedir = misc.getCacheDir(tmpdir, reuse)
except (IOError, OSError), e:
@@ -191247,7 +191287,7 @@ index 99039e0..ac01435 100644
cachedir = None
if cachedir is None:
-@@ -5190,6 +6682,8 @@ class YumBase(depsolve.Depsolve):
+@@ -5190,6 +6683,8 @@ class YumBase(depsolve.Depsolve):
self.prerepoconf.cachedir = cachedir
else:
self.repos.setCacheDir(cachedir)
@@ -191256,7 +191296,7 @@ index 99039e0..ac01435 100644
self.conf.cachedir = cachedir
return True # We got a new cache dir
-@@ -5220,13 +6714,24 @@ class YumBase(depsolve.Depsolve):
+@@ -5220,13 +6715,24 @@ class YumBase(depsolve.Depsolve):
self.history.write_addon_data('config-repos', myrepos)
def verify_plugins_cb(self, verify_package):
@@ -191284,7 +191324,7 @@ index 99039e0..ac01435 100644
if self.tsInfo._unresolvedMembers:
if auto:
self.logger.critical(_("Dependencies not solved. Will not save unresolved transaction."))
-@@ -5234,7 +6739,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5234,7 +6740,7 @@ class YumBase(depsolve.Depsolve):
raise Errors.YumBaseError(_("Dependencies not solved. Will not save unresolved transaction."))
if not filename:
@@ -191293,7 +191333,7 @@ index 99039e0..ac01435 100644
fd,filename = tempfile.mkstemp(suffix='.yumtx', prefix=prefix)
f = os.fdopen(fd, 'w')
else:
-@@ -5244,13 +6749,17 @@ class YumBase(depsolve.Depsolve):
+@@ -5244,13 +6750,17 @@ class YumBase(depsolve.Depsolve):
msg = "%s\n" % self.rpmdb.simpleVersion(main_only=True)[0]
msg += "%s\n" % self.ts.getTsFlags()
@@ -191314,7 +191354,7 @@ index 99039e0..ac01435 100644
msg += "%s\n" % len(self.tsInfo.getMembers())
for txmbr in self.tsInfo.getMembers():
msg += txmbr._dump()
-@@ -5260,42 +6769,84 @@ class YumBase(depsolve.Depsolve):
+@@ -5260,42 +6770,84 @@ class YumBase(depsolve.Depsolve):
except (IOError, OSError), e:
self._ts_save_file = None
if auto:
@@ -191411,7 +191451,7 @@ index 99039e0..ac01435 100644
if ignorerpm:
msg += _(" ignoring, as requested.")
self.logger.critical(_(msg))
-@@ -5318,8 +6869,17 @@ class YumBase(depsolve.Depsolve):
+@@ -5318,8 +6870,17 @@ class YumBase(depsolve.Depsolve):
numrepos = int(data[2].strip())
repos = []
rindex=3+numrepos
@@ -191430,7 +191470,7 @@ index 99039e0..ac01435 100644
# pkgs/txmbrs
numpkgs = int(data[rindex].strip())
-@@ -5329,6 +6889,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5329,6 +6890,7 @@ class YumBase(depsolve.Depsolve):
pkgcount = 0
pkgprob = False
curpkg = None
@@ -191438,7 +191478,7 @@ index 99039e0..ac01435 100644
for l in data[pkgstart:]:
l = l.rstrip()
# our main txmbrs
-@@ -5356,6 +6917,7 @@ class YumBase(depsolve.Depsolve):
+@@ -5356,6 +6918,7 @@ class YumBase(depsolve.Depsolve):
if not ignoremissing:
raise Errors.YumBaseError(msg)
else:
@@ -191446,7 +191486,7 @@ index 99039e0..ac01435 100644
self.logger.critical(msg)
else:
pkgcount += 1
-@@ -5432,12 +6994,18 @@ class YumBase(depsolve.Depsolve):
+@@ -5432,12 +6995,18 @@ class YumBase(depsolve.Depsolve):
if pkgprob:
msg = _("Transaction members, relations are missing or ts has been modified,")
if ignoremissing:
@@ -191465,7 +191505,7 @@ index 99039e0..ac01435 100644
return self.tsInfo.getMembers()
def _remove_old_deps(self):
-@@ -5470,18 +7038,6 @@ class YumBase(depsolve.Depsolve):
+@@ -5470,18 +7039,6 @@ class YumBase(depsolve.Depsolve):
if requiring == required: # if they are self-requiring skip them
continue
@@ -191484,7 +191524,7 @@ index 99039e0..ac01435 100644
#for tbi_pkg in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES):
# for reqtuple in tbi_pkg.po.requires:
# if required.provides_for(reqtuple):
-@@ -5533,7 +7089,24 @@ class YumBase(depsolve.Depsolve):
+@@ -5533,7 +7090,24 @@ class YumBase(depsolve.Depsolve):
# Debugging output
self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has revdep %s which was user-installed."), pkg, curpkg)
ok_to_remove[pkg] = False
@@ -191509,7 +191549,7 @@ index 99039e0..ac01435 100644
visited[curpkg] = True
all_leaves_visited = True
leaves = curpkg.requiring_packages()
-@@ -5547,4 +7120,3 @@ class YumBase(depsolve.Depsolve):
+@@ -5547,4 +7121,3 @@ class YumBase(depsolve.Depsolve):
# Debugging output
self.verbose_logger.log(logginglevels.DEBUG_2, _("%s has no user-installed revdeps."), pkg)
return False
@@ -192183,7 +192223,7 @@ index 65f6d5e..92e87ba 100755
print >> sys.stderr, "newcomps.py: No such file:\'%s\'" % sys.argv[1]
sys.exit(1)
diff --git a/yum/config.py b/yum/config.py
-index d09511f..7bb56d0 100644
+index d09511f..f0f4e96 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -38,22 +38,30 @@ if not _use_iniparse:
@@ -193034,7 +193074,7 @@ index d09511f..7bb56d0 100644
history_record = BoolOption(True)
history_record_packages = ListOption(['yum', 'rpm'])
-@@ -744,18 +878,43 @@ class YumConf(StartupConf):
+@@ -744,18 +878,45 @@ class YumConf(StartupConf):
loadts_ignoremissing = BoolOption(False)
loadts_ignorerpm = BoolOption(False)
@@ -193066,6 +193106,8 @@ index d09511f..7bb56d0 100644
+
+ check_config_file_age = BoolOption(True)
+
++ usr_w_check = BoolOption(True)
++
_reposlist = []
def dump(self):
@@ -193078,7 +193120,7 @@ index d09511f..7bb56d0 100644
output = '[main]\n'
# we exclude all vars which start with _ or are in this list:
excluded_vars = ('cfg', 'uid', 'yumvar', 'progress_obj', 'failure_obj',
-@@ -778,14 +937,12 @@ class YumConf(StartupConf):
+@@ -778,14 +939,12 @@ class YumConf(StartupConf):
return output
class RepoConf(BaseConfig):
@@ -193096,7 +193138,7 @@ index d09511f..7bb56d0 100644
ck = self.__cached_keys
if not isinstance(self, RepoConf):
ck = set()
-@@ -797,6 +954,7 @@ class RepoConf(BaseConfig):
+@@ -797,6 +956,7 @@ class RepoConf(BaseConfig):
name = Option()
enabled = Inherit(YumConf.enabled)
@@ -193104,7 +193146,7 @@ index d09511f..7bb56d0 100644
baseurl = UrlListOption()
mirrorlist = UrlOption()
metalink = UrlOption()
-@@ -820,42 +978,60 @@ class RepoConf(BaseConfig):
+@@ -820,42 +980,60 @@ class RepoConf(BaseConfig):
keepalive = Inherit(YumConf.keepalive)
enablegroups = Inherit(YumConf.enablegroups)
@@ -193176,7 +193218,7 @@ index d09511f..7bb56d0 100644
# ' xemacs syntax hack
-@@ -876,20 +1052,24 @@ def readStartupConfig(configfile, root):
+@@ -876,20 +1054,24 @@ def readStartupConfig(configfile, root):
raise Errors.ConfigError("All plugin search paths must be absolute")
# Stuff this here to avoid later re-parsing
startupconf._parser = parser
@@ -193208,7 +193250,7 @@ index d09511f..7bb56d0 100644
# ' xemacs syntax hack
-@@ -956,6 +1136,12 @@ def readMainConfig(startupconf):
+@@ -956,6 +1138,12 @@ def readMainConfig(startupconf):
return yumconf
def readVersionGroupsConfig(configfile="/etc/yum/version-groups.conf"):
@@ -193221,7 +193263,7 @@ index d09511f..7bb56d0 100644
parser = ConfigParser()
confpp_obj = ConfigPreProcessor(configfile)
try:
-@@ -970,17 +1156,16 @@ def readVersionGroupsConfig(configfile="/etc/yum/version-groups.conf"):
+@@ -970,17 +1158,16 @@ def readVersionGroupsConfig(configfile="/etc/yum/version-groups.conf"):
def getOption(conf, section, name, option):
@@ -193249,7 +193291,7 @@ index d09511f..7bb56d0 100644
try:
val = conf.get(section, name)
except (NoSectionError, NoOptionError):
-@@ -1010,7 +1195,10 @@ def _getsysver(installroot, distroverpkg):
+@@ -1010,7 +1197,10 @@ def _getsysver(installroot, distroverpkg):
ts = rpmUtils.transaction.initReadOnlyTransaction(root=installroot)
ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
try:
@@ -193261,7 +193303,7 @@ index d09511f..7bb56d0 100644
except TypeError, e:
# This is code for "cannot open rpmdb"
# this is for pep 352 compliance on python 2.6 and above :(
-@@ -1028,25 +1216,44 @@ def _getsysver(installroot, distroverpkg):
+@@ -1028,25 +1218,44 @@ def _getsysver(installroot, distroverpkg):
if idx.count() == 0:
releasever = '$releasever'
else:
@@ -193317,7 +193359,7 @@ index d09511f..7bb56d0 100644
# b/c repoids can have $values in them we need to map both ways to figure
# out which one is which
section_id = repo.id
-@@ -1054,6 +1261,22 @@ def writeRawRepoFile(repo,only=None):
+@@ -1054,6 +1263,22 @@ def writeRawRepoFile(repo,only=None):
for sect in ini._sections.keys():
if varReplace(sect, repo.yumvar) == repo.id:
section_id = sect
@@ -193340,7 +193382,7 @@ index d09511f..7bb56d0 100644
# Updated the ConfigParser with the changed values
cfgOptions = repo.cfg.options(repo.id)
-@@ -1069,7 +1292,7 @@ def writeRawRepoFile(repo,only=None):
+@@ -1069,7 +1294,7 @@ def writeRawRepoFile(repo,only=None):
# If the value is the same, but just interpreted ... when we don't want
# to keep the interpreted values.
if (name in ini[section_id] and
@@ -193349,7 +193391,7 @@ index d09511f..7bb56d0 100644
ovalue = ini[section_id][name]
if name not in cfgOptions and option.default == value:
-@@ -1080,6 +1303,48 @@ def writeRawRepoFile(repo,only=None):
+@@ -1080,6 +1305,48 @@ def writeRawRepoFile(repo,only=None):
fp.write(str(ini))
fp.close()
@@ -194909,7 +194951,7 @@ index 0000000..e912ea1
+
+ return ret
diff --git a/yum/history.py b/yum/history.py
-index 5385bd1..3f20128 100644
+index 5385bd1..2f423d9 100644
--- a/yum/history.py
+++ b/yum/history.py
@@ -97,9 +97,58 @@ def _setupHistorySearchSQL(patterns=None, ignore_case=False):
@@ -195041,8 +195083,8 @@ index 5385bd1..3f20128 100644
self.state = state
- self.repoid = '<history>'
--
+-
-class YumHistoryRpmdbProblem(PackageObject):
+class YumHistoryRpmdbProblem:
""" Class representing an rpmdb problem that existed at the time of the
@@ -195085,7 +195127,18 @@ index 5385bd1..3f20128 100644
for d in reversed(sorted(DBs)):
fname = os.path.basename(d)
fname = fname[len("history-"):-len(".sqlite")]
-@@ -638,13 +738,15 @@ class YumHistory:
+@@ -597,7 +697,9 @@ class YumHistory:
+ break
+
+ if self._db_file is None:
+- self._create_db_file()
++ if not self._create_db_file():
++ # Couldn't create a db file
++ return
+
+ # make an addon path for where we're going to stick
+ # random additional history info - probably from plugins and what-not
+@@ -638,13 +740,15 @@ class YumHistory:
return self._conn.cursor()
def _commit(self):
return self._conn.commit()
@@ -195102,7 +195155,7 @@ index 5385bd1..3f20128 100644
cur = self._get_cursor()
executeSQL(cur, """SELECT pkgtupid, checksum FROM pkgtups
WHERE name=? AND arch=? AND
-@@ -659,6 +761,9 @@ class YumHistory:
+@@ -659,6 +763,9 @@ class YumHistory:
if checksum == sql_checksum:
return sql_pkgtupid
@@ -195112,7 +195165,7 @@ index 5385bd1..3f20128 100644
(n,a,e,v,r) = pkgtup
(n,a,e,v,r) = (to_unicode(n),to_unicode(a),
to_unicode(e),to_unicode(v),to_unicode(r))
-@@ -674,23 +779,28 @@ class YumHistory:
+@@ -674,23 +781,28 @@ class YumHistory:
(name, arch, epoch, version, release)
VALUES (?, ?, ?, ?, ?)""", (n,a,e,v,r))
return cur.lastrowid
@@ -195149,7 +195202,7 @@ index 5385bd1..3f20128 100644
@staticmethod
def txmbr2state(txmbr):
-@@ -984,7 +1094,8 @@ class YumHistory:
+@@ -984,7 +1096,8 @@ class YumHistory:
ORDER BY name ASC, epoch ASC""", (tid,))
ret = []
for row in cur:
@@ -195159,7 +195212,7 @@ index 5385bd1..3f20128 100644
ret.append(obj)
return ret
def _old_data_pkgs(self, tid):
-@@ -998,7 +1109,7 @@ class YumHistory:
+@@ -998,7 +1111,7 @@ class YumHistory:
ret = []
for row in cur:
obj = YumHistoryPackageState(row[0],row[1],row[2],row[3],row[4],
@@ -195168,7 +195221,7 @@ index 5385bd1..3f20128 100644
obj.done = row[6] == 'TRUE'
obj.state_installed = None
if _sttxt2stcode[obj.state] in TS_INSTALL_STATES:
-@@ -1018,7 +1129,8 @@ class YumHistory:
+@@ -1018,7 +1131,8 @@ class YumHistory:
ORDER BY name ASC, epoch ASC""", (tid,))
ret = []
for row in cur:
@@ -195178,7 +195231,7 @@ index 5385bd1..3f20128 100644
ret.append(obj)
return ret
def _old_prob_pkgs(self, rpid):
-@@ -1032,7 +1144,8 @@ class YumHistory:
+@@ -1032,7 +1146,8 @@ class YumHistory:
ORDER BY name ASC, epoch ASC""", (rpid,))
ret = []
for row in cur:
@@ -195188,7 +195241,7 @@ index 5385bd1..3f20128 100644
obj.main = row[6] == 'TRUE'
ret.append(obj)
return ret
-@@ -1091,7 +1204,11 @@ class YumHistory:
+@@ -1091,7 +1206,11 @@ class YumHistory:
if tids and len(tids) <= yum.constants.PATTERNS_INDEXED_MAX:
params = tids = list(set(tids))
sql += " WHERE tid IN (%s)" % ", ".join(['?'] * len(tids))
@@ -195201,7 +195254,7 @@ index 5385bd1..3f20128 100644
if limit is not None:
sql += " LIMIT " + str(limit)
executeSQL(cur, sql, params)
-@@ -1151,6 +1268,127 @@ class YumHistory:
+@@ -1151,6 +1270,127 @@ class YumHistory:
assert len(ret) == 1
return ret[0]
@@ -195329,7 +195382,7 @@ index 5385bd1..3f20128 100644
def _yieldSQLDataList(self, patterns, fields, ignore_case):
"""Yields all the package data for the given params. """
-@@ -1220,6 +1458,48 @@ class YumHistory:
+@@ -1220,6 +1460,48 @@ class YumHistory:
tids.add(row[0])
return tids
@@ -195378,7 +195431,7 @@ index 5385bd1..3f20128 100644
_update_ops_2 = ['''\
\
CREATE TABLE trans_skip_pkgs (
-@@ -1307,6 +1587,8 @@ class YumHistory:
+@@ -1307,6 +1589,8 @@ class YumHistory:
self._cached_updated_2 = True
return True
@@ -195387,15 +195440,29 @@ index 5385bd1..3f20128 100644
def _create_db_file(self):
""" Create a new history DB file, populating tables etc. """
-@@ -1374,6 +1656,8 @@ class YumHistory:
+@@ -1321,8 +1605,10 @@ class YumHistory:
+ if os.path.exists(_db_file + '-journal'):
+ os.rename(_db_file + '-journal', _db_file + '-journal.old')
+ self._db_file = _db_file
++ if not self.conf.writable:
++ return False
+
+- if self.conf.writable and not os.path.exists(self._db_file):
++ if not os.path.exists(self._db_file):
+ # make them default to 0600 - sysadmin can change it later
+ # if they want
+ fo = os.open(self._db_file, os.O_CREAT, 0600)
+@@ -1374,7 +1660,10 @@ class YumHistory:
cur.execute(op)
for op in self._update_ops_2:
cur.execute(op)
+ for op in self._update_ops_3:
+ cur.execute(op)
self._commit()
++ return True
# Pasted from sqlitesack
+ _FULL_PARSE_QUERY_BEG = """
diff --git a/yum/i18n.py b/yum/i18n.py
index 9889bf6..17267d6 100755
--- a/yum/i18n.py
@@ -196310,7 +196377,7 @@ index 4af563a..a702ac1 100644
self.obsoletes = {} #obs[obsoletename] = [pkg1, pkg2, pkg3]
#the package lists are packages that obsolete the key name
diff --git a/yum/packages.py b/yum/packages.py
-index 5ef9951..9522235 100644
+index 5ef9951..eebeb9d 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -38,6 +38,7 @@ import struct
@@ -196582,7 +196649,31 @@ index 5ef9951..9522235 100644
# Hacky way to get rid of version numbers...
ix = val.find('> ')
if ix != -1:
-@@ -1063,10 +1125,10 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -859,7 +921,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
+ try:
+ hdr = rpmUtils.miscutils.hdrFromPackage(ts, rpmfile)
+ except rpmUtils.RpmUtilsError:
+- raise Errors.RepoError, 'Package Header %s: RPM Cannot open' % self
++ raise Errors.RepoError('Package Header %s: RPM Cannot open' % self,
++ repo=self.repo)
+ return hdr
+
+ def returnLocalHeader(self):
+@@ -871,9 +934,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
+ hlist = rpm.readHeaderListFromFile(self.localHdr())
+ hdr = hlist[0]
+ except (rpm.error, IndexError):
+- raise Errors.RepoError, 'Package Header %s: Cannot open' % self
++ raise Errors.RepoError('Package Header %s: Cannot open' % self,
++ repo=self.repo)
+ else:
+- raise Errors.RepoError, 'Package Header %s: Not Available' % self
++ raise Errors.RepoError('Package Header %s: Not Available' % self,
++ repo=self.repo)
+
+ return hdr
+
+@@ -1063,10 +1128,10 @@ class YumAvailablePackage(PackageObject, RpmBase):
packager = url = ''
if self.packager:
@@ -196595,7 +196686,7 @@ index 5ef9951..9522235 100644
(csum_type, csum, csumid) = self.checksums[0]
msg = """
<name>%s</name>
-@@ -1080,10 +1142,10 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1080,10 +1145,10 @@ class YumAvailablePackage(PackageObject, RpmBase):
<time file="%s" build="%s"/>
<size package="%s" installed="%s" archive="%s"/>\n""" % (self.name,
self.arch, self.epoch, self.ver, self.rel, csum_type, csum,
@@ -196609,7 +196700,7 @@ index 5ef9951..9522235 100644
msg += self._return_remote_location()
return msg
-@@ -1121,6 +1183,10 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1121,6 +1186,10 @@ class YumAvailablePackage(PackageObject, RpmBase):
msg += self._dump_requires()
msg += self._dump_pco('conflicts')
msg += self._dump_pco('obsoletes')
@@ -196620,7 +196711,7 @@ index 5ef9951..9522235 100644
msg += self._dump_files(True)
if msg[-1] != '\n':
msg += """\n"""
-@@ -1131,9 +1197,9 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1131,9 +1200,9 @@ class YumAvailablePackage(PackageObject, RpmBase):
def _dump_pco(self, pcotype):
msg = ""
@@ -196632,7 +196723,7 @@ index 5ef9951..9522235 100644
pcostring = ''' <rpm:entry name="%s"''' % misc.to_xml(name, attrib=True)
if flags:
pcostring += ''' flags="%s"''' % misc.to_xml(flags, attrib=True)
-@@ -1151,25 +1217,14 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1151,25 +1220,14 @@ class YumAvailablePackage(PackageObject, RpmBase):
return msg
def _dump_files(self, primary=False):
@@ -196666,7 +196757,7 @@ index 5ef9951..9522235 100644
def _requires_with_pre(self):
raise NotImplementedError()
-@@ -1194,8 +1249,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1194,8 +1252,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
continue
newlist.append(i)
mylist = newlist
@@ -196677,7 +196768,7 @@ index 5ef9951..9522235 100644
if name.startswith('rpmlib('):
continue
# this drops out requires that the pkg provides for itself.
-@@ -1217,19 +1272,22 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1217,19 +1275,22 @@ class YumAvailablePackage(PackageObject, RpmBase):
prcostring += ''' ver="%s"''' % misc.to_xml(v, attrib=True)
if r:
prcostring += ''' rel="%s"''' % misc.to_xml(r, attrib=True)
@@ -196703,7 +196794,7 @@ index 5ef9951..9522235 100644
# We need to output them "backwards", so the oldest is first
if not clog_limit:
clogs = self.changelog
-@@ -1244,34 +1302,46 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1244,34 +1305,46 @@ class YumAvailablePackage(PackageObject, RpmBase):
hack_ts += 1
last_ts = ts
ts += hack_ts
@@ -196768,7 +196859,7 @@ index 5ef9951..9522235 100644
# This is a tweak on YumAvailablePackage() and is a base class for packages
# which are actual rpms.
-@@ -1299,10 +1369,14 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1299,10 +1372,14 @@ class YumHeaderPackage(YumAvailablePackage):
self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
if not self.pkgid:
self.pkgid = "%s.%s" %(self.hdr['name'], self.hdr['buildtime'])
@@ -196784,7 +196875,7 @@ index 5ef9951..9522235 100644
def _loadSummary(self):
# Summaries "can be" empty, which rpm return [], see BZ 473239, *sigh*
if self._loaded_summary is None:
-@@ -1338,6 +1412,17 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1338,6 +1415,17 @@ class YumHeaderPackage(YumAvailablePackage):
def _get_hdr(self):
return self.hdr
@@ -196802,7 +196893,7 @@ index 5ef9951..9522235 100644
def _populatePrco(self):
"Populate the package object with the needed PRCO interface."
-@@ -1345,6 +1430,17 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1345,6 +1433,17 @@ class YumHeaderPackage(YumAvailablePackage):
"CONFLICT": misc.share_data("conflicts"),
"REQUIRE": misc.share_data("requires"),
"PROVIDE": misc.share_data("provides") }
@@ -196820,7 +196911,7 @@ index 5ef9951..9522235 100644
hdr = self._get_hdr()
for tag in tag2prco:
name = hdr[getattr(rpm, 'RPMTAG_%sNAME' % tag)]
-@@ -1353,16 +1449,48 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1353,16 +1452,48 @@ class YumHeaderPackage(YumAvailablePackage):
continue
lst = hdr[getattr(rpm, 'RPMTAG_%sFLAGS' % tag)]
@@ -196878,7 +196969,7 @@ index 5ef9951..9522235 100644
def tagByName(self, tag):
warnings.warn("tagByName() will go away in a furture version of Yum.\n",
-@@ -1438,16 +1566,16 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1438,16 +1569,16 @@ class YumHeaderPackage(YumAvailablePackage):
# then create a _loadChangelog() method to put them into the
# self._changelog attr
if len(self.hdr['changelogname']) > 0:
@@ -196899,7 +196990,7 @@ index 5ef9951..9522235 100644
def _is_pre_req(self, flag):
"""check the flags for a requirement, return 1 or 0 whether or not requires
-@@ -1708,6 +1836,7 @@ class YUMVerifyPackage:
+@@ -1708,6 +1839,7 @@ class YUMVerifyPackage:
self._files = {}
@@ -196907,7 +196998,7 @@ index 5ef9951..9522235 100644
class _RPMVerifyPackage(YUMVerifyPackage):
def __init__(self, po, fi, def_csum_type, patterns, all):
YUMVerifyPackage.__init__(self, po)
-@@ -1720,18 +1849,30 @@ class _RPMVerifyPackage(YUMVerifyPackage):
+@@ -1720,18 +1852,30 @@ class _RPMVerifyPackage(YUMVerifyPackage):
(fi, def_csum_type, patterns, all) = self._presetup
del self._presetup
@@ -196939,7 +197030,7 @@ index 5ef9951..9522235 100644
def __contains__(self, *args, **kwargs):
self._setup()
-@@ -1763,7 +1904,8 @@ class YumInstalledPackage(YumHeaderPackage):
+@@ -1763,7 +1907,8 @@ class YumInstalledPackage(YumHeaderPackage):
self.yumdb_info = yumdb.get_package(self)
def verify(self, patterns=[], deps=False, script=False,
@@ -196949,7 +197040,7 @@ index 5ef9951..9522235 100644
"""verify that the installed files match the packaged checksum
optionally verify they match only if they are in the 'pattern' list
returns a tuple """
-@@ -1891,17 +2033,22 @@ class YumInstalledPackage(YumHeaderPackage):
+@@ -1891,17 +2036,22 @@ class YumInstalledPackage(YumHeaderPackage):
problems.append(prob)
my_mode = my_st.st_mode
@@ -196975,7 +197066,7 @@ index 5ef9951..9522235 100644
if not pf.digest:
verify_digest = False
-@@ -1946,7 +2093,7 @@ class YumInstalledPackage(YumHeaderPackage):
+@@ -1946,7 +2096,7 @@ class YumInstalledPackage(YumHeaderPackage):
my_csum = digest_type + ':' + my_csum
my_st_size = fp.read_size
@@ -196984,7 +197075,7 @@ index 5ef9951..9522235 100644
prob = _PkgVerifyProb('checksum',
'checksum does not match', ftypes)
prob.database_value = csum
-@@ -2120,11 +2267,11 @@ class YumLocalPackage(YumHeaderPackage):
+@@ -2120,11 +2270,11 @@ class YumLocalPackage(YumHeaderPackage):
relpath = self.localpath
if self._baseurl:
@@ -196999,10 +197090,19 @@ index 5ef9951..9522235 100644
return msg
diff --git a/yum/parser.py b/yum/parser.py
-index fccf528..b165ef2 100644
+index fccf528..5110cb5 100644
--- a/yum/parser.py
+++ b/yum/parser.py
-@@ -33,6 +33,7 @@ def varReplace(raw, vars):
+@@ -18,6 +18,8 @@ def varReplace(raw, vars):
+ @return: Input raw string with substituted values.
+ '''
+
++ if not vars:
++ return raw
+ done = [] # Completed chunks to return
+
+ while raw:
+@@ -33,6 +35,7 @@ def varReplace(raw, vars):
start, end = m.span()
done.append(raw[:start]) # Keep stuff leading up to token
@@ -197010,7 +197110,7 @@ index fccf528..b165ef2 100644
done.append(replacement) # Append replacement value
raw = raw[end:] # Continue with remainder of string
-@@ -73,7 +74,11 @@ class ConfigPreProcessor:
+@@ -73,7 +76,11 @@ class ConfigPreProcessor:
if scheme == '':
# check it to make sure it's not a relative file url
if configfile[0] != '/':
@@ -197023,6 +197123,25 @@ index fccf528..b165ef2 100644
url = 'file://' + configfile
else:
url = configfile
+@@ -131,6 +138,7 @@ class ConfigPreProcessor:
+ 'Error parsing config %s: include must specify file to include.' % (self.name)
+ else:
+ # whooohoo a valid include line.. push it on the stack
++ url = varReplace(url, self._vars)
+ fo = self._pushfile( url )
+ else:
+ # check if the current line starts a new section
+@@ -151,9 +159,7 @@ class ConfigPreProcessor:
+ line = line.lstrip()
+ # at this point we have a line from the topmost file on the stack
+ # or EOF if the stack is empty
+- if self._vars:
+- return varReplace(line, self._vars)
+- return line
++ return varReplace(line, self._vars)
+
+
+ def _absurl( self, url ):
diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
index ee825c6..dae60c9 100644
--- a/yum/pgpmsg.py
@@ -198437,10 +198556,19 @@ index 9b265f9..74a0f3f 100644
+
+ self.display.verify_txmbr(self.base, txmbr, count)
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
-index 8a6f6f3..16b647f 100644
+index 8a6f6f3..4d91774 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
-@@ -69,7 +69,7 @@ def _parse_pkg_n(match, regexp_match, n):
+@@ -52,6 +52,8 @@ def catchSqliteException(func):
+ raise Errors.RepoError, str(e.message)
+ else:
+ raise Errors.RepoError, str(e)
++ # Note that we can't easily get "repo" here, AFAIK. So we can't
++ # tell what failed.
+ raise Errors.RepoError, str(e)
+
+ newFunc.__name__ = func.__name__
+@@ -69,7 +71,7 @@ def _parse_pkg_n(match, regexp_match, n):
if not regexp_match:
return False
@@ -198449,7 +198577,7 @@ index 8a6f6f3..16b647f 100644
return False
if regexp_match(n):
return True
-@@ -82,7 +82,7 @@ def _parse_pkg(match, regexp_match, data, e,v,r,a):
+@@ -82,7 +84,7 @@ def _parse_pkg(match, regexp_match, data, e,v,r,a):
# Worthless speed hacks?
if match == n:
return True
@@ -198458,7 +198586,7 @@ index 8a6f6f3..16b647f 100644
match[0] != n[0] and match[0] != e[0]):
return False
-@@ -179,7 +179,11 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
+@@ -179,7 +181,11 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
self.prco = { 'obsoletes': (),
'conflicts': (),
'requires': (),
@@ -198471,7 +198599,7 @@ index 8a6f6f3..16b647f 100644
self.sack = repo.sack
self.repoid = repo.id
self.repo = repo
-@@ -298,13 +302,14 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
+@@ -298,13 +304,14 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
"WHERE packages.pkgId = ?", (self.pkgId,))
for ob in cur:
dirname = ob['dirname']
@@ -198490,7 +198618,7 @@ index 8a6f6f3..16b647f 100644
filetype = _share_data(filetypes.pop())
result.setdefault(filetype,[]).append(filename)
self._loadedfiles = True
-@@ -382,7 +387,21 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
+@@ -382,7 +389,21 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
def returnPrco(self, prcotype, printable=False):
prcotype = _share_data(prcotype)
@@ -198513,7 +198641,7 @@ index 8a6f6f3..16b647f 100644
sql = "SELECT name, version, release, epoch, flags " \
"FROM %s WHERE pkgKey = ?" % prcotype
cur = self._sql_MD('primary', sql, (self.pkgKey,))
-@@ -406,7 +425,7 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
+@@ -406,7 +427,7 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
requires = []
for ob in cur:
pre = "0"
@@ -198522,7 +198650,36 @@ index 8a6f6f3..16b647f 100644
pre = "1"
prco_set = (_share_data(ob['name']), _share_data(ob['flags']),
(_share_data(ob['epoch']),
-@@ -917,8 +936,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+@@ -729,7 +750,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+ data = self._sql_MD('primary', repo, sql, (pkgKey,)).fetchone()
+ if data is None:
+ msg = "pkgKey %s doesn't exist in repo %s" % (pkgKey, repo)
+- raise Errors.RepoError, msg
++ raise Errors.RepoError(msg, repo=repo)
+ if exclude and self._pkgExcludedRKD(repo, pkgKey, data):
+ return None
+ po = self.pc(repo, data)
+@@ -798,7 +819,8 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+ self.excludes[repo] = {}
+
+ if dataobj is None:
+- raise Errors.RepoError, "Tried to add None %s to %s" % (datatype, repo)
++ raise Errors.RepoError("Tried to add None %s to %s" % (datatype, repo),
++ repo=repo)
+
+ if datatype == 'metadata':
+ self.primarydb[repo] = dataobj
+@@ -808,7 +830,8 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+ self.otherdb[repo] = dataobj
+ else:
+ # We can not handle this yet...
+- raise Errors.RepoError, "Sorry sqlite does not support %s in %s" % (datatype, repo)
++ raise Errors.RepoError("Sorry sqlite does not support %s in %s" % (datatype, repo),
++ repo=repo)
+
+ self.added[repo].append(datatype)
+
+@@ -917,8 +940,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
# ultra simple optimization
if misc.re_primary_filename(name):
@@ -198532,7 +198689,16 @@ index 8a6f6f3..16b647f 100644
if len(self.filelistsdb) == 0:
# grab repo object from primarydb and force filelists population in this sack using repo
-@@ -1560,7 +1578,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+@@ -938,7 +960,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+ pri_pkgs = self._sql_MD_pkg_num('primary', repo)
+ fil_pkgs = self._sql_MD_pkg_num('filelists', repo)
+ if pri_pkgs != fil_pkgs:
+- raise Errors.RepoError
++ raise Errors.RepoError('Check of Primary and Filelists sync. failed.', repo=repo)
+ repo._checked_filelists_pkgs = True
+
+ sql_params = []
+@@ -1560,7 +1582,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
patterns = tmp
return (need_full, patterns, fields, False)
@@ -198541,7 +198707,7 @@ index 8a6f6f3..16b647f 100644
def _yieldSQLDataList(self, repoid, patterns, fields, ignore_case):
"""Yields all the package data for the given params. Excludes are done
at this stage. """
-@@ -1593,6 +1611,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+@@ -1593,6 +1615,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
for x in cur:
yield (repo, x)
@@ -198549,7 +198715,7 @@ index 8a6f6f3..16b647f 100644
def _buildPkgObjList(self, repoid=None, patterns=None, ignore_case=False):
"""Builds a list of packages, only containing nevra information.
Excludes are done at this stage. """
-@@ -1666,6 +1685,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
+@@ -1666,6 +1689,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack):
return returnList
@@ -199650,7 +199816,7 @@ index 0000000..8d91f88
+ return txmbrs
+
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..35359e2 100644
+index e5e9ece..4d64dff 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -199738,16 +199904,19 @@ index e5e9ece..35359e2 100644
warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning)
-@@ -104,7 +146,7 @@ class YumPackageSack(packageSack.PackageSack):
+@@ -103,8 +145,9 @@ class YumPackageSack(packageSack.PackageSack):
+ elif datatype in ['filelists', 'otherdata']:
if repo in self.added:
if 'metadata' not in self.added[repo]:
- raise Errors.RepoError, '%s md for %s imported before primary' \
+- raise Errors.RepoError, '%s md for %s imported before primary' \
- % (datatype, repo.id)
-+ % (datatype, repo.ui_id)
++ raise Errors.RepoError('%s md for %s imported before primary' \
++ % (datatype, repo.ui_id),
++ repo=self)
current = 0
for pkgid in dataobj:
current += 1
-@@ -121,6 +163,26 @@ class YumPackageSack(packageSack.PackageSack):
+@@ -121,6 +164,26 @@ class YumPackageSack(packageSack.PackageSack):
# umm, wtf?
pass
@@ -199774,7 +199943,7 @@ index e5e9ece..35359e2 100644
def populate(self, repo, mdtype='metadata', callback=None, cacheonly=0):
if mdtype == 'all':
data = ['metadata', 'filelists', 'otherdata']
-@@ -138,8 +200,6 @@ class YumPackageSack(packageSack.PackageSack):
+@@ -138,8 +201,6 @@ class YumPackageSack(packageSack.PackageSack):
if item in self.added[repo]:
continue
@@ -199783,7 +199952,7 @@ index e5e9ece..35359e2 100644
if item == 'metadata':
mydbtype = 'primary_db'
mymdtype = 'primary'
-@@ -162,25 +222,39 @@ class YumPackageSack(packageSack.PackageSack):
+@@ -162,25 +223,41 @@ class YumPackageSack(packageSack.PackageSack):
continue
if self._check_db_version(repo, mydbtype):
@@ -199811,7 +199980,8 @@ index e5e9ece..35359e2 100644
+ db_un_fn = self._check_uncompressed_db_gen(repo,
+ mydbtype)
+ if not db_un_fn: # Shouldn't happen?
-+ raise Errors.RepoError, '%s: Check uncompressed DB failed' % repo
++ raise Errors.RepoError('%s: Check uncompressed DB failed' % repo,
++ repo=self)
dobj = repo.cacheHandler.open_database(db_un_fn)
@@ -199825,13 +199995,14 @@ index e5e9ece..35359e2 100644
+ gen = mymdtype + '.xml'
+ ret = misc.repo_gen_decompress(xml, gen, cached=repo.cache)
+ if not ret:
-+ raise Errors.RepoError, '%s: Decompress DB failed' % repo
++ raise Errors.RepoError('%s: Decompress DB failed' % repo,
++ repo=self)
+ xml = ret
+ # Convert XML => .sqlite
xmldata = repo.repoXML.getData(mymdtype)
(ctype, csum) = xmldata.checksum
dobj = repo_cache_function(xml, csum)
-@@ -193,6 +267,25 @@ class YumPackageSack(packageSack.PackageSack):
+@@ -193,6 +270,25 @@ class YumPackageSack(packageSack.PackageSack):
# get rid of all this stuff we don't need now
del repo.cacheHandler
@@ -199857,7 +200028,7 @@ index e5e9ece..35359e2 100644
def _check_uncompressed_db(self, repo, mdtype):
"""return file name of uncompressed db is good, None if not"""
mydbdata = repo.repoXML.getData(mdtype)
-@@ -201,12 +294,13 @@ class YumPackageSack(packageSack.PackageSack):
+@@ -201,12 +297,13 @@ class YumPackageSack(packageSack.PackageSack):
compressed_fn = repo.cachedir + '/' + fname
db_un_fn = misc.decompress(compressed_fn, fn_only=True)
@@ -199874,7 +200045,7 @@ index e5e9ece..35359e2 100644
try:
repo.checkMD(db_un_fn, mdtype, openchecksum=True)
-@@ -240,7 +334,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -240,7 +337,6 @@ class YumRepository(Repository, config.RepoConf):
# eventually want
self.repoMDFile = 'repodata/repomd.xml'
self._repoXML = None
@@ -199882,7 +200053,7 @@ index e5e9ece..35359e2 100644
self._oldRepoMDData = {}
self.cache = 0
self.mirrorlistparsed = 0
-@@ -260,10 +353,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -260,10 +356,11 @@ class YumRepository(Repository, config.RepoConf):
self.copy_local = 0
# holder for stuff we've grabbed
self.retrieved = { 'primary':0, 'filelists':0, 'other':0, 'group':0,
@@ -199895,7 +200066,7 @@ index e5e9ece..35359e2 100644
self.failure_obj = None
self.mirror_failure_obj = None
self.interrupt_callback = None
-@@ -285,6 +379,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -285,6 +382,7 @@ class YumRepository(Repository, config.RepoConf):
self._grabfunc = None
self._grab = None
@@ -199903,7 +200074,7 @@ index e5e9ece..35359e2 100644
def __cmp__(self, other):
""" Sort yum repos. by cost, and then by alphanumeric on their id. """
-@@ -311,6 +406,36 @@ class YumRepository(Repository, config.RepoConf):
+@@ -311,6 +409,36 @@ class YumRepository(Repository, config.RepoConf):
return self._sack
sack = property(_getSack)
@@ -199940,7 +200111,7 @@ index e5e9ece..35359e2 100644
def close(self):
if self._sack is not None:
self.sack.close()
-@@ -350,6 +475,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -350,6 +478,10 @@ class YumRepository(Repository, config.RepoConf):
return thisdata.location
def __str__(self):
@@ -199951,7 +200122,17 @@ index e5e9ece..35359e2 100644
return self.id
def _checksum(self, sumtype, file, CHUNK=2**16, checksum_can_fail=False,
-@@ -378,7 +507,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -363,7 +495,8 @@ class YumRepository(Repository, config.RepoConf):
+ except (Errors.MiscError, EnvironmentError), e:
+ if checksum_can_fail:
+ return None
+- raise Errors.RepoError, 'Error opening file for checksum: %s' % e
++ raise Errors.RepoError('Error opening file for checksum: %s' % e,
++ repo=self)
+
+ def dump(self):
+ output = '[%s]\n' % self.id
+@@ -378,7 +511,7 @@ class YumRepository(Repository, config.RepoConf):
'basecachedir', 'http_headers', 'metadata_cookie',
'metadata_cookie_fn', 'quick_enable_disable',
'repoMDFile', 'timestamp_check', 'urls', 'mirrorurls',
@@ -199960,16 +200141,18 @@ index e5e9ece..35359e2 100644
for attr in dir(self):
if attr.startswith('_'):
continue
-@@ -422,7 +551,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -421,8 +554,8 @@ class YumRepository(Repository, config.RepoConf):
+ """self-check the repo information - if we don't have enough to move
on then raise a repo error"""
if len(self._urls) < 1 and not self.mediaid:
- raise Errors.RepoError, \
+- raise Errors.RepoError, \
- 'Cannot find a valid baseurl for repo: %s' % self.id
-+ 'Cannot find a valid baseurl for repo: %s' % self.ui_id
++ raise Errors.RepoError('Cannot find a valid baseurl for repo: %s' %
++ self.ui_id, repo=self)
def doProxyDict(self):
if self._proxy_dict:
-@@ -431,25 +560,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -431,25 +564,18 @@ class YumRepository(Repository, config.RepoConf):
self._proxy_dict = {} # zap it
proxy_string = None
empty = (None, '_none_', '')
@@ -200003,7 +200186,7 @@ index e5e9ece..35359e2 100644
if proxy_string is not None:
self._proxy_dict['http'] = proxy_string
-@@ -483,22 +605,63 @@ class YumRepository(Repository, config.RepoConf):
+@@ -483,22 +609,63 @@ class YumRepository(Repository, config.RepoConf):
ugopts = self._default_grabopts()
self._grabfunc = URLGrabber(progress_obj=self.callback,
@@ -200071,7 +200254,7 @@ index e5e9ece..35359e2 100644
'http_headers': tuple(self.__headersListFromDict(cache=cache)),
'ssl_verify_peer': self.sslverify,
'ssl_verify_host': self.sslverify,
-@@ -509,6 +672,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -509,6 +676,10 @@ class YumRepository(Repository, config.RepoConf):
'username': self.username,
'password': self.password,
}
@@ -200082,7 +200265,7 @@ index e5e9ece..35359e2 100644
return opts
def _getgrabfunc(self):
-@@ -531,9 +698,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -531,15 +702,12 @@ class YumRepository(Repository, config.RepoConf):
if os.path.exists(dpath) and os.path.isdir(dpath):
return
@@ -200092,7 +200275,14 @@ index e5e9ece..35359e2 100644
try:
os.makedirs(dpath, mode=0755)
except OSError, e:
-@@ -561,7 +725,7 @@ class YumRepository(Repository, config.RepoConf):
+ msg = "%s: %s %s: %s" % ("Error making cache directory",
+ dpath, "error was", e)
+- raise Errors.RepoError, msg
++ raise Errors.RepoError(msg, repo=self)
+
+ def dirSetup(self):
+ """make the necessary dirs, if possible, raise on failure"""
+@@ -561,7 +729,7 @@ class YumRepository(Repository, config.RepoConf):
cookie = self.cachedir + '/' + self.metadata_cookie_fn
self.setAttribute('_dir_setup_metadata_cookie', cookie)
@@ -200101,7 +200291,7 @@ index e5e9ece..35359e2 100644
self._dirSetupMkdir_p(dir)
# persistdir is really root-only but try the make anyway and just
-@@ -714,15 +878,15 @@ class YumRepository(Repository, config.RepoConf):
+@@ -714,16 +882,16 @@ class YumRepository(Repository, config.RepoConf):
local = self.metalink_filename + '.tmp'
if not self._metalinkCurrent():
url = misc.to_utf8(self.metalink)
@@ -200117,11 +200307,13 @@ index e5e9ece..35359e2 100644
if not os.path.exists(self.metalink_filename):
msg = ("Cannot retrieve metalink for repository: %s. "
- "Please verify its path and try again" % self )
+- raise Errors.RepoError, msg
+ "Please verify its path and try again" % self.ui_id )
- raise Errors.RepoError, msg
++ raise Errors.RepoError(msg, repo=self)
# Now, we have an old usable metalink, so we can't move to
# a newer repomd.xml ... or checksums won't match.
-@@ -749,9 +913,22 @@ class YumRepository(Repository, config.RepoConf):
+ print "Could not get metalink %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))
+@@ -749,9 +917,22 @@ class YumRepository(Repository, config.RepoConf):
value),
fdel=lambda self: setattr(self, "_metalink", None))
@@ -200145,25 +200337,30 @@ index e5e9ece..35359e2 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"""
-@@ -768,7 +945,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -767,18 +948,16 @@ class YumRepository(Repository, config.RepoConf):
+ copy_local = self.copy_local
if local is None or relative is None:
- raise Errors.RepoError, \
+- raise Errors.RepoError, \
- "get request for Repo %s, gave no source or dest" % self.id
-+ "get request for Repo %s, gave no source or dest" % self.ui_id
++ raise Errors.RepoError("get request for Repo %s, gave no source or dest" % self.ui_id,
++ repo=self)
if self.cache == 1:
if os.path.exists(local): # FIXME - we should figure out a way
-@@ -778,7 +955,7 @@ class YumRepository(Repository, config.RepoConf):
- raise Errors.RepoError, \
- "Caching enabled but no local cache of %s from %s" % (local,
+ return local # to run the checkfunc from here
+ else: # ain't there - raise
+- raise Errors.RepoError, \
+- "Caching enabled but no local cache of %s from %s" % (local,
+-
- self)
-+ self.ui_id)
++ raise Errors.RepoError("Caching enabled but no local cache of %s from %s" % (local, self.ui_id),
++ repo=self)
if url:
(scheme, netloc, path, query, fragid) = urlparse.urlsplit(url)
-@@ -796,6 +973,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -796,6 +975,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,))
@@ -200171,16 +200368,16 @@ index e5e9ece..35359e2 100644
+ dirstat = os.statvfs(os.path.dirname(local))
+ avail = dirstat.f_bavail * dirstat.f_bsize
+ if avail < long(size):
-+ raise Errors.RepoError, _('''\
++ raise Errors.RepoError(_('''\
+Insufficient space in download directory %s
+ * free %s
+ * needed %s'''
-+ ) % (os.path.dirname(local), format_number(avail), format_number(long(size)))
++ ) % (os.path.dirname(local), format_number(avail), format_number(long(size))), repo=self)
+
if url and scheme != "media":
ugopts = self._default_grabopts(cache=cache)
ug = URLGrabber(progress_obj = self.callback,
-@@ -815,15 +1002,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -815,15 +1004,9 @@ class YumRepository(Repository, config.RepoConf):
range=(start, end),
)
except URLGrabError, e:
@@ -200195,13 +200392,11 @@ index e5e9ece..35359e2 100644
-
+ self._del_dl_file(local, size)
+ errstr = "failed to retrieve %s from %s\nerror was %s" % (relative, self, e)
-+ e = Errors.RepoError(errstr)
-+ e.repo = self
-+ raise e
++ raise Errors.RepoError(errstr, repo=self)
else:
headers = tuple(self.__headersListFromDict(cache=cache))
-@@ -835,19 +1018,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -835,19 +1018,19 @@ class YumRepository(Repository, config.RepoConf):
reget = reget,
checkfunc=checkfunc,
http_headers=headers,
@@ -200218,9 +200413,7 @@ index e5e9ece..35359e2 100644
+ self._del_dl_file(local, size)
+ errstr = "failure: %s from %s: %s" % (relative, self, e)
+ errors = getattr(e, 'errors', None)
-+ e = Errors.NoMoreMirrorsRepoError(errstr, errors)
-+ e.repo = self
-+ raise e
++ raise Errors.NoMoreMirrorsRepoError(errstr, errors, repo=self)
return result
__get = _getFile
@@ -200230,7 +200423,7 @@ index e5e9ece..35359e2 100644
remote = package.relativepath
local = package.localPkg()
basepath = package.basepath
-@@ -857,15 +1042,30 @@ class YumRepository(Repository, config.RepoConf):
+@@ -857,15 +1040,30 @@ class YumRepository(Repository, config.RepoConf):
return local
misc.unlink_f(local)
@@ -200255,14 +200448,14 @@ index e5e9ece..35359e2 100644
+ # Don't return as "success" when bad.
+ msg = "Downloaded package %s, from %s, but it was invalid."
+ msg = msg % (package, package.repo.id)
-+ raise Errors.RepoError, msg
++ raise Errors.RepoError(msg, repo=self)
+
+ return ret
+
def getHeader(self, package, checkfunc = None, reget = 'simple',
cache = True):
-@@ -894,19 +1094,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -894,19 +1092,16 @@ class YumRepository(Repository, config.RepoConf):
mC_def = self.withinCacheAge(self.metadata_cookie, self.metadata_expire)
if not mC_def: # Normal path...
@@ -200282,7 +200475,17 @@ index e5e9ece..35359e2 100644
return False
self._metadataCurrent = True
-@@ -933,7 +1130,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -921,7 +1116,8 @@ class YumRepository(Repository, config.RepoConf):
+ return self._metadataCurrent
+
+ if self.cache and not os.path.exists(self.metalink_filename):
+- raise Errors.RepoError, 'Cannot find metalink.xml file for %s' %self
++ raise Errors.RepoError('Cannot find metalink.xml file for %s' %self,
++ repo=self)
+
+ if self.cache:
+ self._metadataCurrent = True
+@@ -933,7 +1129,7 @@ class YumRepository(Repository, config.RepoConf):
self._metadataCurrent = False
return self._metadataCurrent
@@ -200291,7 +200494,7 @@ index e5e9ece..35359e2 100644
"""check if any file is older than a certain amount of time. Used for
the cachecookie and the mirrorlist
return True if w/i the expiration time limit
-@@ -943,6 +1140,24 @@ class YumRepository(Repository, config.RepoConf):
+@@ -943,6 +1139,24 @@ class YumRepository(Repository, config.RepoConf):
file. If any of them are newer then invalidate the cache
"""
@@ -200316,7 +200519,7 @@ index e5e9ece..35359e2 100644
# -1 is special and should never get refreshed
if expiration_time == -1 and os.path.exists(myfile):
return True
-@@ -955,6 +1170,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -955,6 +1169,9 @@ class YumRepository(Repository, config.RepoConf):
elif cookie_info[8] > time.time():
val = False
@@ -200326,43 +200529,61 @@ index e5e9ece..35359e2 100644
# make sure none of our config files for this repo are newer than
# us
if cookie_info[8] < int(self.repo_config_age):
-@@ -991,7 +1209,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -991,7 +1208,8 @@ class YumRepository(Repository, config.RepoConf):
def _cachingRepoXML(self, local):
""" Should we cache the current repomd.xml """
if self.cache and not os.path.exists(local):
- raise Errors.RepoError, 'Cannot find repomd.xml file for %s' % self
-+ raise Errors.RepoError, 'Cannot find repomd.xml file for %s' % self.ui_id
++ raise Errors.RepoError('Cannot find repomd.xml file for %s' % self.ui_id,
++ repo=self)
if self.cache or self.metadataCurrent():
return True
return False
-@@ -1020,7 +1238,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1019,8 +1237,9 @@ class YumRepository(Repository, config.RepoConf):
+ misc.unlink_f(tfname)
if grab_can_fail:
return None
- raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
+- raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
- except (Errors.NoMoreMirrorsRepoError, Errors.RepoError):
++ raise Errors.RepoError('Error downloading file %s: %s' % (local, e),
++ repo=self)
+ except Errors.RepoError:
misc.unlink_f(tfname)
if grab_can_fail:
return None
-@@ -1047,7 +1265,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1034,8 +1253,9 @@ class YumRepository(Repository, config.RepoConf):
+ misc.unlink_f(tfname)
+ if grab_can_fail:
+ return None
+- raise Errors.RepoError, 'Error renaming file %s to %s' % (result,
+- local)
++ raise Errors.RepoError('Error renaming file %s to %s' % (result,
++ local),
++ repo=self)
+ return local
+
+ def _parseRepoXML(self, local, parse_can_fail=None):
+@@ -1047,7 +1267,8 @@ class YumRepository(Repository, config.RepoConf):
parse_can_fail = 'old_repo_XML' in self._oldRepoMDData
if parse_can_fail:
return None
- raise Errors.RepoError, 'Error importing repomd.xml from %s: %s' % (self, e)
-+ raise Errors.RepoError, 'Error importing repomd.xml from %s: %s' % (self.ui_id, e)
++ raise Errors.RepoError('Error importing repomd.xml from %s: %s' % (self.ui_id, e),
++ repo=self)
def _saveOldRepoXML(self, local):
""" If we have an older repomd.xml file available, save it out. """
-@@ -1074,7 +1292,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1074,7 +1295,8 @@ class YumRepository(Repository, config.RepoConf):
# We still want the old data, so we don't download twice. So we
# pretend everything is good until the revert.
if not self.timestamp_check:
- raise Errors.RepoError, "Can't download or revert repomd.xml"
-+ raise Errors.RepoError, "Can't download or revert repomd.xml for %s" % self.ui_id
++ raise Errors.RepoError("Can't download or revert repomd.xml for %s" % self.ui_id,
++ repo=self)
if 'old_repo_XML' not in self._oldRepoMDData:
self._oldRepoMDData = {}
-@@ -1250,7 +1468,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1250,7 +1472,6 @@ class YumRepository(Repository, config.RepoConf):
self._revertOldRepoXML()
return False
@@ -200370,7 +200591,7 @@ index e5e9ece..35359e2 100644
if caching:
return False # Skip any work.
-@@ -1260,6 +1477,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1260,6 +1481,9 @@ class YumRepository(Repository, config.RepoConf):
return True
def _check_db_version(self, mdtype, repoXML=None):
@@ -200380,7 +200601,7 @@ index e5e9ece..35359e2 100644
if repoXML is None:
repoXML = self.repoXML
if mdtype in repoXML.repoData:
-@@ -1277,11 +1497,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1501,11 @@ class YumRepository(Repository, config.RepoConf):
return None
if not file_check:
@@ -200395,7 +200616,7 @@ index e5e9ece..35359e2 100644
if not os.path.exists(local):
local = misc.decompress(local, fn_only=True)
compressed = True
-@@ -1302,6 +1522,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1302,6 +1526,17 @@ class YumRepository(Repository, config.RepoConf):
into the delete list, this means metadata can change filename
without us leaking it. """
@@ -200413,7 +200634,7 @@ index e5e9ece..35359e2 100644
def _mdtype_eq(omdtype, odata, nmdtype, ndata):
""" Check if two returns from _get_mdtype_data() are equal. """
if ndata is None:
-@@ -1321,6 +1552,14 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1321,6 +1556,14 @@ class YumRepository(Repository, config.RepoConf):
return True
all_mdtypes = self.retrieved.keys()
@@ -200428,7 +200649,7 @@ index e5e9ece..35359e2 100644
if mdtypes is None:
mdtypes = all_mdtypes
-@@ -1332,9 +1571,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1332,9 +1575,8 @@ class YumRepository(Repository, config.RepoConf):
self._oldRepoMDData['old_MD_files'] = reverts
# Inited twice atm. ... sue me
@@ -200440,7 +200661,7 @@ index e5e9ece..35359e2 100644
for mdtype in all_mdtypes:
(nmdtype, ndata) = self._get_mdtype_data(mdtype)
-@@ -1371,43 +1609,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1613,16 @@ class YumRepository(Repository, config.RepoConf):
# No old repomd data, but we might still have uncompressed MD
if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
@@ -200456,14 +200677,14 @@ index e5e9ece..35359e2 100644
- if len(downloading_with_size) == 1:
- downloading_no_size.extend(downloading_with_size)
- downloading_with_size = []
-+ def _commonRetrieveDataMD_done(self, downloading):
-+ """ Uncompress the downloaded metadata """
-
+-
- remote_size = 0
- local_size = 0
- for (ndata, nmdtype) in downloading_with_size: # Get total size...
- remote_size += int(ndata.size)
--
++ def _commonRetrieveDataMD_done(self, downloading):
++ """ Uncompress the downloaded metadata """
+
- for (ndata, nmdtype) in downloading_with_size:
- urlgrabber.progress.text_meter_total_size(remote_size, local_size)
- if not self._retrieveMD(nmdtype, retrieve_can_fail=True):
@@ -200490,7 +200711,7 @@ index e5e9ece..35359e2 100644
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,11 +1632,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,11 +1636,11 @@ class YumRepository(Repository, config.RepoConf):
self._commonRetrieveDataMD(mdtypes)
def _mdpolicy2mdtypes(self):
@@ -200506,7 +200727,7 @@ index e5e9ece..35359e2 100644
mdtypes = set()
if type(self.mdpolicy) in types.StringTypes:
mdtypes.update(md_groups.get(self.mdpolicy, [self.mdpolicy]))
-@@ -1436,6 +1647,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1651,7 @@ class YumRepository(Repository, config.RepoConf):
if not mdtypes or 'group:all' in mdtypes:
mdtypes = None
else:
@@ -200514,12 +200735,13 @@ index e5e9ece..35359e2 100644
mdtypes = sorted(list(mdtypes))
return mdtypes
-@@ -1446,17 +1658,12 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1446,17 +1662,13 @@ class YumRepository(Repository, config.RepoConf):
except KeyboardInterrupt:
self._revertOldRepoXML() # Undo metadata cookie?
raise
- raise Errors.RepoError, 'Bad loadRepoXML policy: %s' % (self.mdpolicy)
-+ raise Errors.RepoError, 'Bad loadRepoXML policy (for %s): %s' % (self.ui_id, self.mdpolicy)
++ raise Errors.RepoError('Bad loadRepoXML policy (for %s): %s' % (self.ui_id, self.mdpolicy),
++ repo=self)
def _getRepoXML(self):
if self._repoXML:
@@ -200534,7 +200756,7 @@ index e5e9ece..35359e2 100644
return self._repoXML
-@@ -1480,7 +1687,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1480,7 +1692,7 @@ class YumRepository(Repository, config.RepoConf):
result = self._getFile(relative='repodata/repomd.xml.asc',
copy_local=1,
local = sigfile,
@@ -200543,7 +200765,7 @@ index e5e9ece..35359e2 100644
reget=None,
checkfunc=None,
cache=self.http_caching == 'all',
-@@ -1508,6 +1715,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1508,6 +1720,18 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-1, 'repomd.xml does not match metalink for %s' %
self)
@@ -200562,7 +200784,7 @@ index e5e9ece..35359e2 100644
def checkMD(self, fn, mdtype, openchecksum=False):
"""check the metadata type against its checksum"""
-@@ -1537,6 +1756,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1761,16 @@ class YumRepository(Repository, config.RepoConf):
if size is not None:
size = int(size)
@@ -200579,7 +200801,7 @@ index e5e9ece..35359e2 100644
try: # get the local checksum
l_csum = self._checksum(r_ctype, file, datasize=size)
except Errors.RepoError, e:
-@@ -1545,21 +1774,20 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1545,21 +1779,20 @@ class YumRepository(Repository, config.RepoConf):
raise URLGrabError(-3, 'Error performing checksum')
if l_csum == r_csum:
@@ -200603,7 +200825,7 @@ index e5e9ece..35359e2 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1575,37 +1803,38 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1575,37 +1808,38 @@ class YumRepository(Repository, config.RepoConf):
# got it, move along
return local
@@ -200635,7 +200857,7 @@ index e5e9ece..35359e2 100644
+ msg = "Caching enabled and local cache: %s does not match checksum" % local
+ else:
+ msg = "Caching enabled but no local cache of %s from %s" % (local, self.ui_id)
-+ raise Errors.RepoError, msg
++ raise Errors.RepoError(msg, repo=self)
+
try:
- checkfunc = (self.checkMD, (mdtype,), {})
@@ -200662,7 +200884,7 @@ index e5e9ece..35359e2 100644
local = self._getFile(relative=remote,
local=local,
copy_local=1,
-@@ -1613,8 +1842,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,18 +1847,18 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -200674,18 +200896,19 @@ index e5e9ece..35359e2 100644
if retrieve_can_fail:
return None
raise
-@@ -1622,9 +1852,8 @@ class YumRepository(Repository, config.RepoConf):
+ except URLGrabError, e:
if retrieve_can_fail:
return None
- raise Errors.RepoError, \
+- raise Errors.RepoError, \
- "Could not retrieve %s matching remote checksum from %s" % (local, self)
-+ "Could not retrieve %s matching remote checksum from %s" % (local, self.ui_id)
++ raise Errors.RepoError("Could not retrieve %s matching remote checksum from %s" % (local, self.ui_id),
++ repo=self)
else:
- self.retrieved[mdtype] = 1
return local
-@@ -1646,13 +1875,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1880,21 @@ class YumRepository(Repository, config.RepoConf):
def getGroups(self):
"""gets groups and returns group file path for the repository, if there
@@ -200710,7 +200933,7 @@ index e5e9ece..35359e2 100644
self._callbacks_changed = True
def setFailureObj(self, failure_obj):
-@@ -1681,7 +1918,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1923,7 @@ class YumRepository(Repository, config.RepoConf):
print "Could not read mirrorlist %s, error was \n%s" %(url, e)
content = []
for line in content:
@@ -200719,7 +200942,7 @@ index e5e9ece..35359e2 100644
continue
mirror = line.rstrip() # no more trailing \n's
mirror = mirror.replace('$ARCH', '$BASEARCH')
-@@ -1701,7 +1938,8 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1701,7 +1943,8 @@ class YumRepository(Repository, config.RepoConf):
fo = None
cacheok = False
@@ -200729,7 +200952,7 @@ index e5e9ece..35359e2 100644
cacheok = True
fo = open(self.mirrorlist_file, 'r')
url = 'file://' + self.mirrorlist_file # just to keep self._readMirrorList(fo,url) happy
-@@ -1713,7 +1951,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1713,7 +1956,7 @@ class YumRepository(Repository, config.RepoConf):
ugopts = self._default_grabopts()
try:
fo = urlgrabber.grabber.urlopen(url, **ugopts)
@@ -200738,7 +200961,7 @@ index e5e9ece..35359e2 100644
print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))
fo = None
-@@ -1740,7 +1978,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1740,7 +1983,11 @@ class YumRepository(Repository, config.RepoConf):
if os.path.exists(destfn):
if os.stat(fn)[stat.ST_CTIME] <= os.stat(destfn)[stat.ST_CTIME]:
return False
@@ -200751,7 +200974,7 @@ index e5e9ece..35359e2 100644
return True
def _preload_file_from_system_cache(self, filename, subdir='',
-@@ -1877,7 +2119,7 @@ def getMirrorList(mirrorlist, pdict = None):
+@@ -1877,7 +2124,7 @@ def getMirrorList(mirrorlist, pdict = None):
try:
fo = urlresolver.urlopen(url, proxies=pdict)
@@ -200761,7 +200984,7 @@ index e5e9ece..35359e2 100644
fo = None
diff --git a/yumcommands.py b/yumcommands.py
-index 4dcbea7..74e4d86 100644
+index 4dcbea7..b610f3a 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -13,6 +13,7 @@
@@ -203772,7 +203995,7 @@ index 4dcbea7..74e4d86 100644
chkcmd = 'all'
if extcmds:
chkcmd = extcmds
-@@ -1505,33 +3190,1744 @@ class CheckRpmdbCommand(YumCommand):
+@@ -1505,33 +3190,1745 @@ class CheckRpmdbCommand(YumCommand):
return rc, ['%s %s' % (basecmd, chkcmd)]
def needTs(self, base, basecmd, extcmds):
@@ -204732,7 +204955,8 @@ index 4dcbea7..74e4d86 100644
+
+class UpdateMinimalCommand(YumCommand):
+ def getNames(self):
-+ return ['update-minimal', 'upgrade-minimal']
++ return ['update-minimal', 'upgrade-minimal',
++ 'minimal-update', 'minimal-upgrade']
+
+ def getUsage(self):
+ return "[PACKAGE-wildcard]"
@@ -205525,7 +205749,7 @@ index 4dcbea7..74e4d86 100644
+
+ return 0, [basecmd + ' ' + subcommand + ' done']
diff --git a/yummain.py b/yummain.py
-index 9f79f4f..fa76af8 100755
+index 9f79f4f..ee8d632 100755
--- a/yummain.py
+++ b/yummain.py
@@ -29,13 +29,13 @@ from yum import Errors
@@ -205684,7 +205908,25 @@ index 9f79f4f..fa76af8 100755
elif result == 1:
# Fatal error
for msg in resultmsgs:
-@@ -181,6 +217,8 @@ def main(args):
+@@ -173,6 +209,17 @@ def main(args):
+ logger.critical(msg)
+ if unlock(): return 200
+ return 3
++
++ # Mainly for ostree, but might be useful for others.
++ if base.conf.usr_w_check:
++ usrinstpath = base.conf.installroot + "/usr"
++ usrinstpath = usrinstpath.replace('//', '/')
++ if not os.access(usrinstpath, os.W_OK):
++ logger.critical(_('No write access to %s directory') % usrinstpath)
++ logger.critical(_(' Maybe this is an ostree image?'))
++ logger.critical(_(' To disable you can use --setopt=usr_w_check=false'))
++ if unlock(): return 200
++ return 1
+
+ # Depsolve stage
+ verbose_logger.log(logginglevels.INFO_2, _('Resolving Dependencies'))
+@@ -181,6 +228,8 @@ def main(args):
(result, resultmsgs) = base.buildTransaction()
except plugins.PluginYumExit, e:
return exPluginExit(e)
@@ -205693,7 +205935,7 @@ index 9f79f4f..fa76af8 100755
except Errors.YumBaseError, e:
result = 1
resultmsgs = [exception2msg(e)]
-@@ -193,7 +231,7 @@ def main(args):
+@@ -193,7 +242,7 @@ def main(args):
if result == 0:
# Normal exit
if unlock(): return 200
@@ -205702,7 +205944,7 @@ index 9f79f4f..fa76af8 100755
elif result == 1:
# Fatal error
for msg in resultmsgs:
-@@ -223,6 +261,8 @@ def main(args):
+@@ -223,6 +272,8 @@ def main(args):
return_code = base.doTransaction()
except plugins.PluginYumExit, e:
return exPluginExit(e)
@@ -205711,7 +205953,7 @@ index 9f79f4f..fa76af8 100755
except Errors.YumBaseError, e:
return exFatal(e)
except KeyboardInterrupt:
-@@ -238,16 +278,27 @@ def main(args):
+@@ -238,16 +289,27 @@ def main(args):
rpmdb_warn_checks()
return_code = result
if base._ts_save_file:
@@ -205741,7 +205983,7 @@ index 9f79f4f..fa76af8 100755
import hotshot.stats
fn = os.path.expanduser("~/yum.prof")
prof = hotshot.Profile(fn)
-@@ -257,6 +308,11 @@ def hotshot(func, *args, **kwargs):
+@@ -257,6 +319,11 @@ def hotshot(func, *args, **kwargs):
return rc
def cprof(func, *args, **kwargs):
@@ -205753,7 +205995,7 @@ index 9f79f4f..fa76af8 100755
import cProfile, pstats
fn = os.path.expanduser("~/yum.prof")
prof = cProfile.Profile()
-@@ -266,6 +322,10 @@ def cprof(func, *args, **kwargs):
+@@ -266,6 +333,10 @@ def cprof(func, *args, **kwargs):
return rc
def print_stats(stats):
@@ -205764,7 +206006,7 @@ index 9f79f4f..fa76af8 100755
stats.strip_dirs()
stats.sort_stats('time', 'calls')
stats.print_stats(20)
-@@ -273,7 +333,14 @@ def print_stats(stats):
+@@ -273,7 +344,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 94fe015..d391000 100644
--- a/yum.spec
+++ b/yum.spec
@@ -64,7 +64,7 @@ BuildRequires: bash-completion
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 146%{?dist}
+Release: 147%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -507,6 +507,15 @@ exit 0
%endif
%changelog
+* Wed May 21 2014 James Antill <james at fedoraproject.org> - 3.4.3-147
+- update to latest HEAD
+- Check /usr for writability before running a transaction.
+- Add repo= arguments to almost all RepoError raises, so we don't print unknown.
+- Add/fix upgrade-minimal typos from man page.
+- Replace vars in include lines in .repo files. BZ 977380.
+- Make --setopt handle spaces properly. BZ 1094373
+- Fix traceback when the history dir is empty. BZ 875610
+
* Tue Apr 15 2014 James Antill <james at fedoraproject.org> - 3.4.3-146
- update to latest HEAD
- Fix for weird anaconda C NULL exception traceback. BZ 1058297.
More information about the scm-commits
mailing list