diff --git a/.gitignore b/.gitignore deleted file mode 100644 index eeb7f9c..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -yum-3.2.26.tar.gz diff --git a/0001-check-reqpo-exists-in-compare_providers.patch b/0001-check-reqpo-exists-in-compare_providers.patch deleted file mode 100644 index 3ca0c39..0000000 --- a/0001-check-reqpo-exists-in-compare_providers.patch +++ /dev/null @@ -1,47 +0,0 @@ -commit 63540521709205dd601994e2b05b7ddd3712b3a1 -Author: Seth Vidal -Date: Thu Jul 10 12:21:29 2008 -0400 - - make sure the reqpo exists before we compare it - -diff --git a/yum/depsolve.py b/yum/depsolve.py -index 8bb2cf1..2577cef 100644 ---- a/yum/depsolve.py -+++ b/yum/depsolve.py -@@ -986,8 +986,13 @@ class Depsolve(object): - if obsoleted: - pkgresults[po] -= 1024 - break -- -- for thisarch in (reqpo.arch, getBestArch()): -+ -+ if reqpo: -+ arches = (reqpo.arch, getBestArch()) -+ else: -+ arches = (getBestArch()) -+ -+ for thisarch in arches: - res = _compare_arch_distance(po, nextpo, thisarch) - if not res: - continue -@@ -1001,13 +1006,13 @@ class Depsolve(object): - self.verbose_logger.log(logginglevels.DEBUG_4, - _('common sourcerpm %s and %s' % (po, reqpo))) - pkgresults[po] += 20 -- -- cpl = _common_prefix_len(po.name, reqpo.name) -- if cpl > 2: -- self.verbose_logger.log(logginglevels.DEBUG_4, -- _('common prefix of %s between %s and %s' % (cpl, po, reqpo))) -- -- pkgresults[po] += cpl*2 -+ if reqpo: -+ cpl = _common_prefix_len(po.name, reqpo.name) -+ if cpl > 2: -+ self.verbose_logger.log(logginglevels.DEBUG_4, -+ _('common prefix of %s between %s and %s' % (cpl, po, reqpo))) -+ -+ pkgresults[po] += cpl*2 - - pkgresults[po] += (len(po.name)*-1) - diff --git a/0001-gotta-check-both-not-either-otherwise-filedeps-do.patch b/0001-gotta-check-both-not-either-otherwise-filedeps-do.patch deleted file mode 100644 index 2853e48..0000000 --- a/0001-gotta-check-both-not-either-otherwise-filedeps-do.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7a99a04d7f121a547d9af82738cd64b2fa8b04ca Mon Sep 17 00:00:00 2001 -From: Seth Vidal -Date: Sat, 17 May 2008 07:43:42 -0400 -Subject: [PATCH] gotta check both, not either - otherwise filedeps don't work :( - ---- - yum/sqlitesack.py | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py -index c9fc26c..0b5d3e1 100644 ---- a/yum/sqlitesack.py -+++ b/yum/sqlitesack.py -@@ -766,7 +766,7 @@ class YumSqlitePackageSack(yumRepo.YumPackageSack): - # If it's not a provides or a filename, we are done - if prcotype != "provides": - return results -- if not glob or name[0] != '/': -+ if not glob and name[0] != '/': - return results - - # If it is a filename, search the primary.xml file info --- -1.5.5.1 - diff --git a/chroot-without-dupe-path.patch b/chroot-without-dupe-path.patch deleted file mode 100644 index 5015ef5..0000000 --- a/chroot-without-dupe-path.patch +++ /dev/null @@ -1,60 +0,0 @@ -commit f48b1d9f0ede0eae518f5b353ed9dda74dde6d7c -Author: Seth Vidal -Date: Fri Apr 30 12:16:54 2010 -0400 - - make sure we're not prepending a path which is already been prepended - with the installroot - fixes rh bugs: - https://bugzilla.redhat.com/show_bug.cgi?id=577627 - and - https://bugzilla.redhat.com/show_bug.cgi?id=560078 - -diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index 83268cc..6a40939 100644 ---- a/yum/rpmsack.py -+++ b/yum/rpmsack.py -@@ -171,7 +171,10 @@ class RPMDBPackageSack(PackageSackBase): - if cachedir is None: - cachedir = misc.getCacheDir() - self.setCacheDir(cachedir) -- self._persistdir = root + '/' + persistdir -+ if not os.path.normpath(persistdir).startswith(self.root): -+ self._persistdir = root + '/' + persistdir -+ else: -+ self._persistdir = persistdir - self._have_cached_rpmdbv_data = None - self._cached_conflicts_data = None - # Store the result of what happens, if a transaction completes. -@@ -231,7 +234,10 @@ class RPMDBPackageSack(PackageSackBase): - def setCacheDir(self, cachedir): - """ Sets the internal cachedir value for the rpmdb, to be the - "installed" directory from this parent. """ -- self._cachedir = self.root + '/' + cachedir + "/installed/" -+ if not os.path.normpath(cachedir).startswith(self.root): -+ self._cachedir = self.root + '/' + cachedir + "/installed/" -+ else: -+ self._cachedir = '/' + cachedir + "/installed/" - - def readOnlyTS(self): - if not self.ts: - -commit 9714379777bfa6569a46ef8d2cc1131b951eebf7 -Author: Seth Vidal -Date: Fri Apr 30 12:28:10 2010 -0400 - - and do the same for the history db with an --installroot - ---- a/yum/history.py~ 2010-02-10 11:40:37.000000000 -0500 -+++ b/yum/history.py 2010-05-03 11:38:09.000000000 -0400 -@@ -176,7 +176,10 @@ - self._conn = None - - self.conf = yum.misc.GenericHolder() -- self.conf.db_path = os.path.normpath(root + '/' + db_path) -+ if not os.path.normpath(db_path).startswith(root): -+ self.conf.db_path = os.path.normpath(root + '/' + db_path) -+ else: -+ self.conf.db_path = os.path.normpath('/' + db_path) - self.conf.writable = False - - if not os.path.exists(self.conf.db_path): diff --git a/dead.package b/dead.package new file mode 100644 index 0000000..85a5025 --- /dev/null +++ b/dead.package @@ -0,0 +1 @@ +Superseded by DNF. For details, see: https://fedoraproject.org/wiki/Changes/Retire_YUM_3 diff --git a/fix-kernel-updates.patch b/fix-kernel-updates.patch deleted file mode 100644 index 7338052..0000000 --- a/fix-kernel-updates.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit 50b01cf6329d00e09a8586527afd9b72466df506 -Author: Seth Vidal -Date: Wed Feb 10 21:50:23 2010 -0500 - - fix typo which makes all kernel updates die :( - -diff --git a/yum/__init__.py b/yum/__init__.py -index d0bd4cc..df952a8 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -4101,7 +4101,7 @@ class YumBase(depsolve.Depsolve): - numleft -= 1 - - for po,rel in toremove: -- txmbr = self.tsInfo.addErase(toremove) -+ txmbr = self.tsInfo.addErase(po) - # Add a dep relation to the new version of the package, causing this one to be erased - # this way skipbroken, should clean out the old one, if the new one is skipped - txmbr.depends_on.append(rel) diff --git a/geode-arch.patch b/geode-arch.patch deleted file mode 100644 index 3e333c0..0000000 --- a/geode-arch.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/rpmUtils/arch.py b/rpmUtils/arch.py -index b493b6a..27c6d53 100644 ---- a/rpmUtils/arch.py -+++ b/rpmUtils/arch.py -@@ -15,7 +15,7 @@ arches = { - # ia32 - "athlon": "i686", - "i686": "i586", -- "geode": "i586", -+ "geode": "i686", - "i586": "i486", - "i486": "i386", - "i386": "noarch", --- -1.6.2.5 - diff --git a/installonlyn-enable.patch b/installonlyn-enable.patch deleted file mode 100644 index b42be9a..0000000 --- a/installonlyn-enable.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- yum/config.py~ 2008-02-08 16:22:27.000000000 -0500 -+++ yum/config.py 2008-02-08 16:22:28.000000000 -0500 -@@ -593,7 +593,7 @@ - # NOTE: If you set this to 2, then because it keeps the current kernel it - # means if you ever install an "old" kernel it'll get rid of the newest one - # so you probably want to use 3 as a minimum ... if you turn it on. -- installonly_limit = PositiveIntOption(0, range_min=2, -+ installonly_limit = PositiveIntOption(3, range_min=2, - names_of_0=["0", ""]) - kernelpkgnames = ListOption(['kernel','kernel-smp', 'kernel-enterprise', - 'kernel-bigmem', 'kernel-BOOT', 'kernel-PAE', 'kernel-PAE-debug']) - ---- docs/yum.conf.5~ 2009-05-11 11:55:25.000000000 -0400 -+++ docs/yum.conf.5 2009-05-11 11:55:25.000000000 -0400 -@@ -108,7 +108,7 @@ - - .IP \fBinstallonly_limit \fR - Number of packages listed in installonlypkgs to keep installed at the same --time. Setting to 0 disables this feature. Default is '0'. Note that this -+time. Setting to 0 disables this feature. Default is '3'. Note that this - functionality used to be in the "installonlyn" plugin, where this option was - altered via. tokeep. - diff --git a/installonlyn.py b/installonlyn.py deleted file mode 100644 index 8646b3a..0000000 --- a/installonlyn.py +++ /dev/null @@ -1,69 +0,0 @@ -# A plugin for yum which only leaves n 'kernel' packages installed instead -# of infinitely doing installonly -# -# Copyright 2005 Red Hat, Inc. -# Jeremy Katz -# -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# version 0.93 - -import os -from rpmUtils import miscutils -from yum.plugins import TYPE_CORE -from yum.packages import YumInstalledPackage, comparePoEVR - -requires_api_version = '2.4' -plugin_type = TYPE_CORE - -def get_running_kernel_version_release(): - """This takes the output of uname and figures out the (version, release) - tuple for the running kernel.""" - ver = os.uname()[2] - for s in ("bigmem", "enterprise", "smp", "hugemem", "PAE", "rt", - "guest", "hypervisor", "xen0", "xenU", "xen", "debug"): - if ver.endswith(s): - ver = ver.replace(s, "") - if ver.find("-") != -1: - (v, r) = ver.split("-", 1) - return (v, r) - return (None, None) - -def config_hook(conduit): - global num_tokeep - num_tokeep = conduit.confInt('main', 'tokeep', default=2) - -def postresolve_hook(conduit): - ts = conduit.getTsInfo() - rpmdb = conduit.getRpmDB() - conf = conduit.getConf() - mems = ts.getMembers() - toremove = [] - for instpkg in conf.installonlypkgs: - for m in mems: - if (m.name == instpkg or instpkg in m.po.provides_names) \ - and m.ts_state in ('i', 'u'): - installed = rpmdb.searchNevra(name=m.name) - if len(installed) >= num_tokeep - 1: # since we're adding one - numleft = len(installed) - num_tokeep + 1 - (curv, curr) = get_running_kernel_version_release() - - installed.sort(comparePoEVR) - for po in installed: - if (po.version, po.release) == (curv, curr): - # don't remove running - continue - if numleft == 0: - break - toremove.append(po) - numleft -= 1 - - map(lambda x: ts.addErase(x), toremove) diff --git a/no-more-exactarchlist.patch b/no-more-exactarchlist.patch deleted file mode 100644 index 23572c6..0000000 --- a/no-more-exactarchlist.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- yum/config.py~ 2009-07-22 12:47:52.000000000 -0400 -+++ yum/config.py 2009-07-22 12:48:39.000000000 -0400 -@@ -631,9 +631,7 @@ - names_of_0=["0", ""]) - kernelpkgnames = ListOption(['kernel','kernel-smp', 'kernel-enterprise', - 'kernel-bigmem', 'kernel-BOOT', 'kernel-PAE', 'kernel-PAE-debug']) -- exactarchlist = ListOption(['kernel', 'kernel-smp', -- 'kernel-hugemem', 'kernel-enterprise', 'kernel-bigmem', -- 'kernel-devel', 'kernel-PAE', 'kernel-PAE-debug']) -+ exactarchlist = ListOption([]) - tsflags = ListOption() - - assumeyes = BoolOption(False) diff --git a/plugin.conf b/plugin.conf deleted file mode 100644 index 8e4d76c..0000000 --- a/plugin.conf +++ /dev/null @@ -1,2 +0,0 @@ -[main] -enabled=1 diff --git a/reget-metadata-size-fix.patch b/reget-metadata-size-fix.patch deleted file mode 100644 index 2430310..0000000 --- a/reget-metadata-size-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -commit 2a9161a8b4bfc121fa8245700df355c63b58b442 -Author: James Antill -Date: Wed Mar 31 00:12:09 2010 -0400 - - Should work around the reget MD problems - -diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index 8d7617e..b67b897 100644 ---- a/yum/yumRepo.py -+++ b/yum/yumRepo.py -@@ -1552,9 +1552,17 @@ class YumRepository(Repository, config.RepoConf): - try: - checkfunc = (self.checkMD, (mdtype,), {}) - text = "%s/%s" % (self.id, mdtype) -+ if thisdata.size is None: -+ reget = None -+ else: -+ reget = 'simple' -+ if os.path.exists(local): -+ if os.stat(local).st_size >= int(thisdata.size): -+ misc.unlink_f(local) - local = self._getFile(relative=remote, - local=local, - copy_local=1, -+ reget=reget, - checkfunc=checkfunc, - text=text, - cache=self.http_caching == 'all', diff --git a/revert-yum-dot-import.patch b/revert-yum-dot-import.patch deleted file mode 100644 index 37bab84..0000000 --- a/revert-yum-dot-import.patch +++ /dev/null @@ -1,159 +0,0 @@ -diff --git a/yum/__init__.py b/yum/__init__.py -index 6e06005..a5b4922 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -32,9 +32,9 @@ import logging.config - import operator - import gzip - --import i18n --_ = i18n._ --P_ = i18n.P_ -+import yum.i18n -+_ = yum.i18n._ -+P_ = yum.i18n.P_ - - import config - from config import ParsingError, ConfigParser -@@ -57,15 +57,15 @@ import plugins - import logginglevels - import yumRepo - import callbacks --import history -+import yum.history - - import warnings - warnings.simplefilter("ignore", Errors.YumFutureDeprecationWarning) - - from packages import parsePackages, YumAvailablePackage, YumLocalPackage, YumInstalledPackage, comparePoEVR - from constants import * --from rpmtrans import RPMTransaction,SimpleCliCallBack --from i18n import to_unicode, to_str -+from yum.rpmtrans import RPMTransaction,SimpleCliCallBack -+from yum.i18n import to_unicode, to_str - - import string - -diff --git a/yum/comps.py b/yum/comps.py -index d310b1b..2048c77 100755 ---- a/yum/comps.py -+++ b/yum/comps.py -@@ -26,7 +26,7 @@ from Errors import CompsException - # switch all compsexceptions to grouperrors after api break - import fnmatch - import re --from i18n import to_unicode -+from yum.i18n import to_unicode - from misc import get_my_lang_code - - lang_attr = '{http://www.w3.org/XML/1998/namespace}lang' -diff --git a/yum/history.py b/yum/history.py -index 18d2a41..644c2fc 100644 ---- a/yum/history.py -+++ b/yum/history.py -@@ -23,10 +23,11 @@ import glob - from weakref import proxy as weakref - - from sqlutils import sqlite, executeSQL --import misc --from constants import * --from packages import YumInstalledPackage, YumAvailablePackage, PackageObject --from i18n import to_unicode -+import yum.misc -+import yum.constants -+from yum.constants import * -+from yum.packages import YumInstalledPackage, YumAvailablePackage, PackageObject -+from yum.i18n import to_unicode - - _history_dir = '/var/lib/yum/history' - -diff --git a/yum/plugins.py b/yum/plugins.py -index c0e510f..02f0d57 100644 ---- a/yum/plugins.py -+++ b/yum/plugins.py -@@ -34,7 +34,7 @@ from weakref import proxy as weakref - - from yum import _ - --from i18n import utf8_width -+from yum.i18n import utf8_width - - # TODO: expose rpm package sack objects to plugins (once finished) - # TODO: allow plugins to use the existing config stuff to define options for -diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index 74dd69d..fd05f9b 100644 ---- a/yum/rpmsack.py -+++ b/yum/rpmsack.py -@@ -31,7 +31,7 @@ from packageSack import PackageSackBase, PackageSackVersion - import fnmatch - import re - --from i18n import to_unicode -+from yum.i18n import to_unicode - import constants - - class RPMInstalledPackage(YumInstalledPackage): -diff --git a/yum/rpmtrans.py b/yum/rpmtrans.py -index ed52df0..b1b896f 100644 ---- a/yum/rpmtrans.py -+++ b/yum/rpmtrans.py -@@ -23,7 +23,7 @@ import time - import logging - import types - import sys --from constants import * -+from yum.constants import * - from yum import _ - import misc - -diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py -index 89744ff..ce2988f 100644 ---- a/yum/sqlitesack.py -+++ b/yum/sqlitesack.py -@@ -33,8 +33,8 @@ import rpmUtils.miscutils - import sqlutils - import constants - import operator --from misc import seq_max_split --from i18n import to_utf8, to_unicode -+from yum.misc import seq_max_split -+from yum.i18n import to_utf8, to_unicode - import sys - import re - -diff --git a/yum/update_md.py b/yum/update_md.py -index 34179ea..b3a120e 100644 ---- a/yum/update_md.py -+++ b/yum/update_md.py -@@ -24,10 +24,10 @@ Update metadata (updateinfo.xml) parsing. - import sys - import gzip - --from i18n import utf8_text_wrap, to_utf8 --from yumRepo import YumRepository --from packages import FakeRepository --from misc import to_xml -+from yum.i18n import utf8_text_wrap, to_utf8 -+from yum.yumRepo import YumRepository -+from yum.packages import FakeRepository -+from yum.misc import to_xml - import Errors - - import rpmUtils.miscutils -diff --git a/yum/yumRepo.py b/yum/yumRepo.py -index 2bc7476..ea8518a 100644 ---- a/yum/yumRepo.py -+++ b/yum/yumRepo.py -@@ -32,9 +32,9 @@ from repos import Repository - import parser - import sqlitecachec - import sqlitesack --import config --import misc --import comps -+from yum import config -+from yum import misc -+from yum import comps - from constants import * - import metalink - diff --git a/rpmdb-cache-BIG-post-releasever.path b/rpmdb-cache-BIG-post-releasever.path deleted file mode 100644 index 6b6f95b..0000000 --- a/rpmdb-cache-BIG-post-releasever.path +++ /dev/null @@ -1,1041 +0,0 @@ -diff --git a/cli.py b/cli.py -index 8f50541..f93a706 100644 ---- a/cli.py -+++ b/cli.py -@@ -894,10 +894,12 @@ class YumBaseCli(yum.YumBase, output.YumOutput): - hdrcode, hdrresults = self.cleanHeaders() - xmlcode, xmlresults = self.cleanMetadata() - dbcode, dbresults = self.cleanSqlite() -+ rpmcode, rpmresults = self.cleanRpmDB() - self.plugins.run('clean') - -- code = hdrcode + pkgcode + xmlcode + dbcode -- results = hdrresults + pkgresults + xmlresults + dbresults -+ code = hdrcode + pkgcode + xmlcode + dbcode + rpmdb -+ results = (hdrresults + pkgresults + xmlresults + dbresults + -+ rpmresults) - for msg in results: - self.logger.debug(msg) - return code, [] -@@ -917,6 +919,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput): - if 'expire-cache' in userlist or 'metadata' in userlist: - self.logger.debug(_('Cleaning up expire-cache metadata')) - expccode, expcresults = self.cleanExpireCache() -+ if 'rpmdb' in userlist: -+ self.logger.debug(_('Cleaning up cached rpmdb data')) -+ expccode, expcresults = self.cleanRpmDB() - if 'plugins' in userlist: - self.logger.debug(_('Cleaning up plugins')) - self.plugins.run('clean') -diff --git a/docs/yum.8 b/docs/yum.8 -index 4158453..9472a82 100644 ---- a/docs/yum.8 -+++ b/docs/yum.8 -@@ -35,7 +35,7 @@ gnome\-packagekit application\&. - .br - .I \fR * provides | whatprovides feature1 [feature2] [\&.\&.\&.] - .br --.I \fR * clean [ packages | headers | metadata | dbcache | all ] -+.I \fR * clean [ packages | metadata | expire-cache | rpmdb | plugins | all ] - .br - .I \fR * makecache - .br -@@ -424,7 +424,8 @@ Eliminate the local data saying when the metadata and mirrorlists were downloade - Eliminate any cached packages from the system. Note that packages are not automatically deleted after they are downloaded. - - .IP "\fByum clean headers\fP" --Eliminate all of the header files which yum uses for dependency resolution. -+Eliminate all of the header files, which old versions of yum used for -+dependency resolution. - - .IP "\fByum clean metadata\fP" - Eliminate all of the files which yum uses to determine the remote -@@ -433,11 +434,22 @@ metadata the next time it is run. - - .IP "\fByum clean dbcache\fP" - Eliminate the sqlite cache used for faster access to metadata. --Using this option will force yum to recreate the cache the next time --it is run. -+Using this option will force yum to download the sqlite metadata the next time -+it is run, or recreate the sqlite metadata if using an older repo. -+ -+.IP "\fByum clean dbcache\fP" -+Eliminate the sqlite cache used for faster access to metadata. -+Using this option will force yum to download the sqlite metadata the next time -+it is run, or recreate the sqlite metadata if using an older repo. -+ -+.IP "\fByum clean rpmdb\fP" -+Eliminate any cached data from the local rpmdb. -+ -+.IP "\fByum clean plugins\fP" -+Tell any enabled plugins to eliminate their cached data. - - .IP "\fByum clean all\fP" --Runs \fByum clean packages\fP and \fByum clean headers\fP, \fByum clean metadata\fP and \fByum clean dbcache\fP as above. -+Does all of the above. - - .PP - .SH "MISC" -diff --git a/test/rpmdb-cache.py b/test/rpmdb-cache.py -new file mode 100755 -index 0000000..7768a93 ---- /dev/null -+++ b/test/rpmdb-cache.py -@@ -0,0 +1,87 @@ -+#! /usr/bin/python -tt -+ -+import sys -+import yum -+ -+__provides_of_requires_exact__ = False -+ -+yb1 = yum.YumBase() -+yb1.conf.cache = True -+yb2 = yum.YumBase() -+yb2.conf.cache = True -+ -+if len(sys.argv) > 1 and sys.argv[1].lower() == 'full': -+ print "Doing full test" -+ __provides_of_requires_exact__ = True -+ -+assert hasattr(yb1.rpmdb, '__cache_rpmdb__') -+yb1.rpmdb.__cache_rpmdb__ = False -+yb2.setCacheDir() -+ -+# Version -+ver1 = yb1.rpmdb.simpleVersion(main_only=True)[0] -+ver2 = yb2.rpmdb.simpleVersion(main_only=True)[0] -+if ver1 != ver2: -+ print >>sys.stderr, "Error: Version mismatch:", ver1, ver2 -+ -+# Conflicts -+cpkgs1 = yb1.rpmdb.returnConflictPackages() -+cpkgs2 = yb2.rpmdb.returnConflictPackages() -+if len(cpkgs1) != len(cpkgs2): -+ print >>sys.stderr, "Error: Conflict len mismatch:", len(cpkgs1),len(cpkgs2) -+for pkg in cpkgs1: -+ if pkg not in cpkgs2: -+ print >>sys.stderr, "Error: Conflict cache missing", pkg -+for pkg in cpkgs2: -+ if pkg not in cpkgs1: -+ print >>sys.stderr, "Error: Conflict cache extra", pkg -+ -+# File Requires -+frd1, blah, fpd1 = yb1.rpmdb.fileRequiresData() -+frd2, blah, fpd2 = yb2.rpmdb.fileRequiresData() -+if len(frd1) != len(frd2): -+ print >>sys.stderr, "Error: FileReq len mismatch:", len(frd1), len(frd2) -+for pkgtup in frd1: -+ if pkgtup not in frd2: -+ print >>sys.stderr, "Error: FileReq cache missing", pkgtup -+ continue -+ if len(set(frd1[pkgtup])) != len(set(frd2[pkgtup])): -+ print >>sys.stderr, ("Error: FileReq[%s] len mismatch:" % (pkgtup,), -+ len(frd1[pkgtup]), len(frd2[pkgtup])) -+ for name in frd1[pkgtup]: -+ if name not in frd2[pkgtup]: -+ print >>sys.stderr, ("Error: FileReq[%s] cache missing" % (pkgtup,), -+ name) -+for pkgtup in frd2: -+ if pkgtup not in frd1: -+ print >>sys.stderr, "Error: FileReq cache extra", pkgtup -+ continue -+ for name in frd2[pkgtup]: -+ if name not in frd1[pkgtup]: -+ print >>sys.stderr, ("Error: FileReq[%s] cache extra" % (pkgtup,), -+ name) -+ -+# File Provides (of requires) -- not exact -+if len(fpd1) != len(fpd2): -+ print >>sys.stderr, "Error: FileProv len mismatch:", len(fpd1), len(fpd2) -+for name in fpd1: -+ if name not in fpd2: -+ print >>sys.stderr, "Error: FileProv cache missing", name -+ continue -+ -+ if not __provides_of_requires_exact__: -+ continue # We might be missing some providers -+ -+ if len(fpd1[name]) != len(fpd2[name]): -+ print >>sys.stderr, ("Error: FileProv[%s] len mismatch:" % (pkgtup,), -+ len(fpd1[name]), len(fpd2[name])) -+ for pkgtup in fpd1[name]: -+ if pkgtup not in fpd2[name]: -+ print >>sys.stderr,"Error: FileProv[%s] cache missing" % name,pkgtup -+for name in fpd2: -+ if name not in fpd1: -+ print >>sys.stderr, "Error: FileProv cache extra", name -+ continue -+ for pkgtup in fpd2[name]: -+ if pkgtup not in fpd1[name]: -+ print >>sys.stderr,"Error: FileProv[%s] cache extra" % name,pkgtup -diff --git a/test/testbase.py b/test/testbase.py -index 3edfe57..c7a1ffe 100644 ---- a/test/testbase.py -+++ b/test/testbase.py -@@ -14,6 +14,7 @@ from yum import packages - from yum import packageSack - from yum.constants import TS_INSTALL_STATES, TS_REMOVE_STATES - from cli import YumBaseCli -+from yum.rpmsack import RPMDBPackageSack as _rpmdbsack - import inspect - from rpmUtils import arch - -@@ -233,6 +234,50 @@ class FakeRpmDb(packageSack.PackageSack): - def __init__(self): - packageSack.PackageSack.__init__(self) - -+ # Need to mock out rpmdb caching... copy&paste. Gack. -+ def returnConflictPackages(self): -+ ret = [] -+ for pkg in self.returnPackages(): -+ if len(pkg.conflicts): -+ ret.append(pkg) -+ return ret -+ def fileRequiresData(self): -+ installedFileRequires = {} -+ installedUnresolvedFileRequires = set() -+ resolved = set() -+ for pkg in self.returnPackages(): -+ for name, flag, evr in pkg.requires: -+ if not name.startswith('/'): -+ continue -+ installedFileRequires.setdefault(pkg.pkgtup, []).append(name) -+ if name not in resolved: -+ dep = self.getProvides(name, flag, evr) -+ resolved.add(name) -+ if not dep: -+ installedUnresolvedFileRequires.add(name) -+ -+ fileRequires = set() -+ for fnames in installedFileRequires.itervalues(): -+ fileRequires.update(fnames) -+ installedFileProviders = {} -+ for fname in fileRequires: -+ pkgtups = [pkg.pkgtup for pkg in self.getProvides(fname)] -+ installedFileProviders[fname] = pkgtups -+ -+ ret = (installedFileRequires, installedUnresolvedFileRequires, -+ installedFileProviders) -+ -+ return ret -+ def transactionCacheFileRequires(self, installedFileRequires, -+ installedUnresolvedFileRequires, -+ installedFileProvides, -+ problems): -+ return -+ def transactionCacheConflictPackages(self, pkgs): -+ return -+ def transactionResultVersion(self, rpmdbv): -+ return -+ - def getProvides(self, name, flags=None, version=(None, None, None)): - """return dict { packages -> list of matching provides }""" - self._checkIndexes(failure='build') -diff --git a/yum/__init__.py b/yum/__init__.py -index 2aaa66a..affa92b 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -469,7 +469,8 @@ class YumBase(depsolve.Depsolve): - self.verbose_logger.log(logginglevels.DEBUG_4, - _('Reading Local RPMDB')) - self._rpmdb = rpmsack.RPMDBPackageSack(root=self.conf.installroot, -- releasever=self.yumvar['releasever']) -+ releasever=self.yumvar['releasever'], -+ cachedir=self.conf.cachedir) - self.verbose_logger.debug('rpmdb time: %0.3f' % (time.time() - rpmdb_st)) - return self._rpmdb - -@@ -1072,6 +1073,13 @@ class YumBase(depsolve.Depsolve): - if self.conf.history_record: - self.history.beg(rpmdbv, using_pkgs, list(self.tsInfo)) - -+ # Just before we update the transaction, update what we think the -+ # rpmdb will look like. This needs to be done before the run, so that if -+ # "something" happens and the rpmdb is different from what we think it -+ # will be we store what we thought, not what happened (so it'll be an -+ # invalid cache). -+ self.rpmdb.transactionResultVersion(self.tsInfo.futureRpmDBVersion()) -+ - errors = self.ts.run(cb.callback, '') - # ts.run() exit codes are, hmm, "creative": None means all ok, empty - # list means some errors happened in the transaction and non-empty -@@ -1699,6 +1707,11 @@ class YumBase(depsolve.Depsolve): - exts = ['cachecookie', 'mirrorlist.txt'] - return self._cleanFiles(exts, 'cachedir', 'metadata') - -+ def cleanRpmDB(self): -+ cachedir = self.conf.cachedir + "/rpmdb-cache/" -+ filelist = misc.getFileList(cachedir, '', []) -+ return self._cleanFilelist('rpmdb', filelist) -+ - def _cleanFiles(self, exts, pathattr, filetype): - filelist = [] - removed = 0 -@@ -1707,7 +1720,9 @@ class YumBase(depsolve.Depsolve): - path = getattr(repo, pathattr) - if os.path.exists(path) and os.path.isdir(path): - filelist = misc.getFileList(path, ext, filelist) -+ self._cleanFilelist(filetype, filelist) - -+ def _cleanFilelist(self, filetype, filelist): - for item in filelist: - try: - misc.unlink_f(item) -@@ -4163,7 +4178,9 @@ class YumBase(depsolve.Depsolve): - if cachedir is None: - return False # Tried, but failed, to get a "user" cachedir - -- self.repos.setCacheDir(cachedir + varReplace(suffix, self.yumvar)) -+ cachedir += varReplace(suffix, self.yumvar) -+ self.repos.setCacheDir(cachedir) -+ self.rpmdb.setCacheDir(cachedir) - - return True # We got a new cache dir - -diff --git a/yum/depsolve.py b/yum/depsolve.py -index 7871e98..b5953c2 100644 ---- a/yum/depsolve.py -+++ b/yum/depsolve.py -@@ -918,31 +918,27 @@ class Depsolve(object): - - def _checkFileRequires(self): - fileRequires = set() -+ nfileRequires = set() # These need to be looked up in the rpmdb. - reverselookup = {} - ret = [] - - # generate list of file requirement in rpmdb - if self.installedFileRequires is None: -- self.installedFileRequires = {} -- self.installedUnresolvedFileRequires = set() -- resolved = set() -- for pkg in self.rpmdb.returnPackages(): -- for name, flag, evr in pkg.requires: -- if not name.startswith('/'): -- continue -- self.installedFileRequires.setdefault(pkg, []).append(name) -- if name not in resolved: -- dep = self.rpmdb.getProvides(name, flag, evr) -- resolved.add(name) -- if not dep: -- self.installedUnresolvedFileRequires.add(name) -+ self.installedFileRequires, \ -+ self.installedUnresolvedFileRequires, \ -+ self.installedFileProviders = self.rpmdb.fileRequiresData() - - # get file requirements from packages not deleted -- for po, files in self.installedFileRequires.iteritems(): -- if not self._tsInfo.getMembersWithState(po.pkgtup, output_states=TS_REMOVE_STATES): -+ todel = [] -+ for pkgtup, files in self.installedFileRequires.iteritems(): -+ if self._tsInfo.getMembersWithState(pkgtup, output_states=TS_REMOVE_STATES): -+ todel.append(pkgtup) -+ else: - fileRequires.update(files) - for filename in files: -- reverselookup.setdefault(filename, []).append(po) -+ reverselookup.setdefault(filename, []).append(pkgtup) -+ for pkgtup in todel: -+ del self.installedFileRequires[pkgtup] - - fileRequires -= self.installedUnresolvedFileRequires - -@@ -950,6 +946,8 @@ class Depsolve(object): - for txmbr in self._tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): - for name, flag, evr in txmbr.po.requires: - if name.startswith('/'): -+ pt = txmbr.po.pkgtup -+ self.installedFileRequires.setdefault(pt, []).append(name) - # check if file requires was already unresolved in update - if name in self.installedUnresolvedFileRequires: - already_broken = False -@@ -959,23 +957,75 @@ class Depsolve(object): - break - if already_broken: - continue -+ if name not in fileRequires: -+ nfileRequires.add(name) - fileRequires.add(name) -- reverselookup.setdefault(name, []).append(txmbr.po) -+ reverselookup.setdefault(name, []).append(txmbr.po.pkgtup) -+ -+ todel = [] -+ for fname in self.installedFileProviders: -+ niFP_fname = [] -+ for pkgtup in self.installedFileProviders[fname]: -+ if self._tsInfo.getMembersWithState(pkgtup, output_states=TS_REMOVE_STATES): -+ continue -+ niFP_fname.append(pkgtup) -+ -+ if not niFP_fname: -+ todel.append(fname) -+ continue -+ -+ self.installedFileProviders[fname] = niFP_fname -+ for fname in todel: -+ del self.installedFileProviders[fname] - - # check the file requires -+ iFP = self.installedFileProviders - for filename in fileRequires: -- if not self.tsInfo.getOldProvides(filename) and not self.tsInfo.getNewProvides(filename): -- for po in reverselookup[filename]: -- ret.append( (po, (filename, 0, '')) ) -+ # In theory we need this to be: -+ # -+ # nprov, filename in iFP (or new), oprov -+ # -+ # ...this keeps the cache exactly the same as the non-cached data. -+ # However that also means that we'll always need the filelists, so -+ # we do: -+ # -+ # filename in iFP (if found return), oprov (if found return), -+ # nprov -+ # -+ # ...this means we'll always get the same _result_ (as we only need -+ # to know if _something_ provides), but our cache will be off on -+ # what does/doesn't provide the file. -+ if filename in self.installedFileProviders: -+ continue - -- return ret -+ oprov = self.tsInfo.getOldProvides(filename) -+ if oprov: -+ iFP.setdefault(filename, []).extend([po.pkgtup for po in oprov]) -+ continue -+ -+ nprov = self.tsInfo.getNewProvides(filename) -+ if nprov: -+ iFP.setdefault(filename, []).extend([po.pkgtup for po in nprov]) -+ continue -+ -+ for pkgtup in reverselookup[filename]: -+ po = self.getInstalledPackageObject(pkgtup) -+ ret.append( (po, (filename, 0, '')) ) - -+ self.rpmdb.transactionCacheFileRequires(self.installedFileRequires, -+ self.installedUnresolvedFileRequires, -+ self.installedFileProviders, -+ ret) -+ -+ return ret - - def _checkConflicts(self): - ret = [ ] -- for po in self.rpmdb.returnPackages(): -+ cpkgs = [] -+ for po in self.rpmdb.returnConflictPackages(): - if self.tsInfo.getMembersWithState(po.pkgtup, output_states=TS_REMOVE_STATES): - continue -+ cpkgs.append(po) - for conflict in po.returnPrco('conflicts'): - (r, f, v) = conflict - for conflicting_po in self.tsInfo.getNewProvides(r, f, v): -@@ -985,16 +1035,20 @@ class Depsolve(object): - conflicting_po) ) - for txmbr in self.tsInfo.getMembersWithState(output_states=TS_INSTALL_STATES): - po = txmbr.po -+ done = False - for conflict in txmbr.po.returnPrco('conflicts'): -+ if not done: -+ cpkgs.append(txmbr.po) -+ done = True - (r, f, v) = conflict - for conflicting_po in self.tsInfo.getProvides(r, f, v): - if conflicting_po.pkgtup[0] == po.pkgtup[0] and conflicting_po.pkgtup[2:] == po.pkgtup[2:]: - continue - ret.append( (po, self._prco_req_nfv2req(r, f, v), - conflicting_po) ) -+ self.rpmdb.transactionCacheConflictPackages(cpkgs) - return ret - -- - def isPackageInstalled(self, pkgname): - lst = self.tsInfo.matchNaevr(name = pkgname) - for txmbr in lst: -diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index 151e33e..a5f4042 100644 ---- a/yum/rpmsack.py -+++ b/yum/rpmsack.py -@@ -97,7 +97,10 @@ class RPMDBPackageSack(PackageSackBase): - rpm.RPMTAG_OBSOLETEFLAGS) - } - -- def __init__(self, root='/', releasever=None): -+ # Do we want to cache rpmdb data in a file, for later use? -+ __cache_rpmdb__ = True -+ -+ def __init__(self, root='/', releasever=None, cachedir=None): - self.root = root - self._idx2pkg = {} - self._name2pkg = {} -@@ -107,6 +110,13 @@ class RPMDBPackageSack(PackageSackBase): - self._get_pro_cache = {} - self._get_req_cache = {} - self._loaded_gpg_keys = False -+ if cachedir is None: -+ cachedir = misc.getCacheDir() -+ self.setCacheDir(cachedir) -+ self._have_cached_rpmdbv_data = None -+ self._cached_conflicts_data = None -+ # Store the result of what happens, if a transaction completes. -+ self._trans_cache_store = {} - self.ts = None - self.releasever = releasever - self.auto_close = False # this forces a self.ts.close() after -@@ -153,6 +163,13 @@ class RPMDBPackageSack(PackageSackBase): - 'conflicts' : { }, - 'obsoletes' : { }, - } -+ self._have_cached_rpmdbv_data = None -+ self._cached_conflicts_data = None -+ -+ def setCacheDir(self, cachedir): -+ """ Sets the internal cachedir value for the rpmdb, to be the -+ "rpmdb-cache" directory from this parent. """ -+ self._cachedir = cachedir + "/rpmdb-cache/" - - def readOnlyTS(self): - if not self.ts: -@@ -367,6 +384,103 @@ class RPMDBPackageSack(PackageSackBase): - pkgobjlist = pkgobjlist[0] + pkgobjlist[1] - return pkgobjlist - -+ def _uncached_returnConflictPackages(self): -+ if self._cached_conflicts_data is None: -+ ret = [] -+ for pkg in self.returnPackages(): -+ if len(pkg.conflicts): -+ ret.append(pkg) -+ self._cached_conflicts_data = ret -+ return self._cached_conflicts_data -+ -+ def _write_conflicts_new(self, pkgs, rpmdbv): -+ if not os.access(self._cachedir, os.W_OK): -+ return -+ -+ conflicts_fname = self._cachedir + '/conflicts' -+ fo = open(conflicts_fname + '.tmp', 'w') -+ fo.write("%s\n" % rpmdbv) -+ fo.write("%u\n" % len(pkgs)) -+ for pkg in sorted(pkgs): -+ for var in pkg.pkgtup: -+ fo.write("%s\n" % var) -+ fo.close() -+ os.rename(conflicts_fname + '.tmp', conflicts_fname) -+ -+ def _write_conflicts(self, pkgs): -+ rpmdbv = self.simpleVersion(main_only=True)[0] -+ self._write_conflicts_new(pkgs, rpmdbv) -+ -+ def _read_conflicts(self): -+ if not self.__cache_rpmdb__: -+ return None -+ -+ def _read_str(fo): -+ return fo.readline()[:-1] -+ -+ conflict_fname = self._cachedir + '/conflicts' -+ if not os.path.exists(conflict_fname): -+ return None -+ -+ fo = open(conflict_fname) -+ frpmdbv = fo.readline() -+ rpmdbv = self.simpleVersion(main_only=True)[0] -+ if not frpmdbv or rpmdbv != frpmdbv[:-1]: -+ return None -+ -+ ret = [] -+ try: -+ # Read the conflicts... -+ pkgtups_num = int(_read_str(fo)) -+ while pkgtups_num > 0: -+ pkgtups_num -= 1 -+ -+ # n, a, e, v, r -+ pkgtup = (_read_str(fo), _read_str(fo), -+ _read_str(fo), _read_str(fo), _read_str(fo)) -+ int(pkgtup[2]) # Check epoch is valid -+ ret.extend(self.searchPkgTuple(pkgtup)) -+ if fo.readline() != '': # Should be EOF -+ return None -+ except ValueError: -+ return None -+ -+ self._cached_conflicts_data = ret -+ return self._cached_conflicts_data -+ -+ def transactionCacheConflictPackages(self, pkgs): -+ if self.__cache_rpmdb__: -+ self._trans_cache_store['conflicts'] = pkgs -+ -+ def returnConflictPackages(self): -+ """ Return a list of packages that have conflicts. """ -+ pkgs = self._read_conflicts() -+ if pkgs is None: -+ pkgs = self._uncached_returnConflictPackages() -+ if self.__cache_rpmdb__: -+ self._write_conflicts(pkgs) -+ -+ return pkgs -+ -+ def transactionResultVersion(self, rpmdbv): -+ """ We are going to do a transaction, and the parameter will be the -+ rpmdb version when we finish. The idea being we can update all -+ our rpmdb caches for that rpmdb version. """ -+ -+ if not self.__cache_rpmdb__: -+ self._trans_cache_store = {} -+ return -+ -+ if 'conflicts' in self._trans_cache_store: -+ pkgs = self._trans_cache_store['conflicts'] -+ self._write_conflicts_new(pkgs, rpmdbv) -+ -+ if 'file-requires' in self._trans_cache_store: -+ data = self._trans_cache_store['file-requires'] -+ self._write_file_requires(rpmdbv, data) -+ -+ self._trans_cache_store = {} -+ - def returnGPGPubkeyPackages(self): - """ Return packages of the gpg-pubkeys ... hacky. """ - ts = self.readOnlyTS() -@@ -377,6 +491,198 @@ class RPMDBPackageSack(PackageSackBase): - ret.append(self._makePackageObject(hdr, mi.instance())) - return ret - -+ def _read_file_requires(self): -+ def _read_str(fo): -+ return fo.readline()[:-1] -+ -+ assert self.__cache_rpmdb__ -+ if not os.path.exists(self._cachedir + '/file-requires'): -+ return None, None -+ -+ rpmdbv = self.simpleVersion(main_only=True)[0] -+ fo = open(self._cachedir + '/file-requires') -+ frpmdbv = fo.readline() -+ if not frpmdbv or rpmdbv != frpmdbv[:-1]: -+ return None, None -+ -+ iFR = {} -+ iFP = {} -+ try: -+ # Read the requires... -+ pkgtups_num = int(_read_str(fo)) -+ while pkgtups_num > 0: -+ pkgtups_num -= 1 -+ -+ # n, a, e, v, r -+ pkgtup = (_read_str(fo), _read_str(fo), -+ _read_str(fo), _read_str(fo), _read_str(fo)) -+ int(pkgtup[2]) # Check epoch is valid -+ -+ files_num = int(_read_str(fo)) -+ while files_num > 0: -+ files_num -= 1 -+ -+ fname = _read_str(fo) -+ -+ iFR.setdefault(pkgtup, []).append(fname) -+ -+ # Read the provides... -+ files_num = int(_read_str(fo)) -+ while files_num > 0: -+ files_num -= 1 -+ fname = _read_str(fo) -+ pkgtups_num = int(_read_str(fo)) -+ while pkgtups_num > 0: -+ pkgtups_num -= 1 -+ -+ # n, a, e, v, r -+ pkgtup = (_read_str(fo), _read_str(fo), -+ _read_str(fo), _read_str(fo), _read_str(fo)) -+ int(pkgtup[2]) # Check epoch is valid -+ -+ iFP.setdefault(fname, []).append(pkgtup) -+ -+ if fo.readline() != '': # Should be EOF -+ return None, None -+ except ValueError: -+ return None, None -+ -+ return iFR, iFP -+ -+ def fileRequiresData(self): -+ """ Get a cached copy of the fileRequiresData for -+ depsolving/checkFileRequires, note the giant comment in that -+ function about how we don't keep this perfect for the providers of -+ the requires. """ -+ if self.__cache_rpmdb__: -+ iFR, iFP = self._read_file_requires() -+ if iFR is not None: -+ return iFR, set(), iFP -+ -+ installedFileRequires = {} -+ installedUnresolvedFileRequires = set() -+ resolved = set() -+ for pkg in self.returnPackages(): -+ for name, flag, evr in pkg.requires: -+ if not name.startswith('/'): -+ continue -+ installedFileRequires.setdefault(pkg.pkgtup, []).append(name) -+ if name not in resolved: -+ dep = self.getProvides(name, flag, evr) -+ resolved.add(name) -+ if not dep: -+ installedUnresolvedFileRequires.add(name) -+ -+ fileRequires = set() -+ for fnames in installedFileRequires.itervalues(): -+ fileRequires.update(fnames) -+ installedFileProviders = {} -+ for fname in fileRequires: -+ pkgtups = [pkg.pkgtup for pkg in self.getProvides(fname)] -+ installedFileProviders[fname] = pkgtups -+ -+ ret = (installedFileRequires, installedUnresolvedFileRequires, -+ installedFileProviders) -+ if self.__cache_rpmdb__: -+ rpmdbv = self.simpleVersion(main_only=True)[0] -+ self._write_file_requires(rpmdbv, ret) -+ -+ return ret -+ -+ def transactionCacheFileRequires(self, installedFileRequires, -+ installedUnresolvedFileRequires, -+ installedFileProvides, -+ problems): -+ if not self.__cache_rpmdb__: -+ return -+ -+ if installedUnresolvedFileRequires or problems: -+ return -+ -+ data = (installedFileRequires, -+ installedUnresolvedFileRequires, -+ installedFileProvides) -+ -+ self._trans_cache_store['file-requires'] = data -+ -+ def _write_file_requires(self, rpmdbversion, data): -+ if not os.access(self._cachedir, os.W_OK): -+ return -+ -+ (installedFileRequires, -+ installedUnresolvedFileRequires, -+ installedFileProvides) = data -+ -+ fo = open(self._cachedir + '/file-requires.tmp', 'w') -+ fo.write("%s\n" % rpmdbversion) -+ -+ fo.write("%u\n" % len(installedFileRequires)) -+ for pkgtup in sorted(installedFileRequires): -+ for var in pkgtup: -+ fo.write("%s\n" % var) -+ filenames = set(installedFileRequires[pkgtup]) -+ fo.write("%u\n" % len(filenames)) -+ for fname in sorted(filenames): -+ fo.write("%s\n" % fname) -+ -+ fo.write("%u\n" % len(installedFileProvides)) -+ for fname in sorted(installedFileProvides): -+ fo.write("%s\n" % fname) -+ -+ pkgtups = set(installedFileProvides[fname]) -+ fo.write("%u\n" % len(pkgtups)) -+ for pkgtup in sorted(pkgtups): -+ for var in pkgtup: -+ fo.write("%s\n" % var) -+ fo.close() -+ os.rename(self._cachedir + '/file-requires.tmp', -+ self._cachedir + '/file-requires') -+ -+ def _get_cached_simpleVersion_main(self): -+ """ Return the cached string of the main rpmdbv. """ -+ if self._have_cached_rpmdbv_data is not None: -+ return self._have_cached_rpmdbv_data -+ -+ if not self.__cache_rpmdb__: -+ return None -+ -+ # This test is "obvious" and the only thing to come out of: -+ # http://lists.rpm.org/pipermail/rpm-maint/2007-November/001719.html -+ # ...if anything gets implemented, we should change. -+ rpmdbvfname = self._cachedir + "/version" -+ rpmdbfname = "/var/lib/rpm/Packages" -+ -+ if os.path.exists(rpmdbvfname) and os.path.exists(rpmdbfname): -+ # See if rpmdb has "changed" ... -+ nmtime = os.path.getmtime(rpmdbvfname) -+ omtime = os.path.getmtime(rpmdbfname) -+ if omtime <= nmtime: -+ rpmdbv = open(rpmdbvfname).readline()[:-1] -+ self._have_cached_rpmdbv_data = rpmdbv -+ return self._have_cached_rpmdbv_data -+ -+ def _put_cached_simpleVersion_main(self, rpmdbv): -+ self._have_cached_rpmdbv_data = str(rpmdbv) -+ -+ if not self.__cache_rpmdb__: -+ return -+ -+ rpmdbvfname = self._cachedir + "/version" -+ if not os.access(self._cachedir, os.W_OK): -+ if os.path.exists(self._cachedir): -+ return -+ -+ try: -+ os.makedirs(self._cachedir) -+ except (IOError, OSError), e: -+ return -+ -+ fo = open(rpmdbvfname + ".tmp", "w") -+ fo.write(self._have_cached_rpmdbv_data) -+ fo.write('\n') -+ fo.close() -+ os.rename(rpmdbvfname + ".tmp", rpmdbvfname) -+ - def simpleVersion(self, main_only=False, groups={}): - """ Return a simple version for all installed packages. """ - def _up_revs(irepos, repoid, rev, pkg, csum): -@@ -387,6 +693,11 @@ class RPMDBPackageSack(PackageSackBase): - rpsv = irevs.setdefault(rev, PackageSackVersion()) - rpsv.update(pkg, csum) - -+ if main_only and not groups: -+ rpmdbv = self._get_cached_simpleVersion_main() -+ if rpmdbv is not None: -+ return [rpmdbv, {}] -+ - main = PackageSackVersion() - irepos = {} - main_grps = {} -@@ -420,6 +731,9 @@ class RPMDBPackageSack(PackageSackBase): - if pkg.name in groups[group]: - _up_revs(irepos_grps[group], repoid, rev, pkg, csum) - -+ if self._have_cached_rpmdbv_data is None: -+ self._put_cached_simpleVersion_main(main) -+ - if groups: - return [main, irepos, main_grps, irepos_grps] - return [main, irepos] -diff --git a/yum/transactioninfo.py b/yum/transactioninfo.py -index c2fc804..c7d5b8c 100644 ---- a/yum/transactioninfo.py -+++ b/yum/transactioninfo.py -@@ -26,7 +26,7 @@ to rpm. - """ - - from constants import * --from packageSack import PackageSack -+from packageSack import PackageSack, PackageSackVersion - from packages import YumInstalledPackage - from sqlitesack import YumAvailablePackageSqlite - import Errors -@@ -558,6 +558,42 @@ class TransactionData: - result.update(self.getNewRequires(name, flag, version)) - return result - -+ def futureRpmDBVersion(self): -+ """ 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. """ -+ pkgs = self.rpmdb.returnPackages() -+ _reinstalled_pkgtups = {} -+ for txmbr in self.getMembersWithState(None, TS_INSTALL_STATES): -+ # reinstalls have to use their "new" checksum data, in case it's -+ # different. -+ if hasattr(txmbr, 'reinstall') and txmbr.reinstall: -+ _reinstalled_pkgtups[txmbr.po.pkgtup] = txmbr.po -+ pkgs.append(txmbr.po) -+ -+ main = PackageSackVersion() -+ for pkg in sorted(pkgs): -+ if pkg.repoid != 'installed': -+ # Paste from PackageSackBase.simpleVersion() -+ csum = pkg.returnIdSum() -+ main.update(pkg, csum) -+ continue -+ -+ # Installed pkg, see if it's about to die -+ if self.getMembersWithState(pkg.pkgtup, TS_REMOVE_STATES): -+ continue -+ # ...or die and be risen again (Zombie!) -+ if pkg.pkgtup in _reinstalled_pkgtups: -+ continue -+ -+ # Paste from rpmdb.simpleVersion() -+ ydbi = pkg.yumdb_info -+ csum = None -+ if 'checksum_type' in ydbi and 'checksum_data' in ydbi: -+ csum = (ydbi.checksum_type, ydbi.checksum_data) -+ main.update(pkg, csum) -+ return main -+ - class ConditionalTransactionData(TransactionData): - """A transaction data implementing conditional package addition""" - def __init__(self): -@@ -615,6 +651,7 @@ class SortableTransactionData(TransactionData): - self._sorted.reverse() - return self._sorted - -+ - class TransactionMember: - """Class to describe a Transaction Member (a pkg to be installed/ - updated/erased).""" -diff --git a/yumcommands.py b/yumcommands.py -index b809216..f123c16 100644 ---- a/yumcommands.py -+++ b/yumcommands.py -@@ -1099,20 +1099,29 @@ class VersionCommand(YumCommand): - - verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3) - groups = {} -- gconf = yum.config.readVersionGroupsConfig() -+ if vcmd in ('nogroups', 'nogroups-installed', 'nogroups-available', -+ 'nogroups-all'): -+ gconf = [] -+ if vcmd == 'nogroups': -+ vcmd = 'installed' -+ else: -+ vcmd = vcmd[len('nogroups-'):] -+ else: -+ gconf = yum.config.readVersionGroupsConfig() -+ - for group in gconf: - groups[group] = set(gconf[group].pkglist) - if gconf[group].run_with_packages: - groups[group].update(base.run_with_package_names) - -- if vcmd in ('grouplist'): -+ if vcmd == 'grouplist': - print _(" Yum version groups:") - for group in sorted(groups): - print " ", group - - return 0, ['version grouplist'] - -- if vcmd in ('groupinfo'): -+ if vcmd == 'groupinfo': - for group in groups: - if group not in extcmds[1:]: - continue -commit 366c3e6bb9ebd7ad3f121bdf2c089b0132d51604 -Author: James Antill -Date: Fri Dec 4 08:27:01 2009 -0500 - - Fixes for clean functions, BZ 544173 - - When nothing to be done, set removed. - When doing "clean all" fix the var. name. - When doing anything but clean rpmdb, fix the return. - Allow rpmdb as a valid arg. - Fix getFileList() with ext == '' - -diff --git a/cli.py b/cli.py -index f93a706..2c6c9a4 100644 ---- a/cli.py -+++ b/cli.py -@@ -897,7 +897,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): - rpmcode, rpmresults = self.cleanRpmDB() - self.plugins.run('clean') - -- code = hdrcode + pkgcode + xmlcode + dbcode + rpmdb -+ code = hdrcode + pkgcode + xmlcode + dbcode + rpmcode - results = (hdrresults + pkgresults + xmlresults + dbresults + - rpmresults) - for msg in results: -diff --git a/yum/__init__.py b/yum/__init__.py -index affa92b..1c82144 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -1714,15 +1714,15 @@ class YumBase(depsolve.Depsolve): - - def _cleanFiles(self, exts, pathattr, filetype): - filelist = [] -- removed = 0 - for ext in exts: - for repo in self.repos.listEnabled(): - path = getattr(repo, pathattr) - if os.path.exists(path) and os.path.isdir(path): - filelist = misc.getFileList(path, ext, filelist) -- self._cleanFilelist(filetype, filelist) -+ return self._cleanFilelist(filetype, filelist) - - def _cleanFilelist(self, filetype, filelist): -+ removed = 0 - for item in filelist: - try: - misc.unlink_f(item) -diff --git a/yum/misc.py b/yum/misc.py -index 642f9a2..f221f1d 100644 ---- a/yum/misc.py -+++ b/yum/misc.py -@@ -336,7 +336,7 @@ def getFileList(path, ext, filelist): - if os.path.isdir(path + '/' + d): - filelist = getFileList(path + '/' + d, ext, filelist) - else: -- if d[-extlen:].lower() == '%s' % (ext): -+ if not ext or d[-extlen:].lower() == '%s' % (ext): - newpath = os.path.normpath(path + '/' + d) - filelist.append(newpath) - -diff --git a/yumcommands.py b/yumcommands.py -index 83d9d00..4fe2fe1 100644 ---- a/yumcommands.py -+++ b/yumcommands.py -@@ -85,7 +85,7 @@ def checkGroupArg(base, basecmd, extcmds): - - def checkCleanArg(base, basecmd, extcmds): - VALID_ARGS = ('headers', 'packages', 'metadata', 'dbcache', 'plugins', -- 'expire-cache', 'all') -+ 'expire-cache', 'rpmdb', 'all') - - if len(extcmds) == 0: - base.logger.critical(_('Error: clean requires an option: %s') % ( -commit dbcdcd605d233c555f3ce3861152a2378bf9e622 -Author: James Antill -Date: Thu Dec 10 09:46:00 2009 -0500 - - Fix when we have file require(s) from just to be installed pkgs. The mash bug - -diff --git a/yum/depsolve.py b/yum/depsolve.py -index b5953c2..d46452c 100644 ---- a/yum/depsolve.py -+++ b/yum/depsolve.py -@@ -1009,7 +1009,11 @@ class Depsolve(object): - continue - - for pkgtup in reverselookup[filename]: -- po = self.getInstalledPackageObject(pkgtup) -+ po = self.tsInfo.getMembersWithState(pkgtup, TS_INSTALL_STATES) -+ if po: -+ po = po[0] # Should only have one -+ else: -+ po = self.getInstalledPackageObject(pkgtup) - ret.append( (po, (filename, 0, '')) ) - - self.rpmdb.transactionCacheFileRequires(self.installedFileRequires, -commit 67882783e6add4c5c9b717872554c23fc0ade913 -Author: James Antill -Date: Thu Dec 10 18:28:28 2009 -0500 - - getMembers returns txmbrs not POs ... *sigh* - -diff --git a/yum/depsolve.py b/yum/depsolve.py -index d46452c..a09bd4b 100644 ---- a/yum/depsolve.py -+++ b/yum/depsolve.py -@@ -1011,7 +1011,7 @@ class Depsolve(object): - for pkgtup in reverselookup[filename]: - po = self.tsInfo.getMembersWithState(pkgtup, TS_INSTALL_STATES) - if po: -- po = po[0] # Should only have one -+ po = po[0].po # Should only have one - else: - po = self.getInstalledPackageObject(pkgtup) - ret.append( (po, (filename, 0, '')) ) diff --git a/sources b/sources deleted file mode 100644 index fa09d52..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -91eff58aa4c25cd4f46b21201bbf9bea yum-3.2.28.tar.gz diff --git a/yum-2.6-stdout-trick.patch b/yum-2.6-stdout-trick.patch deleted file mode 100644 index 140f910..0000000 --- a/yum-2.6-stdout-trick.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- yum/logginglevels.py~ 2009-01-20 16:56:19.000000000 -0500 -+++ yum/logginglevels.py 2009-01-20 16:56:19.000000000 -0500 -@@ -141,7 +141,7 @@ - plainformatter = logging.Formatter("%(message)s") - syslogformatter = logging.Formatter("yum: %(message)s") - -- console_stdout = logging.StreamHandler(sys.stdout) -+ console_stdout = logging.StreamHandler(sys.__stdout__) - console_stdout.setFormatter(plainformatter) - verbose = logging.getLogger("yum.verbose") - verbose.propagate = False diff --git a/yum-3.2.20-listTrans-skip-broken.patch b/yum-3.2.20-listTrans-skip-broken.patch deleted file mode 100644 index 4e73716..0000000 --- a/yum-3.2.20-listTrans-skip-broken.patch +++ /dev/null @@ -1,51 +0,0 @@ -commit 5e405ec2e6651dc828c9b47075b6867a7e145536 -Author: James Antill -Date: Mon Oct 27 23:59:37 2008 -0400 - - Iterate skipped_packages properly as they are pos not txmbrs, fixes BZ 468785 - -diff --git a/output.py b/output.py -index 502aa4b..3c2795c 100644 ---- a/output.py -+++ b/output.py -@@ -789,8 +789,7 @@ class YumOutput: - (_('Removing'), self.tsInfo.removed), - (_('Installing for dependencies'), self.tsInfo.depinstalled), - (_('Updating for dependencies'), self.tsInfo.depupdated), -- (_('Removing for dependencies'), self.tsInfo.depremoved), -- (_('Skipped (dependency problems)'), self.skipped_packages),]: -+ (_('Removing for dependencies'), self.tsInfo.depremoved)]: - lines = [] - for txmbr in pkglist: - (n,a,e,v,r) = txmbr.pkgtup -@@ -813,6 +812,30 @@ class YumOutput: - - pkglist_lines.append((action, lines)) - -+ for (action, pkglist) in [(_('Skipped (dependency problems)'), -+ self.skipped_packages),]: -+ lines = [] -+ for po in pkglist: -+ (n,a,e,v,r) = po.pkgtup -+ evr = po.printVer() -+ repoid = po.repoid -+ pkgsize = float(po.size) -+ size = self.format_number(pkgsize) -+ -+ if a is None: # gpgkeys are weird -+ a = 'noarch' -+ -+ lines.append((n, a, evr, repoid, size, [])) -+ # Create a dict of field_length => number of packages, for -+ # each field. -+ for (d, v) in (("n",len(n)), ("v",len(evr)), ("r",len(repoid))): -+ data[d].setdefault(v, 0) -+ data[d][v] += 1 -+ if a_wid < len(a): # max() is only in 2.5.z -+ a_wid = len(a) -+ -+ pkglist_lines.append((action, lines)) -+ - if data['n']: - data = [data['n'], {}, data['v'], data['r'], {}] - columns = [1, a_wid, 1, 1, 5] diff --git a/yum-3.2.20-obsoletes-dict-fix.patch b/yum-3.2.20-obsoletes-dict-fix.patch deleted file mode 100644 index 282d70f..0000000 --- a/yum-3.2.20-obsoletes-dict-fix.patch +++ /dev/null @@ -1,18 +0,0 @@ -commit a59165490ebc236f7682ebc157bf069497958b42 -Author: James Antill -Date: Thu Dec 4 18:58:59 2008 -0500 - - Always have an obsoletes dict, so we can always call getObsoletesTuples() etc. - -diff --git a/rpmUtils/updates.py b/rpmUtils/updates.py -index f348ae9..16f733b 100644 ---- a/rpmUtils/updates.py -+++ b/rpmUtils/updates.py -@@ -54,6 +54,7 @@ class Updates: - self.updating_dict = {} - #debug, ignore me - self.debug = 0 -+ self.obsoletes = {} - - def _delFromDict(self, dict_, keys, value): - for key in keys: diff --git a/yum-6hr-metadata_expire.patch b/yum-6hr-metadata_expire.patch deleted file mode 100644 index 9b7f060..0000000 --- a/yum-6hr-metadata_expire.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/yum/config.py b/yum/config.py -index 2219605..13efd9e 100644 ---- a/yum/config.py -+++ b/yum/config.py -@@ -653,7 +653,7 @@ class YumConf(StartupConf): - # Time in seconds (1.5h), yum-updatesd runs once per. hour by default - # this time means we don't do interactive network checks/updates if - # yum-updatesd is running. -- metadata_expire = SecondsOption(60 * 90) -+ metadata_expire = SecondsOption(60 * 60 * 6) # 6 hours - mirrorlist_expire = SecondsOption(86400) # time in seconds (1 day) - rpm_check_debug = BoolOption(True) - disable_excludes = ListOption() diff --git a/yum-HEAD.patch b/yum-HEAD.patch deleted file mode 100644 index e7fde27..0000000 --- a/yum-HEAD.patch +++ /dev/null @@ -1,411 +0,0 @@ -diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 -index 49d98c6..25b2c7d 100644 ---- a/docs/yum.conf.5 -+++ b/docs/yum.conf.5 -@@ -134,9 +134,13 @@ an i686 package to update an i386 package. Default is `1'. - - .IP - \fBinstallonlypkgs \fR --List of packages that should only ever be installed, never updated. Kernels --in particular fall into this category. Defaults to kernel, kernel-smp, --kernel-bigmem, kernel-enterprise, kernel-debug, kernel-unsupported. -+List of package provides that should only ever be installed, never updated. -+Kernels in particular fall into this category. Defaults to kernel, -+kernel-bigmem, kernel-enterprise, kernel-smp, kernel-modules, kernel-debug, -+kernel-unsupported, kernel-source, kernel-devel, kernel-PAE, kernel-PAE-debug. -+ -+Note that because these are provides, and not just package names, kernel-devel -+will also apply to kernel-debug-devel, etc. - - .IP - \fBinstallonly_limit \fR -diff --git a/output.py b/output.py -index 3a90995..10c7442 100755 ---- a/output.py -+++ b/output.py -@@ -1882,10 +1882,12 @@ class DepSolveProgressCallBack: - msg += _('\n Not found') - return msg - -- ipkgs = set() -- for pkg in sorted(yb.rpmdb.getProvides(needname)): -+ def _run_inst_pkg(pkg, msg): - nevr = (pkg.name, pkg.epoch, pkg.version, pkg.release) -- ipkgs.add(nevr) -+ if nevr in seen_pkgs or (pkg.verEQ(last) and pkg.arch == last.arch): -+ return msg -+ -+ seen_pkgs.add(nevr) - action = _('Installed') - rmed = yb.tsInfo.getMembersWithState(pkg.pkgtup, TS_REMOVE_STATES) - if rmed: -@@ -1901,21 +1903,40 @@ class DepSolveProgressCallBack: - if rtype not in relmap: - continue - nevr = (rpkg.name, rpkg.epoch, rpkg.version, rpkg.release) -- ipkgs.add(nevr) -+ seen_pkgs.add(nevr) - msg += _msg_pkg(relmap[rtype], rpkg, needname) -+ return msg - -- last = None -- for pkg in sorted(yb.pkgSack.getProvides(needname)): -+ def _run_avail_pkg(pkg, msg): - # We don't want to see installed packages, or N packages of the - # same version, from different repos. - nevr = (pkg.name, pkg.epoch, pkg.version, pkg.release) -- if nevr in ipkgs or (pkg.verEQ(last) and pkg.arch == last.arch): -- continue -- last = pkg -+ if nevr in seen_pkgs or (pkg.verEQ(last) and pkg.arch == last.arch): -+ return False, last, msg -+ seen_pkgs.add(nevr) - action = _('Available') - if yb.tsInfo.getMembersWithState(pkg.pkgtup, TS_INSTALL_STATES): - action = _('Installing') - msg += _msg_pkg(action, pkg, needname) -+ return True, pkg, msg -+ -+ last = None -+ seen_pkgs = set() -+ for pkg in sorted(yb.rpmdb.getProvides(needname)): -+ msg = _run_inst_pkg(pkg, msg) -+ -+ available_names = set() -+ for pkg in sorted(yb.pkgSack.getProvides(needname)): -+ tst, last, msg = _run_avail_pkg(pkg, msg) -+ if tst: -+ available_names.add(pkg.name) -+ -+ last = None -+ for pkg in sorted(yb.rpmdb.searchNames(available_names)): -+ msg = _run_inst_pkg(pkg, msg) -+ last = None -+ for pkg in sorted(yb.pkgSack.searchNames(available_names)): -+ tst, last, msg = _run_avail_pkg(pkg, msg) - return msg - - def procConflict(self, name, confname): -diff --git a/yum/__init__.py b/yum/__init__.py -index 2ea9f20..3a9ef88 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -294,6 +294,11 @@ class YumBase(depsolve.Depsolve): - startupconf.syslog_facility = syslog_facility - if syslog_device != None: - startupconf.syslog_device = syslog_device -+ if releasever == '/': -+ if startupconf.installroot == '/': -+ releasever = None -+ else: -+ releasever = yum.config._getsysver("/",startupconf.distroverpkg) - if releasever != None: - startupconf.releasever = releasever - -@@ -442,7 +447,11 @@ class YumBase(depsolve.Depsolve): - @return: YumRepository instance. - ''' - repo = yumRepo.YumRepository(section) -- repo.populate(parser, section, self.conf) -+ try: -+ repo.populate(parser, section, self.conf) -+ except ValueError, e: -+ msg = _('Repository %r: Error parsing config: %s' % (section,e)) -+ raise Errors.ConfigError, msg - - # Ensure that the repo name is set - if not repo.name: -@@ -1403,7 +1412,8 @@ 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 -- -+ -+ vt_st = time.time() - self.rpmdb.dropCachedData() - self.plugins.run('preverifytrans') - for txmbr in self.tsInfo: -@@ -1489,6 +1499,7 @@ class YumBase(depsolve.Depsolve): - self.plugins.run('historyend') - self.history.end(self.rpmdb.simpleVersion(main_only=True)[0], ret) - self.rpmdb.dropCachedData() -+ self.verbose_logger.debug('VerifyTransaction time: %0.3f' % (time.time() - vt_st)) - - def costExcludePackages(self): - """ Create an excluder for repos. with higher cost. Eg. -@@ -3669,6 +3680,7 @@ class YumBase(depsolve.Depsolve): - self.logger.critical(_('%s') % e) - - if not depmatches: -+ arg = to_unicode(arg) - self.logger.critical(_('No Match for argument: %s') % arg) - else: - pkgs.extend(depmatches) -@@ -3690,6 +3702,14 @@ class YumBase(depsolve.Depsolve): - if self.conf.protected_packages and po.pkgtup == kern_pkgtup: - self.logger.warning(_("Skipping the running kernel: %s") % po) - continue -+ -+ if self.tsInfo.getMembers(po.pkgtup): -+ # This allows multiple reinstalls and update/downgrade "cancel" -+ for txmbr in self.tsInfo.matchNaevr(po.name): -+ self.logger.warning(_("Removing %s from the transaction") % -+ txmbr) -+ self.tsInfo.remove(txmbr.pkgtup) -+ # Now start the remove/reinstall - txmbr = self.tsInfo.addErase(po) - tx_return.append(txmbr) - -diff --git a/yum/history.py b/yum/history.py -index 502b908..014bdab 100644 ---- a/yum/history.py -+++ b/yum/history.py -@@ -27,7 +27,7 @@ import yum.misc as misc - import yum.constants - from yum.constants import * - from yum.packages import YumInstalledPackage, YumAvailablePackage, PackageObject --from yum.i18n import to_unicode -+from yum.i18n import to_unicode, to_utf8 - - - _history_dir = '/var/lib/yum/history' -@@ -425,12 +425,15 @@ class YumHistory: - cur = self._get_cursor() - if cur is None or not self._update_db_file_2(): - return None -+ # str(problem) doesn't work if problem contains unicode(), -+ # unicode(problem) doesn't work in python 2.4.x ... *sigh*. -+ uproblem = to_unicode(problem.__str__()) - res = executeSQL(cur, - """INSERT INTO trans_rpmdb_problems - (tid, problem, msg) - VALUES (?, ?, ?)""", (self._tid, - problem.problem, -- to_unicode(str(problem)))) -+ uproblem)) - rpid = cur.lastrowid - - if not rpid: -@@ -467,7 +470,7 @@ class YumHistory: - res = executeSQL(cur, - """INSERT INTO trans_cmdline - (tid, cmdline) -- VALUES (?, ?)""", (self._tid, cmdline)) -+ VALUES (?, ?)""", (self._tid, to_unicode(cmdline))) - return cur.lastrowid - - def beg(self, rpmdb_version, using_pkgs, txmbrs, skip_packages=[], -@@ -610,7 +613,7 @@ class YumHistory: - # open file in append - fo = open(data_fn, 'w+') - # write data -- fo.write(data) -+ fo.write(to_utf8(data)) - # flush data - fo.flush() - fo.close() -@@ -914,17 +917,19 @@ class YumHistory: - version || '-' || release || '.' || arch AS nevra - FROM trans_skip_pkgs JOIN pkgtups USING(pkgtupid) - ORDER BY name; --''', # NOTE: Old versions of sqlite don't like this next view, they are only -- # there for debugging anyway ... but it's worth remembering. -+''', # NOTE: Old versions of sqlite don't like the normal way to do the next -+ # view. So we do it with the select. It's for debugging only, so -+ # no big deal. - '''\ - \ -- CREATE VIEW vtrans_prob_pkgs AS -+ CREATE VIEW vtrans_prob_pkgs2 AS - SELECT tid,rpid,name,epoch,version,release,arch,pkgtups.pkgtupid, -- main, -+ main,problem,msg, - name || '-' || epoch || ':' || - version || '-' || release || '.' || arch AS nevra -- FROM (trans_prob_pkgs JOIN trans_rpmdb_problems USING(rpid)) -- JOIN pkgtups USING(pkgtupid) -+ FROM (SELECT * FROM trans_prob_pkgs,trans_rpmdb_problems WHERE -+ trans_prob_pkgs.rpid=trans_rpmdb_problems.rpid) -+ JOIN pkgtups USING(pkgtupid) - ORDER BY name; - '''] - -diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py -index 9cf8217..b23eabc 100644 ---- a/yum/pgpmsg.py -+++ b/yum/pgpmsg.py -@@ -1186,7 +1186,7 @@ def decode(msg) : - idx = idx + pkt_len - return pkt_list - --def decode_msg(msg) : -+def decode_msg(msg, multi=False) : - """decode_msg(msg) ==> list of OpenPGP "packet" objects - Takes an ascii-armored PGP block and returns a list of objects each of which - corresponds to a PGP "packets". -@@ -1242,11 +1242,17 @@ a PGP "certificate" includes a public key, user id(s), and signature. - pkt_idx = cert.load(pkt_list) - cert_list.append(cert) - pkt_list[0:pkt_idx] = [] -+ if not multi: -+ if not cert_list: -+ return None -+ return cert_list[0] - return cert_list - - # add the data to our buffer then - block_buf.write(l) - -+ if not multi: -+ return None - return [] - - def decode_multiple_keys(msg): -@@ -1266,7 +1272,7 @@ def decode_multiple_keys(msg): - block += '%s\n' % l - if l == '-----END PGP PUBLIC KEY BLOCK-----': - in_block = 0 -- thesecerts = decode_msg(block) -+ thesecerts = decode_msg(block, multi=True) - if thesecerts: - certs.extend(thesecerts) - block = '' -diff --git a/yumcommands.py b/yumcommands.py -index a7f5d9e..9c6fc75 100644 ---- a/yumcommands.py -+++ b/yumcommands.py -@@ -122,6 +122,25 @@ def checkShellArg(base, basecmd, extcmds): - base.usage() - raise cli.CliError - -+def checkEnabledRepo(base, possible_local_files=[]): -+ """ -+ Verify that there is at least one enabled repo. -+ -+ @param base: a YumBase object. -+ """ -+ if base.repos.listEnabled(): -+ return -+ -+ for lfile in possible_local_files: -+ if lfile.endswith(".rpm") and os.path.exists(lfile): -+ return -+ -+ msg = _('There are no enabled repos.\n' -+ ' Run "yum repolist all" to see the repos you have.\n' -+ ' You can enable repos with yum-config-manager --enable ') -+ base.logger.critical(msg) -+ raise cli.CliError -+ - class YumCommand: - - def __init__(self): -@@ -176,6 +195,7 @@ class InstallCommand(YumCommand): - checkRootUID(base) - checkGPGKey(base) - checkPackageArg(base, basecmd, extcmds) -+ checkEnabledRepo(base, extcmds) - - def doCommand(self, base, basecmd, extcmds): - self.doneCommand(base, _("Setting up Install Process")) -@@ -197,6 +217,7 @@ class UpdateCommand(YumCommand): - def doCheck(self, base, basecmd, extcmds): - checkRootUID(base) - checkGPGKey(base) -+ checkEnabledRepo(base, extcmds) - - def doCommand(self, base, basecmd, extcmds): - self.doneCommand(base, _("Setting up Update Process")) -@@ -218,6 +239,7 @@ class DistroSyncCommand(YumCommand): - def doCheck(self, base, basecmd, extcmds): - checkRootUID(base) - checkGPGKey(base) -+ checkEnabledRepo(base, extcmds) - - def doCommand(self, base, basecmd, extcmds): - self.doneCommand(base, _("Setting up Distribution Synchronization Process")) -@@ -420,6 +442,9 @@ class GroupListCommand(GroupCommand): - def getSummary(self): - return _("List available package groups") - -+ def doCheck(self, base, basecmd, extcmds): -+ checkEnabledRepo(base) -+ - def doCommand(self, base, basecmd, extcmds): - GroupCommand.doCommand(self, base, basecmd, extcmds) - return base.returnGroupLists(extcmds) -@@ -441,6 +466,7 @@ class GroupInstallCommand(GroupCommand): - checkRootUID(base) - checkGPGKey(base) - checkGroupArg(base, basecmd, extcmds) -+ checkEnabledRepo(base) - - def doCommand(self, base, basecmd, extcmds): - GroupCommand.doCommand(self, base, basecmd, extcmds) -@@ -462,6 +488,7 @@ class GroupRemoveCommand(GroupCommand): - def doCheck(self, base, basecmd, extcmds): - checkRootUID(base) - checkGroupArg(base, basecmd, extcmds) -+ checkEnabledRepo(base) - - def doCommand(self, base, basecmd, extcmds): - GroupCommand.doCommand(self, base, basecmd, extcmds) -@@ -488,6 +515,7 @@ class GroupInfoCommand(GroupCommand): - - def doCheck(self, base, basecmd, extcmds): - checkGroupArg(base, basecmd, extcmds) -+ checkEnabledRepo(base) - - def doCommand(self, base, basecmd, extcmds): - GroupCommand.doCommand(self, base, basecmd, extcmds) -@@ -511,7 +539,7 @@ class MakeCacheCommand(YumCommand): - return _("Generate the metadata cache") - - def doCheck(self, base, basecmd, extcmds): -- pass -+ checkEnabledRepo(base) - - def doCommand(self, base, basecmd, extcmds): - base.logger.debug(_("Making cache files for all metadata files.")) -@@ -554,6 +582,7 @@ class CleanCommand(YumCommand): - - def doCheck(self, base, basecmd, extcmds): - checkCleanArg(base, basecmd, extcmds) -+ checkEnabledRepo(base) - - def doCommand(self, base, basecmd, extcmds): - base.conf.cache = 1 -@@ -592,6 +621,9 @@ class CheckUpdateCommand(YumCommand): - def getSummary(self): - return _("Check for available package updates") - -+ def doCheck(self, base, basecmd, extcmds): -+ checkEnabledRepo(base) -+ - def doCommand(self, base, basecmd, extcmds): - base.extcmds.insert(0, 'updates') - result = 0 -@@ -668,6 +700,7 @@ class UpgradeCommand(YumCommand): - def doCheck(self, base, basecmd, extcmds): - checkRootUID(base) - checkGPGKey(base) -+ checkEnabledRepo(base, extcmds) - - def doCommand(self, base, basecmd, extcmds): - base.conf.obsoletes = 1 -@@ -1104,6 +1137,7 @@ class ReInstallCommand(YumCommand): - checkRootUID(base) - checkGPGKey(base) - checkPackageArg(base, basecmd, extcmds) -+ checkEnabledRepo(base, extcmds) - - def doCommand(self, base, basecmd, extcmds): - self.doneCommand(base, _("Setting up Reinstall Process")) -@@ -1130,6 +1164,7 @@ class DowngradeCommand(YumCommand): - checkRootUID(base) - checkGPGKey(base) - checkPackageArg(base, basecmd, extcmds) -+ checkEnabledRepo(base, extcmds) - - def doCommand(self, base, basecmd, extcmds): - self.doneCommand(base, _("Setting up Downgrade Process")) diff --git a/yum-PK-auto-close-fix.patch b/yum-PK-auto-close-fix.patch deleted file mode 100644 index e6dfc81..0000000 --- a/yum-PK-auto-close-fix.patch +++ /dev/null @@ -1,39 +0,0 @@ -commit 3e05536ef876fc761553b632495449fd96bb4b9e -Author: James Antill -Date: Tue Sep 14 09:48:23 2010 -0400 - - Can't keep ts around, due to rpmdb.auto_close. BZ 622179. - This kind of sucks as we have to remember in all future code not to - keep a ts over any .rpmdb call, it's even better because almost nobody - will hit it. It works though, and is simple. - - We could maybe fix this "better" by using a weakref in rpmdb, and doing - it that way. Or having some manual way to mark auto_close as off. Or - just rm'ing auto_close as a bad idea. - -diff --git a/yum/__init__.py b/yum/__init__.py -index b5e9213..5c689e5 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -4301,12 +4301,11 @@ class YumBase(depsolve.Depsolve): - keyurls = repo.gpgkey - key_installed = False - -- ts = self.rpmdb.readOnlyTS() -- - for keyurl in keyurls: - keys = self._retrievePublicKey(keyurl, repo) - - for info in keys: -+ ts = self.rpmdb.readOnlyTS() - # Check if key is already installed - if misc.keyInstalled(ts, info['keyid'], info['timestamp']) >= 0: - self.logger.info(_('GPG key at %s (0x%s) is already installed') % ( -@@ -4331,6 +4330,7 @@ class YumBase(depsolve.Depsolve): - raise Errors.YumBaseError, _("Not installing key") - - # Import the key -+ ts = self.rpmdb.readOnlyTS() - result = ts.pgpImportPubkey(misc.procgpgkey(info['raw_key'])) - if result != 0: - raise Errors.YumBaseError, \ diff --git a/yum-close-rpmdb-really.patch b/yum-close-rpmdb-really.patch deleted file mode 100644 index 54b3f6e..0000000 --- a/yum-close-rpmdb-really.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/yum/__init__.py b/yum/__init__.py -index 6378cdc..cc57e98 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -427,6 +427,9 @@ class YumBase(depsolve.Depsolve): - - def closeRpmDB(self): - """closes down the instances of the rpmdb we have wangling around""" -+ if self._rpmdb is not None: -+ self._rpmdb.ts = None -+ self._rpmdb.dropCachedData() - self._rpmdb = None - self._ts = None - self._tsInfo = None -@@ -1008,6 +1011,7 @@ class YumBase(depsolve.Depsolve): - # for any kind of install add from_repo to the yumdb, and the cmdline - # and the install reason - -+ self.rpmdb.dropCachedData() - for txmbr in self.tsInfo: - if txmbr.output_state in TS_INSTALL_STATES: - if not self.rpmdb.contains(po=txmbr.po): -@@ -1037,7 +1041,7 @@ class YumBase(depsolve.Depsolve): - else: - self.verbose_logger.log(logginglevels.DEBUG_2, 'What is this? %s' % txmbr.po) - -- -+ self.rpmdb.dropCachedData() - - def costExcludePackages(self): - """exclude packages if they have an identical package in another repo - -diff --git a/yum/rpmsack.py b/yum/rpmsack.py -index 5189b18..8556e9a 100644 ---- a/yum/rpmsack.py -+++ b/yum/rpmsack.py -@@ -140,7 +140,10 @@ class RPMDBPackageSack(PackageSackBase): - self._simple_pkgtup_list = [] - self._get_pro_cache = {} - self._get_req_cache = {} -- misc.unshare_data() -+ # We can be called on python shutdown (due to yb.__del__), at which -+ # point other modules might not be available. -+ if misc is not None: -+ misc.unshare_data() - self._cache = { - 'provides' : { }, - 'requires' : { }, diff --git a/yum-do-not-overwrite-keys.patch b/yum-do-not-overwrite-keys.patch deleted file mode 100644 index 7280f90..0000000 --- a/yum-do-not-overwrite-keys.patch +++ /dev/null @@ -1,39 +0,0 @@ -commit 11dfde5e065e21c5bdb25a087501b90afe0b0dab -Author: Seth Vidal -Date: Tue Mar 23 10:09:20 2010 -0400 - - make sure we aren't overwriting the value of 'keys' - - this determines how many args we pass back in our yielded results - never noticed it b/c nothing in yum uses keys=True - but it broke PK - -diff --git a/yum/__init__.py b/yum/__init__.py -index ea73549..0aaa819 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -2163,10 +2163,10 @@ class YumBase(depsolve.Depsolve): - - # do the ones we already have - for item in sorted_lists.values(): -- for pkg, keys, values in item: -+ for pkg, k, v in item: - if pkg not in results_by_pkg: - results_by_pkg[pkg] = [] -- results_by_pkg[pkg].append((keys,values)) -+ results_by_pkg[pkg].append((k,v)) - - # take our existing dict-by-pkg and make the dict-by-count for - # this bizarro sorted_lists format -@@ -2175,9 +2175,9 @@ class YumBase(depsolve.Depsolve): - for pkg in results_by_pkg: - totkeys = [] - totvals = [] -- for (keys, values) in results_by_pkg[pkg]: -- totkeys.extend(keys) -- totvals.extend(values) -+ for (k, v) in results_by_pkg[pkg]: -+ totkeys.extend(k) -+ totvals.extend(v) - - totkeys = misc.unique(totkeys) - totvals = misc.unique(totvals) diff --git a/yum-fix-skip-broken-with-post-depsolve-change.patch b/yum-fix-skip-broken-with-post-depsolve-change.patch deleted file mode 100644 index 97f8d5b..0000000 --- a/yum-fix-skip-broken-with-post-depsolve-change.patch +++ /dev/null @@ -1,67 +0,0 @@ -commit 359ae828b915101116bb57fbe2645eae056c158b -Author: Tim Lauridsen -Date: Tue Mar 2 16:47:45 2010 +0100 - - Make skipbroken run again if packages has been added to transaction by a postresolve plugin - -diff --git a/yum/__init__.py b/yum/__init__.py -index f21001d..69af7ba 100644 ---- a/yum/__init__.py -+++ b/yum/__init__.py -@@ -866,20 +866,16 @@ class YumBase(depsolve.Depsolve): - # works for downloads / mirror failover etc. - self.rpmdb.ts = None - -- # if depsolve failed and skipbroken is enabled -- # The remove the broken packages from the transactions and -- # Try another depsolve -- if self.conf.skip_broken and rescode==1: -- self.skipped_packages = [] # reset the public list of skipped packages. -- sb_st = time.time() -- rescode, restring = self._skipPackagesWithProblems(rescode, restring) -- self._printTransaction() -- self.verbose_logger.debug('Skip-Broken time: %0.3f' % (time.time() - sb_st)) -+ # do the skip broken magic, if enabled and problems exist -+ (rescode, restring) = self._doSkipBroken(rescode, restring) - - self.plugins.run('postresolve', rescode=rescode, restring=restring) - - if self.tsInfo.changed: - (rescode, restring) = self.resolveDeps(rescode == 1) -+ # If transaction was changed by postresolve plugins then we should run skipbroken again -+ (rescode, restring) = self._doSkipBroken(rescode, restring, clear_skipped=False ) -+ - if self.tsInfo.pkgSack is not None: # rm Transactions don't have pkgSack - self.tsInfo.pkgSack.dropCachedData() - self.rpmdb.dropCachedData() -@@ -887,6 +883,21 @@ class YumBase(depsolve.Depsolve): - self.verbose_logger.debug('Depsolve time: %0.3f' % (time.time() - ds_st)) - return rescode, restring - -+ def _doSkipBroken(self,rescode, restring, clear_skipped=True): -+ ''' do skip broken if it is enabled ''' -+ # if depsolve failed and skipbroken is enabled -+ # The remove the broken packages from the transactions and -+ # Try another depsolve -+ if self.conf.skip_broken and rescode==1: -+ if clear_skipped: -+ self.skipped_packages = [] # reset the public list of skipped packages. -+ sb_st = time.time() -+ rescode, restring = self._skipPackagesWithProblems(rescode, restring) -+ self._printTransaction() -+ self.verbose_logger.debug('Skip-Broken time: %0.3f' % (time.time() - sb_st)) -+ return (rescode, restring) -+ -+ - def _skipPackagesWithProblems(self, rescode, restring): - ''' Remove the packages with depsolve errors and depsolve again ''' - -@@ -983,7 +994,7 @@ class YumBase(depsolve.Depsolve): - for po in skipped_list: - msg = _(" %s from %s") % (str(po),po.repo.id) - self.verbose_logger.info(msg) -- self.skipped_packages = skipped_list # make the skipped packages public -+ self.skipped_packages.extend(skipped_list) # make the skipped packages public - else: - # If we cant solve the problems the show the original error messages. - self.verbose_logger.info("Skip-broken could not solve problems") diff --git a/yum-manpage-files.patch b/yum-manpage-files.patch deleted file mode 100644 index f688725..0000000 --- a/yum-manpage-files.patch +++ /dev/null @@ -1,83 +0,0 @@ -commit 102915d4d402493c48d434ae1d1756225c4468e0 -Author: James Antill -Date: Mon Jun 14 01:15:21 2010 -0400 - - Port manpage files path fixups. - -diff --git a/docs/yum.8 b/docs/yum.8 -index d5ede0a..3bdb408 100644 ---- a/docs/yum.8 -+++ b/docs/yum.8 -@@ -568,7 +568,7 @@ option in yum.conf. For a plugin to work, the following conditions must be met: - 1. The plugin module file must be installed in the plugin path as just - described. - .LP --2. The global \fBplugins\fP option in /etc/yum/yum.conf must be set to `1'. -+2. The global \fBplugins\fP option in /etc/yum.conf must be set to `1'. - .LP - 3. A configuration file for the plugin must exist in - /etc/yum/pluginconf.d/.conf and the \fBenabled\fR setting in this -@@ -584,9 +584,9 @@ configuration options. - .PP - .SH "FILES" - .nf --/etc/yum/yum.conf -+/etc/yum.conf - /etc/yum/version-groups.conf --/etc/yum/repos.d/ -+/etc/yum.repos.d/ - /etc/yum/pluginconf.d/ - /var/cache/yum/ - .fi -diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 -index ca36103..42815b9 100644 ---- a/docs/yum.conf.5 -+++ b/docs/yum.conf.5 -@@ -4,10 +4,10 @@ - \fByum.conf\fR \- Configuration file for \fByum(8)\fR. - .SH "DESCRIPTION" - .LP --Yum uses a configuration file at \fB/etc/yum/yum.conf\fR. -+Yum uses a configuration file at \fB/etc/yum.conf\fR. - .LP - Additional configuration files are also read from the directories set by the --\fBreposdir\fR option (default is `/etc/yum/repos.d'). -+\fBreposdir\fR option (default is `/etc/yum.repos.d'). - See the \fBreposdir\fR option below for further details. - - .SH "PARAMETERS" -@@ -42,10 +42,10 @@ of headers and packages after successful installation. Default is '1' - .IP - \fBreposdir\fR - A list of directories where yum should look for .repo files which define --repositories to use. Default is `/etc/yum/repos.d'. Each -+repositories to use. Default is `/etc/yum.repos.d'. Each - file in this directory should contain one or more repository sections as - documented in \fB[repository] options\fR below. These will be merged with the --repositories defined in /etc/yum/yum.conf to form the complete set of -+repositories defined in /etc/yum.conf to form the complete set of - repositories that yum will use. - - .IP -@@ -745,8 +745,8 @@ for any given command. Defaults to False. - - .SH "URL INCLUDE SYNTAX" - .LP --The inclusion of external configuration files is supported for /etc/yum/yum.conf --and the .repo files in the /etc/yum/repos.d directory. To include a URL, use a -+The inclusion of external configuration files is supported for /etc/yum.conf -+and the .repo files in the /etc/yum.repos.d directory. To include a URL, use a - line of the following format: - - include=url://to/some/location -@@ -812,8 +812,8 @@ data in any value. - - .SH "FILES" - .nf --/etc/yum/yum.conf --/etc/yum/repos.d/ -+/etc/yum.conf -+/etc/yum.repos.d/ - /etc/yum/pluginconf.d/ - /etc/yum/protected.d - /etc/yum/vars diff --git a/yum-mirror-priority.patch b/yum-mirror-priority.patch deleted file mode 100644 index 259a365..0000000 --- a/yum-mirror-priority.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- yum/config.py~ 2008-03-04 16:21:49.000000000 -0500 -+++ yum/config.py 2008-03-04 16:21:49.000000000 -0500 -@@ -582,7 +582,7 @@ - - commands = ListOption() - exclude = ListOption() -- failovermethod = Option('roundrobin') -+ failovermethod = Option('priority') - proxy = UrlOption(schemes=('http', 'ftp', 'https'), allow_none=True) - proxy_username = Option() - proxy_password = Option() diff --git a/yum-multilib-policy-best.patch b/yum-multilib-policy-best.patch deleted file mode 100644 index 065047b..0000000 --- a/yum-multilib-policy-best.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- yum/config.py~ 2009-10-14 15:52:38.000000000 -0400 -+++ yum/config.py 2009-10-14 15:59:57.000000000 -0400 -@@ -670,7 +670,7 @@ - # similar but better :). - mdpolicy = ListOption(['group:primary']) - # ('instant', 'group:all', 'group:main', 'group:small', 'group:primary')) -- multilib_policy = SelectionOption('all',('best', 'all')) -+ multilib_policy = SelectionOption('best',('best', 'all')) - # all == install any/all arches you can - # best == use the 'best arch' for the system - diff --git a/yum-updatesd.conf.fedora b/yum-updatesd.conf.fedora deleted file mode 100644 index 2088753..0000000 --- a/yum-updatesd.conf.fedora +++ /dev/null @@ -1,15 +0,0 @@ -[main] -# how often to check for new updates (in seconds) -run_interval = 3600 -# how often to allow checking on request (in seconds) -updaterefresh = 600 - -# how to send notifications (valid: dbus, email, syslog) -emit_via = dbus - -# automatically install updates -do_update = no -# automatically download updates -do_download = no -# automatically download deps of updates -do_download_deps = no diff --git a/yum.conf.fedora b/yum.conf.fedora deleted file mode 100644 index f43aa06..0000000 --- a/yum.conf.fedora +++ /dev/null @@ -1,24 +0,0 @@ -[main] -cachedir=/var/cache/yum/$basearch/$releasever -keepcache=0 -debuglevel=2 -logfile=/var/log/yum.log -exactarch=1 -obsoletes=1 -gpgcheck=1 -plugins=1 -installonly_limit=3 -color=never - -# This is the default, if you make this bigger yum won't see if the metadata -# is newer on the remote and so you'll "gain" the bandwidth of not having to -# download the new metadata and "pay" for it by yum not having correct -# information. -# It is esp. important, to have correct metadata, for distributions like -# Fedora which don't keep old packages around. If you don't like this checking -# interupting your command line usage, it's much better to have something -# manually check the metadata once an hour (yum-updatesd will do this). -# metadata_expire=90m - -# PUT YOUR REPOS HERE OR IN separate files named file.repo -# in /etc/yum.repos.d diff --git a/yum.spec b/yum.spec deleted file mode 100644 index 1a85961..0000000 --- a/yum.spec +++ /dev/null @@ -1,495 +0,0 @@ -%{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} - -Summary: RPM installer/updater -Name: yum -Version: 3.2.28 -Release: 5%{?dist} -License: GPLv2+ -Group: System Environment/Base -Source0: http://yum.baseurl.org/download/3.2/%{name}-%{version}.tar.gz -Source1: yum.conf.fedora -Source2: yum-updatesd.conf.fedora -Patch0: installonlyn-enable.patch -Patch1: yum-mirror-priority.patch -Patch3: yum-multilib-policy-best.patch -Patch4: no-more-exactarchlist.patch -Patch5: geode-arch.patch -Patch6: yum-HEAD.patch -Patch7: yum-PK-auto-close-fix.patch - -Patch20: yum-manpage-files.patch - -URL: http://yum.baseurl.org/ -BuildArch: noarch -BuildRequires: python -BuildRequires: gettext -BuildRequires: intltool -Conflicts: pirut < 1.1.4 -Requires: python >= 2.4, rpm-python, rpm >= 0:4.4.2 -Requires: python-iniparse -Requires: python-sqlite -Requires: python-urlgrabber >= 3.9.0-8 -Requires: yum-metadata-parser >= 1.1.0 -Requires: pygpgme -Obsoletes: yum-skip-broken <= 1.1.18 -Obsoletes: yum-basearchonly <= 1.1.9 -Obsoletes: yum-allow-downgrade < 1.1.20-0 -Obsoletes: yum-plugin-allow-downgrade < 1.1.22-0 -Obsoletes: yum-plugin-protect-packages < 1.1.27-0 -Obsoletes: yum-plugin-download-order <= 0.2-2 -Provides: yum-skip-broken -Provides: yum-basearchonly -Provides: yum-allow-downgrade -Provides: yum-plugin-allow-downgrade -Provides: yum-protect-packages -Provides: yum-plugin-protect-packages -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) - -%description -Yum is a utility that can check for and automatically download and -install updated RPM packages. Dependencies are obtained and downloaded -automatically, prompting the user for permission as necessary. - -%package updatesd -Summary: Update notification daemon -Group: Applications/System -Requires: yum = %{version}-%{release} -Requires: dbus-python -Requires: pygobject2 -Requires(preun): /sbin/chkconfig -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/service -Requires(post): /sbin/service - -%description updatesd -yum-updatesd provides a daemon which checks for available updates and -can notify you when they are available via email, syslog or dbus. - -%prep -%setup -q -%patch1 -p0 -%patch3 -p0 -%patch4 -p0 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch20 -p1 - -%build -make - -%install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install -install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/yum.conf -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d $RPM_BUILD_ROOT/usr/lib/yum-plugins - -# for now, move repodir/yum.conf back -mv $RPM_BUILD_ROOT/%{_sysconfdir}/yum/repos.d $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d -rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/yum/yum.conf - -# yum-updatesd has moved to the separate source version -rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/yum/yum-updatesd.conf -rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/yum-updatesd -rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/dbus-1/system.d/yum-updatesd.conf -rm -f $RPM_BUILD_ROOT/%{_sbindir}/yum-updatesd -rm -f $RPM_BUILD_ROOT/%{_mandir}/man*/yum-updatesd* -rm -f $RPM_BUILD_ROOT/%{_datadir}/yum-cli/yumupd.py* - -# Ghost files: -mkdir -p $RPM_BUILD_ROOT/var/lib/yum/history -mkdir -p $RPM_BUILD_ROOT/var/lib/yum/plugins -mkdir -p $RPM_BUILD_ROOT/var/lib/yum/yumdb -touch $RPM_BUILD_ROOT/var/lib/yum/uuid - -%find_lang %name - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -f %{name}.lang -%defattr(-, root, root, -) -%doc README AUTHORS COPYING TODO INSTALL ChangeLog -%config(noreplace) %{_sysconfdir}/yum.conf -%dir %{_sysconfdir}/yum -%config(noreplace) %{_sysconfdir}/yum/version-groups.conf -%dir %{_sysconfdir}/yum/protected.d -%dir %{_sysconfdir}/yum.repos.d -%dir %{_sysconfdir}/yum/vars -%config(noreplace) %{_sysconfdir}/logrotate.d/yum -%{_sysconfdir}/bash_completion.d -%dir %{_datadir}/yum-cli -%{_datadir}/yum-cli/* -%{_bindir}/yum -%{python_sitelib}/yum -%{python_sitelib}/rpmUtils -%dir /var/cache/yum -%dir /var/lib/yum -%ghost /var/lib/yum/uuid -%ghost /var/lib/yum/history -%ghost /var/lib/yum/plugins -%ghost /var/lib/yum/yumdb -%{_mandir}/man*/yum.* -%{_mandir}/man*/yum-shell* -# plugin stuff -%dir %{_sysconfdir}/yum/pluginconf.d -%dir /usr/lib/yum-plugins - -%changelog -* Tue Oct 5 2010 Seth Vidal - 3.2.28-5 -- bumping to 3.2.28-5 so f12 doesn't have a higher version -- bug # 640181 - -* Tue Sep 14 2010 James Antill - 3.2.28-4 -- Fix auto-close bug with GPG key installs. -- Resolves: bug#622179 - -* Fri Aug 27 2010 Seth Vidal -- obsoleted yum-plugin-download-order - -* Thu Aug 12 2010 Seth Vidal - 3.2.28-3 -- latest head -- fix gpg key import -- more unicode fixes -- output slightly more clear depsovling error msgs -- clean up some oddballness in this spec file - -* Mon Aug 9 2010 Seth Vidal - 3.2.28-2 -- update to HEAD -- fixes a number of unicide issues - -* Fri Jul 30 2010 Seth Vidal - 3.2.28-1 -- bump to 3.2.28 -- add manpage patch - -* Mon May 3 2010 Seth Vidal - 3.2.27-4 -- add patch to not add a duplicate chroot path - fixes yumdb and history - from anaconda installs -- add obsoletes/provides specificity from rawhide spec - -* Thu Apr 8 2010 Seth Vidal - 3.2.27-3 -- fix regets on metadata when we run into an old file that's larger - than the new one -* Tue Mar 23 2010 Seth Vidal - 3.2.27-2 -- broke searching in PK, this patch fixes it. - -* Thu Mar 18 2010 Seth Vidal - 3.2.27-1 -- 3.2.27 from upstream (more or less the same as 3.2.26-6 but with a new number - -* Thu Mar 11 2010 Seth Vidal - 3.2.26-6 -- should be the final HEAD update before 3.2.27 - -* Thu Feb 24 2010 James Antill - 3.2.26-5 -- new HEAD, minor features and speed. - -* Wed Feb 17 2010 Seth Vidal - 3.2.26-4 -- new HEAD to fix the fix to the fix - -* Tue Feb 16 2010 Seth Vidal - 3.2.26-3 -- latest head - including fixes to searchPrcos - -* Wed Feb 10 2010 Seth Vidal - 3.2.26-2 -- grumble. - -* Tue Feb 9 2010 Seth Vidal - 3.2.26-1 -- final 3.2.26 - -* Mon Feb 8 2010 Seth Vidal - 3.2.25-14 -- $uuid, pkgtags searching, latest HEAD patch - pre 3.2.26 - -* Fri Jan 28 2010 James Antill - 3.2.25-13 -- A couple of bugfixes, most notably: -- you can now install gpg keys again! -- bad installed file requires don't get cached. - -* Fri Jan 22 2010 Seth Vidal - 3.2.25-12 -- someone forgot to push their changes - -* Fri Jan 22 2010 Seth Vidal - 3.2.25-11 -- more fixes, more fun - -* Fri Jan 15 2010 James Antill - 3.2.25-10 -- latest head -- Fixes for pungi, rpmdb caching and kernel-PAE-devel duplicates finding -- among others. - -* Mon Jan 4 2010 Seth Vidal - 3.2.25-8 -- latest head - -* Thu Dec 10 2009 James Antill - 3.2.25-7 -- Fixes the mash bug, lookup in the tsInfo too. :( -- And fix the txmbr/po confusion ... third build the charm. - -* Fri Dec 4 2009 James Antill - 3.2.25-4 -- Fixes for yum clean all, BZ 544173 -- Also allow "yum clean rpmdb" to work, bad tester, bad. - -* Thu Dec 3 2009 Seth Vidal - 3.2.25-2 -- rebuild yum with latest HEAD patch -- add rpmdb caching patch james wrote to see if it breaks everyone :) - - -* Wed Oct 14 2009 Seth Vidal - 3.2.25-1 -- 3.2.25 - -* Wed Sep 30 2009 Seth Vidal - 3.2.24-9 -- revert yum. import patch b/c it breaks a bunch of things - -* Wed Sep 30 2009 Seth Vidal - 3.2.24-8 -- fix up broken build b/c of version-groups.conf file - -* Tue Sep 29 2009 Seth Vidal - 3.2.24-7 -- fixes for odd outputs from ts.run and logs for what we store in history - -* Wed Sep 23 2009 Seth Vidal - 3.2.24-6 -- new head patch - fixes some issues with history and chroots - -* Mon Sep 21 2009 Seth Vidal - 3.2.24-5 -- latest head patch - includes yum history feature. - -* Tue Sep 15 2009 Seth Vidal - 3.2.24-4 -- new head patch - translation updates and a few bug fixes - -* Wed Sep 9 2009 Seth Vidal - 3.2.24-3 -- add geode arch patch for https://bugzilla.redhat.com/show_bug.cgi?id=518415 - - -* Thu Sep 3 2009 Seth Vidal - 3.2.24-2 -- modify cachedir to include variables - -* Thu Sep 3 2009 Seth Vidal - 3.2.24-1 -- 3.2.24 - -* Wed Sep 2 2009 Seth Vidal - 3.2.23-16 -- fix globbing issue 520810 - -* Mon Aug 31 2009 Seth Vidal - 3.2.23-15 -- one more head update - fixes some fairly ugly but kind of minor bugs - -* Tue Aug 18 2009 Seth Vidal - 3.2.23-14 -- update to latest head pre 3.2.24 -- add requirement on python-urlgrabber 3.9.0 and up - -* Wed Aug 5 2009 Seth Vidal - 3.2.23-13 -- latest head - right after freeze - -* Tue Aug 4 2009 Seth Vidal - 3.2.23-12 -- latest head - right before freeze :) - -* Mon Jul 27 2009 Fedora Release Engineering - 3.2.23-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild - -* Wed Jul 22 2009 Seth Vidal - 3.2.23-10 -- remove exactarchlist by request for rawhide - -* Thu Jul 2 2009 Seth Vidal - 3.2.23-9 -- update to latest head - make livecd creation work again in rawhide -- disable one of the man page patches until after 3.2.24 is released b/c - of the changes to the man page in the head patch - - -* Mon Jun 22 2009 James Antill - 3.2.23-8 -- Update to latest head: -- Fix old recursion bug, found by new code. -- Resolves: bug#507220 - -* Sun Jun 21 2009 James Antill - 3.2.23-6 -- Update to latest head: -- Unbreak delPackage() excludes. -- Other fixes/etc. - -* Fri Jun 19 2009 James Antill - 3.2.23-5 -- Actually apply the HEAD patch included yesterday :). - -* Thu Jun 18 2009 Seth Vidal - 3.2.23-4 -- update to latest head - -* Mon Jun 8 2009 Seth Vidal -- truncate changelog - -* Wed May 20 2009 Seth Vidal - 3.2.23-2 -- add patch to close rpmdb completely - -* Tue May 19 2009 Seth Vidal - 3.2.23-1 -- 3.2.23 - -* Mon May 11 2009 Seth Vidal - 3.2.22-5 -- jump up to almost 3.2.23. -- had to move patch0 around a bit until we rebase to 3.2.23 - -* Thu Apr 9 2009 James Antill - 3.2.22-4 -- fix typo for yum-complete-transaction message. - -* Wed Apr 8 2009 Seth Vidal - 3.2.22-3 -- fix for file:// urls which makes things in pungi/mash work - -* Tue Apr 7 2009 Seth Vidal - 3.2.22-2 -- yum-HEAD minus the yumdb patches - -* Tue Mar 24 2009 Seth Vidal - 3.2.22-1 -- 3.2.22 - 3 patches beyond 3.2.21-16 - -* Mon Mar 16 2009 Seth Vidal - 3.2.21-16 -- fix for 490490 - -* Fri Mar 13 2009 Seth Vidal - 3.2.21-15 -- update to upstream git to fix conditionals problem on anaconda installs - -* Thu Mar 12 2009 Seth Vidal - 3.2.21-14 -- latest HEAD - -* Tue Mar 10 2009 Seth Vidal - 3.2.21-13 -- f11beta build - -* Wed Mar 4 2009 Seth Vidal - 3.2.21-12 -- second verse, same as the first - -* Fri Feb 27 2009 Seth Vidal - 3.2.21-10 -- merge up a lot of fixes from latest HEAD - -* Wed Feb 25 2009 Fedora Release Engineering - 3.2.21-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild - -* Tue Feb 10 2009 Seth Vidal - 3.2.21-9 -- merge up to latest yum head - sort of a pre 3.2.22 - -* Wed Feb 4 2009 Seth Vidal - 3.2.21-8 -- fix for YumHeaderPackages so it plays nicely w/createrepo and mergerepo, etc - -* Thu Jan 29 2009 Seth Vidal - 3.2.21-7 -- update HEAD patch to fix repodiff (and EVR comparisons in certain cases) - -* Tue Jan 27 2009 Seth Vidal - 3.2.21-6 -- patch to keep anaconda (and other callers) happy -- remove old 6hr patch which is now upstream - -* Mon Jan 26 2009 Seth Vidal - 3.2.21-4 -- patch to latest HEAD to test a number of fixes for alpha - -* Tue Jan 20 2009 Seth Vidal - 3.2.21-3 -- add a small patch to make things play a bit nicer with the logging module - in 2.6 - - -* Wed Jan 7 2009 Seth Vidal - 3.2.21-1 -- bump to 3.2.21 - -* Thu Dec 18 2008 James Antill - 3.2.20-8 -- merge latest from upstream -- move to 6hr metadata - -* Mon Dec 8 2008 Seth Vidal - 3.2.20-7 -- merge patch from upstream and remove now old obsoletes patch - -* Thu Dec 04 2008 Jesse Keating - 3.2.20-6 -- Add patch from upstream to fix cases where obsoletes are disabled. (jantill) - -* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 3.2.20-5 -- Rebuild for Python 2.6 - -* Wed Nov 26 2008 Seth Vidal - 3.2.20-4 -- update head patch - -* Wed Oct 29 2008 Seth Vidal - 3.2.20-3 -- full patch against HEAD for skipbroken fixes (among others) - -* Mon Oct 27 2008 James Antill - 3.2.20-2 -- Fix listTransaction for skipped packages. - -* Mon Oct 27 2008 Seth Vidal - 3.2.20-1 -- 3.2.20 - -* Thu Oct 23 2008 Seth Vidal - 3.2.19-6 -- update HEAD patch - -* Wed Oct 15 2008 Seth Vidal - 3.2.19-5 -- rebase against 3.2.X HEAD - -* Tue Oct 14 2008 Seth Vidal - 3.2.19-4 -- pull patch from git to bring us up to current(ish) - -* Wed Sep 3 2008 Seth Vidal - 3.2.19-3 -- add patch to fix yum install name.arch matching - -* Thu Aug 28 2008 Seth Vidal - 3.2.19-2 -- add patch to fix mash's parser use. - -* Wed Aug 27 2008 Seth Vidal - 3.2.19-1 -- 3.2.19 - -* Thu Aug 7 2008 Seth Vidal - 3.2.18-1 -- 3.2.18 - -* Wed Jul 10 2008 Seth Vidal - 3.2.17-2 -- add patch from upstream for bug in compare_providers - -* Wed Jul 9 2008 Seth Vidal - 3.2.17-1 -- 3.2.17 - -* Tue Jun 24 2008 Jesse Keating - 3.2.16-4 -- Add a couple more upstream patches for even more multilib fixes - -* Tue Jun 24 2008 Jesse Keating - 3.2.16-3 -- Add another patch from upstream for multilib policy and noarch - -* Sun May 18 2008 Seth Vidal 3.2.16-2 -- stupid, stupid, stupid - - -* Fri May 16 2008 Seth Vidal 3.2.16-1 -- 3.2.16 - -* Tue Apr 15 2008 Seth Vidal 3.2.14-9 -- nine is the luckiest number that there will ever be - -* Tue Apr 15 2008 Seth Vidal 3.2.14-8 -- after many tries - this one fixes translations AND pungi - -* Thu Apr 10 2008 Seth Vidal 3.2.14-5 -- once more, with feeling - -* Thu Apr 10 2008 Seth Vidal 3.2.14-4 -- another big-head-patch - -* Wed Apr 9 2008 Seth Vidal 3.2.14-3 -- apply patch to bring this up to where HEAD is now. - -* Tue Apr 8 2008 Seth Vidal 3.2.14-1 -- remove committed patch -- obsoletes yum-basearchonly - -* Tue Apr 1 2008 Seth Vidal 3.2.13-2 -- fix minor typo in comps.py for jkeating - -* Thu Mar 20 2008 Seth Vidal 3.2.13-1 -- 3.2.13 - -* Mon Mar 17 2008 Seth Vidal 3.2.12-5 -- update manpage patch to close bug 437703. Thakns to Kulbir Saini for the patch - - -* Fri Mar 14 2008 Seth Vidal 3.2.12-4 -- multilib_policy=best is now the default - -* Thu Mar 13 2008 Seth Vidal -- add jeff sheltren's patch to close rh bug 428825 - -* Tue Mar 4 2008 Seth Vidal 3.2.12-3 -- set failovermethod to 'priority' to make jkeating happy - -* Tue Mar 4 2008 Seth Vidal 3.2.12-2 -- fix mutually obsoleting providers (like glibc!) - -* Mon Mar 3 2008 Seth Vidal - 3.2.12-1 -- 3.2.12 - -* Fri Feb 8 2008 Seth Vidal - 3.2.11-1 -- 3.2.11 - -* Sun Jan 27 2008 James Bowes 3.2.10-3 -- Remove yumupd.py - -* Fri Jan 25 2008 Seth Vidal - 3.2.10-1 -- 3.2.10 -- add pygpgme dep -