[yum] Update to latest HEAD.
James Antill
james at fedoraproject.org
Mon Aug 26 04:03:56 UTC 2013
commit ee1e3730cf61838d9519b5f2ee0cfaa64084c052
Author: James Antill <james at and.org>
Date: Mon Aug 26 00:02:41 2013 -0400
Update to latest HEAD.
- Pass requirement to compare_proviers so we can use provides version compare.
- Show conf. file in yum-cron error message.
- Add mark convert messages.
- Fix logging level regression, -d9 works again.
- Override users umask for groups files, so users can read it. BZ 982361.
- Fix downgrade keeping .reason, note that remove+install doesn't. BZ 961938.
- Inherit reason from install package into txmbr. BZ BZ 961938.
yum-HEAD.patch | 422 +++++++++++++++++++++++++++++++++++++++++++++-----------
yum.spec | 12 ++-
2 files changed, 355 insertions(+), 79 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 602ccbb..d16f0cb 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -99,7 +99,7 @@ index 2f6154e..2e5a052 100644
diff --git a/cli.py b/cli.py
old mode 100644
new mode 100755
-index 6056d38..0eece17
+index 6056d38..7fa638b
--- a/cli.py
+++ b/cli.py
@@ -25,7 +25,7 @@ import sys
@@ -428,7 +428,7 @@ index 6056d38..0eece17
+ # Note that we shouldn't just remove the 'd' option, or the options
+ # yum accepts will be different which is bad. So always accept it,
+ # but change the prompt.
-+ dl_only = extra={'downloadonly' :
++ dl_only = {'downloadonly' :
+ (u'd', _('d'), _('download'),
+ _('downloadonly'))}
+ if not stuff_to_download:
@@ -183132,10 +183132,10 @@ index 97a9923..6cede1e 100644
@staticmethod
diff --git a/test/simpleupdatetests.py b/test/simpleupdatetests.py
-index 6177fb1..9e22a6b 100644
+index 6177fb1..ba65e55 100644
--- a/test/simpleupdatetests.py
+++ b/test/simpleupdatetests.py
-@@ -990,3 +990,93 @@ class SimpleUpdateTests(OperationsTests):
+@@ -990,3 +990,243 @@ class SimpleUpdateTests(OperationsTests):
# Nothing to do...
self.assert_(res==0, msg)
@@ -183229,6 +183229,156 @@ index 6177fb1..9e22a6b 100644
+ self.assert_(res=='ok', msg)
+ self.assertResult((pax2, pai2, pa2))
+
++ def testUpdateForDeps0(self):
++ foo11 = FakePackage('foo', '1', '1', '0', 'i386')
++ foo11.addRequires('bar', 'EQ', ('0', '1', '1'))
++
++ foo12 = FakePackage('foo', '1', '2', '0', 'i386')
++ foo12.addRequires('bar', 'EQ', ('0', '1', '2'))
++
++ bar11 = FakePackage('bar', '1', '1', '0', 'i386')
++ bar11.yumdb_info.reason = 'dep'
++ bar12 = FakePackage('bar', '1', '2', '0', 'i386')
++
++ res, msg = self.runOperation(['install', 'foo', 'bar'], [foo11, bar11], [foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.tsInfo.makelists()
++ self.assertEquals([], self.tsInfo.depupdated)
++
++ def _pkg2txmbr(self, pkg):
++ for txmbr in self.tsInfo.getMembers(pkg.pkgtup):
++ return txmbr
++ return None
++
++ def _testUpdateForDeps_setup(self):
++ foo11 = FakePackage('foo', '1', '1', '0', 'i386')
++ foo11.addRequires('bar', 'EQ', ('0', '1', '1'))
++
++ foo12 = FakePackage('foo', '1', '2', '0', 'i386')
++ foo12.addRequires('bar', 'EQ', ('0', '1', '2'))
++
++ bar11 = FakePackage('bar', '1', '1', '0', 'i386')
++ bar11.addRequires('foo', 'EQ', ('0', '1', '1'))
++
++ bar12 = FakePackage('bar', '1', '2', '0', 'i386')
++ bar12.addRequires('foo', 'EQ', ('0', '1', '2'))
++
++ return foo11, foo12, bar11, bar12
++
++ def testUpdateForDeps_install_all1(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++
++ res, msg = self.runOperation(['install', 'foo', 'bar'], [foo11, bar11], [foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.tsInfo.makelists()
++ self.assertEquals([], self.tsInfo.depupdated)
++
++ def testUpdateForDeps_upgrade_all2(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++
++ res, msg = self.runOperation(['upgrade', 'foo', 'bar'], [foo11, bar11], [foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.assert_(self._pkg2txmbr(bar12).reason == 'user')
++
++ self.tsInfo.makelists()
++ self.assertEquals([], self.tsInfo.depupdated)
++
++ def testUpdateForDeps_upgrade_all3(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++ bar11.yumdb_info.reason = 'dep'
++
++ res, msg = self.runOperation(['upgrade', 'foo', 'bar'], [foo11, bar11], [foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.assert_(self._pkg2txmbr(bar12).reason == 'dep')
++
++ self.tsInfo.makelists()
++ self.assertEquals([], self.tsInfo.depupdated)
++
++ def testUpdateForDeps_upgrade_foo4(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++ foo11.yumdb_info.reason = 'user'
++ bar11.yumdb_info.reason = 'dep'
++
++ res, msg = self.runOperation(['upgrade', 'foo'], [foo11, bar11], [foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ print foo12.yumdb_info.reason
++ self.assert_(self._pkg2txmbr(foo12).reason == 'user')
++ self.assert_(self._pkg2txmbr(bar12).reason == 'dep')
++
++ self.tsInfo.makelists()
++ self.assertEquals([bar12], self.tsInfo.depupdated)
++
++ def testUpdateForDeps_upgrade_bar5(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++ foo11.yumdb_info.reason = 'user'
++ bar11.yumdb_info.reason = 'dep'
++
++ res, msg = self.runOperation(['upgrade', 'bar'], [foo11, bar11], [foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.assert_(self._pkg2txmbr(foo12).reason == 'user')
++ self.assert_(self._pkg2txmbr(bar12).reason == 'dep')
++
++ self.tsInfo.makelists()
++ self.assertEquals([foo12], self.tsInfo.depupdated)
++
++ def testUpdateForDeps_install_foo6(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++
++ res, msg = self.runOperation(['install', 'foo'], [], [foo11, bar11, foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.assert_(self._pkg2txmbr(foo12).reason == 'user')
++ self.assert_(self._pkg2txmbr(bar12).reason == 'dep')
++
++ self.tsInfo.makelists()
++ self.assertEquals([bar12], self.tsInfo.depinstalled)
++
++ def testUpdateForDeps_install_bar7(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++
++ res, msg = self.runOperation(['install', 'bar'], [], [foo11, bar11, foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo12, bar12))
++
++ self.assert_(self._pkg2txmbr(foo12).reason == 'dep')
++ self.assert_(self._pkg2txmbr(bar12).reason == 'user')
++
++ self.tsInfo.makelists()
++ self.assertEquals([foo12], self.tsInfo.depinstalled)
++
++ def testUpdateForDeps_downgrade_all8(self):
++ foo11, foo12, bar11, bar12 = self._testUpdateForDeps_setup()
++ foo12.yumdb_info.reason = 'user'
++ bar12.yumdb_info.reason = 'blahg'
++
++ res, msg = self.runOperation(['downgrade', 'foo', 'bar'], [foo12, bar12], [foo11, bar11, foo12, bar12])
++
++ self.assert_(res=='ok', msg)
++ self.assertResult((foo11, bar11))
++
++ self.assert_(self._pkg2txmbr(foo11).reason == 'user')
++ self.assert_(self._pkg2txmbr(bar11).reason == 'blahg')
diff --git a/test/skipbroken-tests.py b/test/skipbroken-tests.py
index 812785a..68f5ef9 100644
--- a/test/skipbroken-tests.py
@@ -184156,7 +184306,7 @@ index 0000000..28e1964
+- Check if we're running as root; exit nicely.
diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
new file mode 100755
-index 0000000..bdfaa28
+index 0000000..735f496
--- /dev/null
+++ b/yum-cron/yum-cron.py
@@ -0,0 +1,1126 @@
@@ -184919,7 +185069,7 @@ index 0000000..bdfaa28
+ # list of the files that were read successfully, so check that it
+ # contains config_file
+ if config_file_name not in confparser.read(config_file_name):
-+ print >> sys.stderr, "Error reading config file"
++ print >> sys.stderr, "Error reading config file:", config_file_name
+ sys.exit(1)
+
+ # Populate the values into the opts object
@@ -192417,7 +192567,7 @@ index d09511f..cd3ef2e 100644
if name not in cfgOptions and option.default == value:
diff --git a/yum/depsolve.py b/yum/depsolve.py
-index 6d744c0..52b751b 100644
+index 6d744c0..4d16ef2 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -31,13 +31,15 @@ from transactioninfo import TransactionMember
@@ -192669,7 +192819,28 @@ index 6d744c0..52b751b 100644
if needmode in ['e']:
self.verbose_logger.log(logginglevels.DEBUG_2, _('TSINFO: %s package requiring %s marked as erase'),
-@@ -696,6 +798,13 @@ class Depsolve(object):
+@@ -589,7 +691,7 @@ class Depsolve(object):
+ # Always do compare providers for multiple pkgs, it deals with
+ # newest etc. ... so no need to do NewestNameArch() ... and it
+ # stops compare_providers from being clever.
+- pkgresults = self._compare_providers(pkgs, requiringPo)
++ pkgresults = self._compare_providers(pkgs, requiringPo,req=needname)
+ best = pkgresults[0][0]
+
+ if self.rpmdb.contains(po=best): # is it already installed?
+@@ -609,7 +711,10 @@ class Depsolve(object):
+ # FIXME: we should probably handle updating multiple packages...
+ txmbr = self.tsInfo.addUpdate(best, inst[0])
+ txmbr.setAsDep(po=requiringPo)
+- txmbr.reason = "dep"
++ if 'reason' in inst[0].yumdb_info:
++ txmbr.reason = inst[0].yumdb_info.reason
++ else:
++ txmbr.reason = 'dep'
+ checkdeps = True
+ self._last_req = best
+ else:
+@@ -696,6 +801,13 @@ class Depsolve(object):
self.tsInfo.remove(txmbr.pkgtup)
def prof_resolveDeps(self):
@@ -192683,7 +192854,7 @@ index 6d744c0..52b751b 100644
fn = "anaconda.prof.0"
import hotshot, hotshot.stats
prof = hotshot.Profile(fn)
-@@ -709,6 +818,13 @@ class Depsolve(object):
+@@ -709,6 +821,13 @@ class Depsolve(object):
return rc
def cprof_resolveDeps(self):
@@ -192697,7 +192868,7 @@ index 6d744c0..52b751b 100644
import cProfile, pstats
prof = cProfile.Profile()
rc = prof.runcall(self.resolveDeps)
-@@ -722,7 +838,17 @@ class Depsolve(object):
+@@ -722,7 +841,17 @@ class Depsolve(object):
return rc
def resolveDeps(self, full_check=True, skipping_broken=False):
@@ -192716,7 +192887,7 @@ index 6d744c0..52b751b 100644
if not len(self.tsInfo):
return (0, [_('Success - empty transaction')])
-@@ -778,6 +904,12 @@ class Depsolve(object):
+@@ -778,6 +907,12 @@ class Depsolve(object):
if checkdep:
break # The next conflict might be the same pkg
@@ -192729,7 +192900,7 @@ index 6d744c0..52b751b 100644
if CheckDeps:
if self.dsCallback: self.dsCallback.restartLoop()
self.verbose_logger.log(logginglevels.DEBUG_1, _('Restarting Loop'))
-@@ -920,9 +1052,12 @@ class Depsolve(object):
+@@ -920,9 +1055,12 @@ class Depsolve(object):
# if this is an update, we should check what the old
# requires were to make things faster
@@ -192744,16 +192915,16 @@ index 6d744c0..52b751b 100644
oldreqs = set(oldreqs)
ret = []
-@@ -948,7 +1083,7 @@ class Depsolve(object):
+@@ -948,7 +1086,7 @@ class Depsolve(object):
continue
for member in self.tsInfo.getMembersWithState(
pkgtup=po.pkgtup, output_states=TS_INSTALL_STATES):
- member.relatedto.append((txmbr.po, 'dependson'))
-+ member.setAsDep(txmbr.po)
++ member.setAsDep(txmbr.po, relonly=True)
return ret
-@@ -974,12 +1109,36 @@ class Depsolve(object):
+@@ -974,12 +1112,36 @@ class Depsolve(object):
# FIXME: This is probably the best place to fix the postfix rename
# problem long term (post .21) ... see compare_providers.
for pkg, hits in self.tsInfo.getRequires(*prov).iteritems():
@@ -192791,7 +192962,7 @@ index 6d744c0..52b751b 100644
# We don't undo anything else here ... hopefully that's
# fine.
self.tsInfo.remove(txmbr.pkgtup)
-@@ -1033,10 +1192,10 @@ class Depsolve(object):
+@@ -1033,10 +1195,10 @@ class Depsolve(object):
# get file requirements from new packages
for txmbr in self._tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES):
@@ -192804,7 +192975,7 @@ index 6d744c0..52b751b 100644
# check if file requires was already unresolved in update
if name in self.installedUnresolvedFileRequires:
already_broken = False
-@@ -1050,6 +1209,7 @@ class Depsolve(object):
+@@ -1050,6 +1212,7 @@ class Depsolve(object):
nfileRequires.add(name)
fileRequires.add(name)
reverselookup.setdefault(name, []).append(txmbr.po.pkgtup)
@@ -192812,7 +192983,7 @@ index 6d744c0..52b751b 100644
todel = []
for fname in self.installedFileProviders:
-@@ -1149,7 +1309,76 @@ class Depsolve(object):
+@@ -1149,7 +1312,76 @@ class Depsolve(object):
self.rpmdb.transactionCacheConflictPackages(cpkgs)
return ret
@@ -192889,7 +193060,7 @@ index 6d744c0..52b751b 100644
lst = self.tsInfo.matchNaevr(name = pkgname)
for txmbr in lst:
if txmbr.output_state in TS_INSTALL_STATES:
-@@ -1166,7 +1395,7 @@ class Depsolve(object):
+@@ -1166,7 +1398,7 @@ class Depsolve(object):
return True
_isPackageInstalled = isPackageInstalled
@@ -192898,7 +193069,7 @@ index 6d744c0..52b751b 100644
"""take the list of pkgs and score them based on the requesting package
return a dictionary of po=score"""
self.verbose_logger.log(logginglevels.DEBUG_4,
-@@ -1210,6 +1439,24 @@ class Depsolve(object):
+@@ -1210,6 +1442,24 @@ class Depsolve(object):
return None
return x
@@ -192923,7 +193094,7 @@ index 6d744c0..52b751b 100644
# Actual start of _compare_providers().
# Do a NameArch filtering, based on repo. __cmp__
-@@ -1332,6 +1579,26 @@ class Depsolve(object):
+@@ -1332,6 +1582,26 @@ class Depsolve(object):
_('common prefix of %s between %s and %s' % (cpl, po, reqpo)))
pkgresults[po] += cpl*2
@@ -192950,7 +193121,7 @@ index 6d744c0..52b751b 100644
# If we have more than one "best", see what would happen if we picked
# each package ... ie. what things do they require that _aren't_ already
-@@ -1393,42 +1660,52 @@ class Depsolve(object):
+@@ -1393,42 +1663,52 @@ class Depsolve(object):
class DepCheck(object):
@@ -193019,10 +193190,10 @@ index 6d744c0..52b751b 100644
self.conflict = conflict # what the conflict was between them
diff --git a/yum/drpm.py b/yum/drpm.py
new file mode 100644
-index 0000000..464f17c
+index 0000000..b5bdee3
--- /dev/null
+++ b/yum/drpm.py
-@@ -0,0 +1,324 @@
+@@ -0,0 +1,328 @@
+# Integrated delta rpm support
+# Copyright 2013 Zdenek Pavlas
+
@@ -193307,6 +193478,10 @@ index 0000000..464f17c
+ if hasattr(progress, 'text_meter_total_size'):
+ progress.text_meter_total_size(0)
+ self.progress = po.repo.callback
++ # default timescale 5s works fine with 0.3s dl updates.
++ # drpm rebuild jobs do not finish that often, so bump it
++ try: self.progress.re.timescale = 30
++ except: pass # accessing private api
+ self.progress.start(filename=None, url=None, # BZ 963023
+ text='<locally rebuilding deltarpms>', size=total)
+ self.done = 0
@@ -194352,10 +194527,10 @@ index 9889bf6..76a258d 100755
Setup the yum translation domain and make _() and P_() translation wrappers
diff --git a/yum/igroups.py b/yum/igroups.py
new file mode 100644
-index 0000000..cbb070f
+index 0000000..73fbc2b
--- /dev/null
+++ b/yum/igroups.py
-@@ -0,0 +1,285 @@
+@@ -0,0 +1,307 @@
+#! /usr/bin/python -tt
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
@@ -194379,6 +194554,28 @@ index 0000000..cbb070f
+import fnmatch
+import re
+
++def _open_no_umask(*args):
++ """ Annoying people like to set umask's for root, which screws everything
++ up for user readable stuff. """
++ oumask = os.umask(022)
++ try:
++ ret = open(*args)
++ finally:
++ os.umask(oumask)
++
++ return ret
++
++def _makedirs_no_umask(*args):
++ """ Annoying people like to set umask's for root, which screws everything
++ up for user readable stuff. """
++ oumask = os.umask(022)
++ try:
++ ret = os.makedirs(*args)
++ finally:
++ os.umask(oumask)
++
++ return ret
++
+class InstalledGroup(object):
+ def __init__(self, gid):
+ self.gid = gid
@@ -194505,7 +194702,7 @@ index 0000000..cbb070f
+ db_path = os.path.dirname(self.filename)
+ if not os.path.exists(db_path):
+ try:
-+ os.makedirs(db_path)
++ _makedirs_no_umask(db_path)
+ except (IOError, OSError), e:
+ # some sort of useful thing here? A warning?
+ return False
@@ -194519,7 +194716,7 @@ index 0000000..cbb070f
+ self.changed = False
+
+ def _write_pkg_grps(self):
-+ fo = open(self.filename + '.tmp', 'w')
++ fo = _open_no_umask(self.filename + '.tmp', 'w')
+
+ fo.write("1\n") # version
+ fo.write("%u\n" % len(self.groups))
@@ -194532,7 +194729,7 @@ index 0000000..cbb070f
+ os.rename(self.filename + '.tmp', self.filename)
+
+ def _write_grp_grps(self):
-+ fo = open(self.grp_filename + '.tmp', 'w')
++ fo = _open_no_umask(self.grp_filename + '.tmp', 'w')
+
+ fo.write("1\n") # version
+ fo.write("%u\n" % len(self.environments))
@@ -194642,7 +194839,7 @@ index 0000000..cbb070f
+
+ return returns.values()
diff --git a/yum/logginglevels.py b/yum/logginglevels.py
-index 14c5e73..8a811ae 100644
+index 14c5e73..f441eb9 100644
--- a/yum/logginglevels.py
+++ b/yum/logginglevels.py
@@ -42,7 +42,7 @@ logging.addLevelName(DEBUG_3, "DEBUG_3")
@@ -194659,12 +194856,21 @@ index 14c5e73..8a811ae 100644
def logLevelFromDebugLevel(debug_level):
""" Convert an old-style debug logging level to the new style. """
- debug_table = {-1 : __NO_LOGGING, 0 : logging.INFO, 1 : INFO_1, 2 : INFO_2,
-+ debug_table = {
++ debug_table = {-5 : __NO_LOGGING,
+ -4 : logging.CRITICAL, -3 : logging.ERROR, -2 : logging.WARNING,
+ -1 : __NO_LOGGING, 0 : logging.INFO, 1 : INFO_1, 2 : INFO_2,
3 : logging.DEBUG, 4 : DEBUG_1, 5 : DEBUG_2, 6 : DEBUG_3, 7 : DEBUG_4}
return __convertLevel(debug_level, debug_table)
+@@ -98,7 +100,7 @@ def __convertLevel(level, table):
+ try:
+ new_level = table[level]
+ except KeyError:
+- keys = table.keys()
++ keys = sorted(table.keys())
+ # We didn't find the level in the table, check if it's smaller
+ # than the smallest level
+ if level < keys[0]:
diff --git a/yum/metalink.py b/yum/metalink.py
index aaa4f25..a2c5135 100755
--- a/yum/metalink.py
@@ -197089,7 +197295,7 @@ index 4d7e36e..826ad62 100644
@param quotes: legal quoting characters
@type quotes: string
diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py
-index 4d89d83..57a6764 100644
+index 4d89d83..d34f3a8 100644
--- a/yum/transactioninfo.py
+++ b/yum/transactioninfo.py
@@ -34,6 +34,8 @@ import Errors
@@ -197209,16 +197415,7 @@ index 4d89d83..57a6764 100644
self.removed = []
self.installed = []
self.updated = []
-@@ -347,7 +379,7 @@ class TransactionData:
-
- for txmbr in self.getMembers():
- if txmbr.output_state == TS_UPDATE:
-- if txmbr.isDep:
-+ if txmbr.isDep and txmbr.reason != 'user':
- self.depupdated.append(txmbr)
- else:
- self.updated.append(txmbr)
-@@ -365,7 +397,11 @@ class TransactionData:
+@@ -365,7 +397,13 @@ class TransactionData:
for g in txmbr.groups:
if g not in self.instgroups:
self.instgroups.append(g)
@@ -197227,11 +197424,13 @@ index 4d89d83..57a6764 100644
+ for evg in txmbr.environments:
+ if evg not in self.instenvironments:
+ self.instenvironments.append(evg)
++ # "user" here is kind of a hack ... we really shouldn't have
++ # .isDep == True, but this probably doesn't hurt.
+ if txmbr.isDep and txmbr.reason != 'user':
self.depinstalled.append(txmbr)
else:
self.installed.append(txmbr)
-@@ -377,6 +413,9 @@ class TransactionData:
+@@ -377,6 +415,9 @@ class TransactionData:
for g in txmbr.groups:
if g not in self.instgroups:
self.removedgroups.append(g)
@@ -197241,7 +197440,7 @@ index 4d89d83..57a6764 100644
if txmbr.isDep:
self.depremoved.append(txmbr)
else:
-@@ -402,6 +441,8 @@ class TransactionData:
+@@ -402,6 +443,8 @@ class TransactionData:
self.depremoved.sort()
self.instgroups.sort()
self.removedgroups.sort()
@@ -197250,7 +197449,56 @@ index 4d89d83..57a6764 100644
self.reinstalled.sort()
self.downgraded.sort()
self.failed.sort()
-@@ -547,9 +588,10 @@ class TransactionData:
+@@ -418,7 +461,6 @@ class TransactionData:
+ txmbr.output_state = TS_INSTALL
+ txmbr.po.state = TS_INSTALL
+ txmbr.ts_state = 'u'
+- txmbr.reason = 'user'
+
+ if self.rpmdb.contains(po=txmbr.po):
+ txmbr.reinstall = True
+@@ -436,7 +478,6 @@ class TransactionData:
+ txmbr.output_state = TS_TRUEINSTALL
+ txmbr.po.state = TS_INSTALL
+ txmbr.ts_state = 'i'
+- txmbr.reason = 'user'
+
+ if self.rpmdb.contains(po=txmbr.po):
+ txmbr.reinstall = True
+@@ -489,6 +530,10 @@ class TransactionData:
+ if not atxmbr: # Fail?
+ self.remove(itxmbr.pkgtup)
+ return None
++
++ if 'reason' in oldpo.yumdb_info:
++ atxmbr.reason = oldpo.yumdb_info.reason
++
+ atxmbr.relatedto.append((oldpo, 'downgrades'))
+ atxmbr.downgrades.append(oldpo)
+
+@@ -505,6 +550,10 @@ class TransactionData:
+ txmbr.ts_state = 'ud'
+ txmbr.relatedto.append((updating_po, 'updatedby'))
+ txmbr.updated_by.append(updating_po)
++
++ if 'reason' in po.yumdb_info: # Propbably worthless, but...
++ txmbr.reason = po.yumdb_info.reason
++
+ self.add(txmbr)
+ return txmbr
+
+@@ -537,6 +586,10 @@ class TransactionData:
+ txmbr.ts_state = 'od'
+ txmbr.relatedto.append((obsoleting_po, 'obsoletedby'))
+ txmbr.obsoleted_by.append(obsoleting_po)
++
++ if 'reason' in po.yumdb_info: # Propbably worthless, but...
++ txmbr.reason = po.yumdb_info.reason
++
+ self.add(txmbr)
+ for otxmbr in self.getMembersWithState(obsoleting_po.pkgtup,
+ [TS_OBSOLETING]):
+@@ -547,9 +600,10 @@ class TransactionData:
return txmbr
@@ -197263,7 +197511,7 @@ index 4d89d83..57a6764 100644
def getNewProvides(self, name, flag=None, version=(None, None, None)):
"""return dict { packages -> list of matching provides }
-@@ -619,6 +661,12 @@ class TransactionData:
+@@ -619,6 +673,12 @@ class TransactionData:
""" Return a simple version for the future rpmdb. Works like
rpmdb.simpleVersion(main_only=True)[0], but for the state the rpmdb
will be in after the transaction. """
@@ -197276,7 +197524,7 @@ index 4d89d83..57a6764 100644
pkgs = self.rpmdb.returnPackages()
_reinstalled_pkgtups = {}
for txmbr in self.getMembersWithState(None, TS_INSTALL_STATES):
-@@ -658,6 +706,7 @@ class TransactionData:
+@@ -658,6 +718,7 @@ class TransactionData:
self.rpmdb.transactionCachePackageChecksums(pkg_checksum_tups)
@@ -197284,7 +197532,7 @@ index 4d89d83..57a6764 100644
return main
def findObsoletedByThisMember(self, txmbr):
-@@ -752,6 +801,8 @@ class TransactionMember:
+@@ -752,6 +813,8 @@ class TransactionMember:
self.downgraded_by = []
self.reinstall = False
self.groups = [] # groups it's in
@@ -197293,7 +197541,20 @@ index 4d89d83..57a6764 100644
self._poattr = ['pkgtup', 'repoid', 'name', 'arch', 'epoch', 'version',
'release']
-@@ -776,6 +827,24 @@ class TransactionMember:
+@@ -767,15 +830,34 @@ class TransactionMember:
+ po.yumdb_info.get('releasever')
+ po.yumdb_info.get('changed_by')
+
+- def setAsDep(self, po=None):
++ def setAsDep(self, po=None, relonly=False):
+ """sets the transaction member as a dependency and maps the dep into the
+ relationship list attribute"""
+-
+- self.isDep = 1
++
++ if not relonly:
++ self.isDep = 1
+ if po:
self.relatedto.append((po, 'dependson'))
self.depends_on.append(po)
@@ -197318,7 +197579,7 @@ index 4d89d83..57a6764 100644
def __cmp__(self, other):
return cmp(self.po, other.po)
-@@ -825,5 +894,9 @@ class TransactionMember:
+@@ -825,5 +907,9 @@ class TransactionMember:
if self.groups:
msg += " groups: %s\n" % ' '.join(self.groups)
@@ -199167,7 +199428,7 @@ index e5e9ece..970b628 100644
fo = None
diff --git a/yumcommands.py b/yumcommands.py
-index 4dcbea7..1341f23 100644
+index 4dcbea7..03fc58a 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -13,6 +13,7 @@
@@ -200039,7 +200300,7 @@ index 4dcbea7..1341f23 100644
remap = {'update' : 'upgrade',
'erase' : 'remove',
'mark-erase' : 'mark-remove',
-@@ -479,32 +950,76 @@ class GroupsCommand(YumCommand):
+@@ -479,32 +950,83 @@ class GroupsCommand(YumCommand):
return cmd, extcmds
def doCheck(self, base, basecmd, extcmds):
@@ -200103,8 +200364,15 @@ index 4dcbea7..1341f23 100644
+ if base.conf.group_command != 'objects':
+ pass
++ elif not os.path.exists(os.path.dirname(base.igroups.filename)):
++ base.logger.critical(_("There is no installed groups file."))
++ base.logger.critical(_("Maybe run: yum groups mark convert"))
++ elif not os.access(os.path.dirname(base.igroups.filename), os.R_OK):
++ base.logger.critical(_("You don't have access to the groups DBs."))
++ raise cli.CliError
+ elif not os.path.exists(base.igroups.filename):
+ base.logger.critical(_("There is no installed groups file."))
++ base.logger.critical(_("Maybe run: yum groups mark convert"))
+ elif not os.access(base.igroups.filename, os.R_OK):
+ base.logger.critical(_("You don't have access to the groups DB."))
+ raise cli.CliError
@@ -200126,7 +200394,7 @@ index 4dcbea7..1341f23 100644
cmd, extcmds = self._grp_cmd(basecmd, extcmds)
self._grp_setup_doCommand(base)
-@@ -514,136 +1029,546 @@ class GroupsCommand(YumCommand):
+@@ -514,136 +1036,546 @@ class GroupsCommand(YumCommand):
if cmd == 'list':
return base.returnGroupLists(extcmds)
@@ -200555,7 +200823,6 @@ index 4dcbea7..1341f23 100644
-class ProvidesCommand(YumCommand):
- def getNames(self):
-- return ['provides', 'whatprovides']
+ def cacheRequirement(self, base, basecmd, extcmds):
+ """Return the cache requirements for the remote repos.
+
@@ -200578,7 +200845,7 @@ index 4dcbea7..1341f23 100644
+
+ :return: a list containing the names of this command
+ """
-+ return ['provides', 'whatprovides']
+ return ['provides', 'whatprovides']
def getUsage(self):
+ """Return a usage string for this command.
@@ -200697,7 +200964,7 @@ index 4dcbea7..1341f23 100644
ypl = base.returnPkgLists(extcmds)
if (base.conf.obsoletes or
base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)):
-@@ -675,162 +1600,471 @@ class CheckUpdateCommand(YumCommand):
+@@ -675,162 +1607,471 @@ class CheckUpdateCommand(YumCommand):
base.updatesObsoletesList(obtup, 'obsoletes',
columns=columns)
result = 100
@@ -201199,7 +201466,7 @@ index 4dcbea7..1341f23 100644
def _repo_size(repo):
ret = 0
for pkg in repo.sack.returnPackages():
-@@ -838,12 +2072,9 @@ class RepoListCommand(YumCommand):
+@@ -838,12 +2079,9 @@ class RepoListCommand(YumCommand):
return base.format_number(ret)
def _repo_match(repo, patterns):
@@ -201214,7 +201481,7 @@ index 4dcbea7..1341f23 100644
return True
return False
-@@ -857,7 +2088,10 @@ class RepoListCommand(YumCommand):
+@@ -857,7 +2095,10 @@ class RepoListCommand(YumCommand):
arg = 'enabled'
extcmds = map(lambda x: x.lower(), extcmds)
@@ -201226,7 +201493,7 @@ index 4dcbea7..1341f23 100644
if arg != 'disabled' or extcmds:
try:
# Setup so len(repo.sack) is correct
-@@ -866,6 +2100,13 @@ class RepoListCommand(YumCommand):
+@@ -866,6 +2107,13 @@ class RepoListCommand(YumCommand):
except yum.Errors.RepoError:
if verbose:
raise
@@ -201240,7 +201507,7 @@ index 4dcbea7..1341f23 100644
repos = base.repos.repos.values()
repos.sort()
-@@ -924,111 +2165,108 @@ class RepoListCommand(YumCommand):
+@@ -924,111 +2172,108 @@ class RepoListCommand(YumCommand):
ui_enabled = dhibeg + _('disabled') + hiend
ui_endis_wid = utf8_width(_('disabled'))
@@ -201445,7 +201712,7 @@ index 4dcbea7..1341f23 100644
if not verbose and cols:
# Work out the first (id) and last (enabled/disalbed/count),
-@@ -1088,21 +2326,64 @@ class RepoListCommand(YumCommand):
+@@ -1088,21 +2333,64 @@ class RepoListCommand(YumCommand):
return 0, ['repolist: ' +to_unicode(locale.format("%d", tot_num, True))]
def needTs(self, base, basecmd, extcmds):
@@ -201510,7 +201777,7 @@ index 4dcbea7..1341f23 100644
if len(extcmds) == 0:
base.usage()
raise cli.CliError
-@@ -1147,82 +2428,230 @@ class HelpCommand(YumCommand):
+@@ -1147,82 +2435,230 @@ class HelpCommand(YumCommand):
return help_output
def doCommand(self, base, basecmd, extcmds):
@@ -201716,12 +201983,11 @@ index 4dcbea7..1341f23 100644
return "[all|installed|available]"
def getSummary(self):
-- return _("Display a version for the machine and/or available repos.")
+ """Return a one line summary of this command.
+
+ :return: a one line summary of this command
+ """
-+ return _("Display a version for the machine and/or available repos.")
+ return _("Display a version for the machine and/or available repos.")
def doCommand(self, base, basecmd, extcmds):
+ """Execute this command.
@@ -201751,7 +202017,7 @@ index 4dcbea7..1341f23 100644
def _append_repos(cols, repo_data):
for repoid in sorted(repo_data):
-@@ -1264,7 +2693,7 @@ class VersionCommand(YumCommand):
+@@ -1264,7 +2700,7 @@ class VersionCommand(YumCommand):
if vcmd == 'groupinfo':
for group in groups:
@@ -201760,7 +202026,7 @@ index 4dcbea7..1341f23 100644
continue
print _(" Group :"), group
print _(" Packages:")
-@@ -1284,11 +2713,35 @@ class VersionCommand(YumCommand):
+@@ -1284,11 +2720,35 @@ class VersionCommand(YumCommand):
return 0, ['version groupinfo']
@@ -201797,7 +202063,7 @@ index 4dcbea7..1341f23 100644
data = base.rpmdb.simpleVersion(not verbose, groups=groups)
lastdbv = base.history.last()
if lastdbv is not None:
-@@ -1302,15 +2755,14 @@ class VersionCommand(YumCommand):
+@@ -1302,15 +2762,14 @@ class VersionCommand(YumCommand):
if groups:
for grp in sorted(data[2]):
if (vcmd.startswith("group-") and
@@ -201816,7 +202082,7 @@ index 4dcbea7..1341f23 100644
data = base.pkgSack.simpleVersion(not verbose, groups=groups)
if vcmd not in ('group-available', 'group-all'):
cols.append(("%s %s/%s" % (_("Available:"), rel, ba),
-@@ -1320,14 +2772,12 @@ class VersionCommand(YumCommand):
+@@ -1320,14 +2779,12 @@ class VersionCommand(YumCommand):
if groups:
for grp in sorted(data[2]):
if (vcmd.startswith("group-") and
@@ -201832,7 +202098,7 @@ index 4dcbea7..1341f23 100644
data = {'rid' : {}, 'ver' : {}}
for (rid, ver) in cols:
-@@ -1344,6 +2794,14 @@ class VersionCommand(YumCommand):
+@@ -1344,6 +2801,14 @@ class VersionCommand(YumCommand):
return 0, ['version']
def needTs(self, base, basecmd, extcmds):
@@ -201847,7 +202113,7 @@ index 4dcbea7..1341f23 100644
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
-@@ -1352,25 +2810,74 @@ class VersionCommand(YumCommand):
+@@ -1352,25 +2817,74 @@ class VersionCommand(YumCommand):
return True
return vcmd in ('available', 'all', 'group-available', 'group-all')
@@ -201923,7 +202189,7 @@ index 4dcbea7..1341f23 100644
return 2, ["Repeating transaction %u" % (old.tid,)]
def _hcmd_undo(self, base, extcmds):
-@@ -1426,12 +2933,57 @@ class HistoryCommand(YumCommand):
+@@ -1426,12 +2940,57 @@ class HistoryCommand(YumCommand):
def _hcmd_new(self, base, extcmds):
base.history._create_db_file()
@@ -201982,7 +202248,7 @@ index 4dcbea7..1341f23 100644
if extcmds and extcmds[0] not in cmds:
base.logger.critical(_('Invalid history sub-command, use: %s.'),
", ".join(cmds))
-@@ -1444,6 +2996,19 @@ class HistoryCommand(YumCommand):
+@@ -1444,6 +3003,19 @@ class HistoryCommand(YumCommand):
raise cli.CliError
def doCommand(self, base, basecmd, extcmds):
@@ -202002,7 +202268,7 @@ index 4dcbea7..1341f23 100644
vcmd = 'list'
if extcmds:
vcmd = extcmds[0]
-@@ -1468,29 +3033,88 @@ class HistoryCommand(YumCommand):
+@@ -1468,29 +3040,88 @@ class HistoryCommand(YumCommand):
ret = self._hcmd_rollback(base, extcmds)
elif vcmd == 'new':
ret = self._hcmd_new(base, extcmds)
@@ -202091,7 +202357,7 @@ index 4dcbea7..1341f23 100644
chkcmd = 'all'
if extcmds:
chkcmd = extcmds
-@@ -1505,33 +3129,1113 @@ class CheckRpmdbCommand(YumCommand):
+@@ -1505,33 +3136,1113 @@ class CheckRpmdbCommand(YumCommand):
return rc, ['%s %s' % (basecmd, chkcmd)]
def needTs(self, base, basecmd, extcmds):
@@ -202285,8 +202551,8 @@ index 4dcbea7..1341f23 100644
+ if not extcmds or os.path.isdir(extcmds[0]):
+ return False
+
- return True
-
++ return True
++
+ def cacheRequirement(self, base, basecmd, extcmds):
+ """Return the cache requirements for the remote repos.
+
@@ -202674,8 +202940,8 @@ index 4dcbea7..1341f23 100644
+ if cmd in ('info', 'list'):
+ return InfoCommand().cacheRequirement(base, cmd, extcmds[2:])
+
-+ return True
-+
+ return True
+
+ def cacheRequirement(self, base, basecmd, extcmds):
+ """Return the cache requirements for the remote repos.
+
diff --git a/yum.spec b/yum.spec
index 709da01..5aaf5cc 100644
--- a/yum.spec
+++ b/yum.spec
@@ -41,7 +41,7 @@ BuildRequires: bash-completion
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 106%{?dist}
+Release: 107%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -403,6 +403,16 @@ exit 0
%endif
%changelog
+* Sun Aug 25 2013 James Antill <james at fedoraproject.org> - 3.4.3-107
+- Update to latest HEAD.
+- Pass requirement to compare_proviers so we can use provides version compare.
+- Show conf. file in yum-cron error message.
+- Add mark convert messages.
+- Fix logging level regression, -d9 works again.
+- Override users umask for groups files, so users can read it. BZ 982361.
+- Fix downgrade keeping .reason, note that remove+install doesn't. BZ 961938.
+- Inherit reason from install package into txmbr. BZ BZ 961938.
+
* Tue Aug 13 2013 Zdenek Pavlas <zpavlas at redhat.com> - 3.4.3-106
- Update to latest HEAD.
- deltarpm: _wait(block=True) should not wait for all running jobs. BZ 991694
More information about the scm-commits
mailing list