From 562dcdf440108a189599aa607de765c9e848984a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Wed, 8 Aug 2012 18:14:19 +0200 Subject: [PATCH 01/55] Use package downloader from Yum. --- yum-utils-HEAD.patch | 530 ++++++++++++++++++++++++++++++++++++------- yum-utils.spec | 6 +- 2 files changed, 455 insertions(+), 81 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index b11b308..e2a7991 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -695,7 +695,7 @@ index 0578295..aac29ea 100644 import sys diff --git a/needs-restarting.py b/needs-restarting.py -index 6bc883f..0b54e63 100755 +index 6bc883f..a6946b0 100755 --- a/needs-restarting.py +++ b/needs-restarting.py @@ -8,11 +8,11 @@ @@ -721,11 +721,19 @@ index 6bc883f..0b54e63 100755 import glob import stat from optparse import OptionParser -@@ -82,12 +83,12 @@ def get_open_files(pid): +@@ -76,18 +77,18 @@ def get_open_files(pid): + files = [] + smaps = '/proc/%s/smaps' % pid + try: +- maps = open(smaps, 'r') ++ maps = open(smaps, 'r').readlines() + except (IOError, OSError), e: + print "Could not open %s" % smaps return files - for line in maps.readlines(): +- for line in maps.readlines(): - if line.find('fd:') == -1: ++ for line in maps: + slash = line.find('/') + if slash == -1 or line.find('00:') != -1: # if we don't have a '/' or if we fine 00: in the file then it's not _REALLY_ a file continue @@ -886,6 +894,19 @@ index 4794369..aebae67 100755 if issues: sys.exit(1) +diff --git a/plugins/aliases/aliases.py b/plugins/aliases/aliases.py +index 5cb08a1..9277c9b 100644 +--- a/plugins/aliases/aliases.py ++++ b/plugins/aliases/aliases.py +@@ -44,7 +44,7 @@ class AliasedCommand: + + def doCheck(self, base, basecmd, extcmds): + if recursive: # shouldn't happen +- raise PluginYumExit('And error has occured for %s, please create a bug report') ++ raise PluginYumExit('And error has occurred for %s, please create a bug report') + + raise PluginYumExit('%s is an alias not a command, however recursive processing is turned off') + doCommand = doCheck diff --git a/plugins/auto-update-debuginfo/auto-update-debuginfo.py b/plugins/auto-update-debuginfo/auto-update-debuginfo.py index 39993ad..9ff927c 100644 --- a/plugins/auto-update-debuginfo/auto-update-debuginfo.py @@ -899,6 +920,32 @@ index 39993ad..9ff927c 100644 for opt, repoexp in opts.repos: if opt == '--disablerepo': mdrs.add(repoexp) +diff --git a/plugins/fedorakmod/fedorakmod.py b/plugins/fedorakmod/fedorakmod.py +index b3aed61..82a43d5 100644 +--- a/plugins/fedorakmod/fedorakmod.py ++++ b/plugins/fedorakmod/fedorakmod.py +@@ -37,7 +37,7 @@ kernelVariants = ["bigmem", "enterprise", "smp", "hugemem", "PAE", + "guest", "hypervisor", "xen0", "xenU", "xen"] + + def getRunningKernel(): +- # Taken from the installonlyn.py plugin writen by Jeremy Katz ++ # Taken from the installonlyn.py plugin written by Jeremy Katz + # Copyright 2005 Red Hat, Inc. + # Modified by Jack Neely to return a kernel provides tuple + """This takes the output of uname and figures out the (version, release) +diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py +index 5094881..ef4afe8 100644 +--- a/plugins/fs-snapshot/fs-snapshot.py ++++ b/plugins/fs-snapshot/fs-snapshot.py +@@ -21,7 +21,7 @@ This plugin creates a snapshot before any yum update or yum remove operation on + any btrfs filesystem that is affected by the update/remove operation. + + This is a giant hammer. Please be aware that if you rollback to a previous +-snapshot that any other changes that occured to the filesystem after the ++snapshot that any other changes that occurred to the filesystem after the + snapshot takes place will not be in the snapshot. You of course can mount the + newer version elsewhere and copy the new versions of the files back to your + rolled-back snapshot. You have been warned. diff --git a/plugins/keys/keys.py b/plugins/keys/keys.py index 3342576..4d2ca96 100644 --- a/plugins/keys/keys.py @@ -1008,7 +1055,7 @@ index 4a2917c..f14ff2a 100755 import yum diff --git a/repoclosure.py b/repoclosure.py -index e710d8c..22efadc 100755 +index e710d8c..e5aae1b 100755 --- a/repoclosure.py +++ b/repoclosure.py @@ -8,11 +8,11 @@ @@ -1026,6 +1073,15 @@ index e710d8c..22efadc 100755 # seth vidal 2005 (c) etc etc +@@ -166,7 +166,7 @@ class RepoClosure(yum.YumBase): + + for pkg in pkgs: + if pkg.repoid in self.lookaside: +- # don't attempt to resolve dependancy issues for ++ # don't attempt to resolve dependency issues for + # packages from lookaside repositories + continue + for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'): diff --git a/repodiff.py b/repodiff.py index 67c162e..c16c03e 100755 --- a/repodiff.py @@ -1272,7 +1328,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..7660789 100755 +index a3bb111..a854c23 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -1290,7 +1346,15 @@ index a3bb111..7660789 100755 # (c) pmatilai@laiskiainen.org -@@ -74,6 +74,15 @@ querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', +@@ -25,7 +25,6 @@ import fnmatch + import time + import os + import os.path +-import exceptions + import urlparse + + from optparse import OptionParser +@@ -74,6 +73,15 @@ querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', 'installedsize', 'archivesize', 'packagesize', 'repoid', 'requires', 'provides', 'conflicts', 'obsoletes', 'relativepath', 'hdrstart', 'hdrend', 'id', @@ -1306,7 +1370,16 @@ index a3bb111..7660789 100755 ] def sec2isodate(timestr): -@@ -316,12 +325,13 @@ class pkgQuery: +@@ -114,7 +122,7 @@ convertmap = { 'date': sec2date, + 'h': size2h, + } + +-class queryError(exceptions.Exception): ++class queryError(Exception): + def __init__(self, value=None): + Exception.__init__(self) + self.value = value +@@ -316,12 +324,13 @@ class pkgQuery: print "%s%s [%s]" % (indent, str(req), str(val)) # These are common helpers for the --tree-* options... @@ -1323,7 +1396,7 @@ index a3bb111..7660789 100755 def _tree_pkg2uniq(self, pkg): """ Turn a pkg into a "unique" req.""" if self.yb and self.yb.conf.showdupesfromrepos: -@@ -365,6 +375,7 @@ class pkgQuery: +@@ -365,6 +374,7 @@ class pkgQuery: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -1331,7 +1404,7 @@ index a3bb111..7660789 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -375,6 +386,15 @@ class pkgQuery: +@@ -375,6 +385,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -1347,7 +1420,7 @@ index a3bb111..7660789 100755 __req2pkgs = {} def req2pkgs(ignore, req): req = str(req) -@@ -413,14 +433,9 @@ class pkgQuery: +@@ -413,14 +432,9 @@ class pkgQuery: __req2pkgs[req] = providers return providers @@ -1363,7 +1436,7 @@ index a3bb111..7660789 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -449,6 +464,7 @@ class pkgQuery: +@@ -449,6 +463,7 @@ class pkgQuery: def fmt_tree_obsoletes(self, **kw): pkg = kw.get('pkg', self.pkg) @@ -1371,7 +1444,7 @@ index a3bb111..7660789 100755 level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) -@@ -457,6 +473,7 @@ class pkgQuery: +@@ -457,6 +472,7 @@ class pkgQuery: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -1379,7 +1452,7 @@ index a3bb111..7660789 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -467,6 +484,15 @@ class pkgQuery: +@@ -467,6 +483,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -1395,7 +1468,7 @@ index a3bb111..7660789 100755 def obs2pkgs(): if self.yb is None: return [] -@@ -496,10 +522,7 @@ class pkgQuery: +@@ -496,10 +521,7 @@ class pkgQuery: else: reason = 'cmd line' rpkgs = obs2pkgs() @@ -1407,7 +1480,7 @@ index a3bb111..7660789 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 all_reqs[pkg] = None -@@ -514,6 +537,7 @@ class pkgQuery: +@@ -514,6 +536,7 @@ class pkgQuery: self._tree_print_req(rpkg, '', nlevel) continue self.fmt_tree_obsoletes(pkg=rpkg, level=nlevel, all_reqs=all_reqs, @@ -1415,7 +1488,7 @@ index a3bb111..7660789 100755 tree_level = kw['tree_level'], output = kw['output'], dot = dot) -@@ -527,6 +551,7 @@ class pkgQuery: +@@ -527,6 +550,7 @@ class pkgQuery: if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() @@ -1423,7 +1496,7 @@ index a3bb111..7660789 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -537,6 +562,15 @@ class pkgQuery: +@@ -537,6 +561,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -1439,7 +1512,7 @@ index a3bb111..7660789 100755 __prov2pkgs = {} def prov2pkgs(prov, ignore): if str(prov) in __prov2pkgs: -@@ -575,12 +609,8 @@ class pkgQuery: +@@ -575,12 +608,8 @@ class pkgQuery: tups = pkg.provides + filetupes rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, prov2pkgs) @@ -1453,7 +1526,7 @@ index a3bb111..7660789 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -719,13 +749,13 @@ class groupQuery: +@@ -719,13 +748,13 @@ class groupQuery: raise queryError("Invalid group query: %s" % method) # XXX temporary hack to make --group -a query work @@ -1470,7 +1543,7 @@ index a3bb111..7660789 100755 pkgs = [] for t in self.grouppkgs.split(','): if t == "mandatory": -@@ -741,10 +771,10 @@ class groupQuery: +@@ -741,10 +770,10 @@ class groupQuery: return pkgs @@ -1483,7 +1556,16 @@ index a3bb111..7660789 100755 return ["%s:\n\n%s\n" % (self.name, self.group.description)] -@@ -1008,12 +1038,12 @@ class YumBaseQuery(yum.YumBase): +@@ -826,6 +855,8 @@ class YumBaseQuery(yum.YumBase): + pkgs = self.pkgSack.returnNewestByNameArch(**kwargs) + except yum.Errors.PackageSackError: + pkgs = [] ++ except yum.Errors.RepoError, e: ++ raise queryError(e) + else: + what = self.options.pkgnarrow + ygh = self.doPackageLists(what, **kwargs) +@@ -1008,12 +1039,12 @@ class YumBaseQuery(yum.YumBase): def fmt_whatrequires(self, name, **kw): pkgs = {} @@ -1498,7 +1580,7 @@ index a3bb111..7660789 100755 provs = [name] -@@ -1054,10 +1084,21 @@ class YumBaseQuery(yum.YumBase): +@@ -1054,10 +1085,21 @@ class YumBaseQuery(yum.YumBase): def fmt_requires(self, name, **kw): pkgs = {} @@ -1521,7 +1603,7 @@ index a3bb111..7660789 100755 return pkgs.values() def fmt_location(self, name): -@@ -1070,6 +1111,44 @@ class YumBaseQuery(yum.YumBase): +@@ -1070,6 +1112,44 @@ class YumBaseQuery(yum.YumBase): loc.append("%s/%s" % (repo.urls[0], pkg['relativepath'])) return loc @@ -1566,7 +1648,7 @@ index a3bb111..7660789 100755 def main(args): -@@ -1198,6 +1277,9 @@ def main(args): +@@ -1198,6 +1278,9 @@ def main(args): parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") @@ -1576,7 +1658,7 @@ index a3bb111..7660789 100755 (opts, regexs) = parser.parse_args() -@@ -1261,9 +1343,10 @@ def main(args): +@@ -1261,9 +1344,10 @@ def main(args): if opts.srpm: needsource = 1 if opts.whatrequires: @@ -1588,7 +1670,7 @@ index a3bb111..7660789 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1303,6 +1386,13 @@ def main(args): +@@ -1303,6 +1387,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -1602,7 +1684,7 @@ index a3bb111..7660789 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1314,6 +1404,20 @@ def main(args): +@@ -1314,6 +1405,20 @@ def main(args): repoq.preconf.init_plugins = opts.plugins repoq.conf @@ -1624,7 +1706,7 @@ index a3bb111..7660789 100755 # setup the fake repos for repo in opts.repofrompath: diff --git a/reposync.py b/reposync.py -index 7950854..fb2c592 100755 +index 7950854..ad4e441 100755 --- a/reposync.py +++ b/reposync.py @@ -11,8 +11,8 @@ @@ -1674,32 +1756,108 @@ index 7950854..fb2c592 100755 try: arches = rpmUtils.arch.getArchList(opts.arch) if opts.source: -@@ -278,6 +277,7 @@ def main(): +@@ -277,73 +276,48 @@ def main(): + urlgrabber.progress.text_meter_total_size(remote_size) download_list.sort(sortPkgObj) - n = 0 -+ exit_code = 0 +- n = 0 ++ if opts.urls: ++ for pkg in download_list: ++ print urljoin(pkg.repo.urls[0], pkg.relativepath) ++ return 0 ++ ++ # create dest dir ++ if not os.path.exists(local_repo_path): ++ os.makedirs(local_repo_path) ++ ++ # set localpaths for pkg in download_list: - n = n + 1 - repo = my.repos.getRepo(pkg.repoid) -@@ -323,6 +323,7 @@ def main(): - except yum.Errors.RepoError, e: - my.logger.error("Could not retrieve package %s. Error was %s" % (pkg, str(e))) - local_size += sz -+ exit_code = 1 - continue - - local_size += sz -@@ -338,12 +339,14 @@ def main(): +- n = n + 1 +- repo = my.repos.getRepo(pkg.repoid) +- remote = pkg.returnSimple('relativepath') +- local = local_repo_path + '/' + remote +- localdir = os.path.dirname(local) +- if not os.path.exists(localdir): +- os.makedirs(localdir) +- +- sz = int(pkg.returnSimple('packagesize')) +- if os.path.exists(local) and os.path.getsize(local) == sz: +- +- if not opts.quiet: +- my.logger.error("[%s: %-5d of %-5d ] Skipping existing %s" % (repo.id, n, len(download_list), remote)) +- continue +- +- if opts.urls: +- baseurl = None +- if repo.urls[0][-1] != '/': +- baseurl = repo.urls[0] + '/' +- else: +- baseurl = repo.urls[0] +- url = urljoin(baseurl,remote) +- print '%s' % url +- continue +- +- # make sure the repo subdir is here before we go on. +- if not os.path.exists(local_repo_path): +- try: +- os.makedirs(local_repo_path) +- except IOError, e: +- my.logger.error("Could not make repo subdir: %s" % e) +- my.closeRpmDB() +- sys.exit(1) +- +- # Disable cache otherwise things won't download +- repo.cache = 0 +- if not opts.quiet: +- my.logger.info( '[%s: %-5d of %-5d ] Downloading %s' % (repo.id, n, len(download_list), remote)) +- pkg.localpath = local # Hack: to set the localpath we want. +- try: +- path = repo.getPackage(pkg) +- except yum.Errors.RepoError, e: +- my.logger.error("Could not retrieve package %s. Error was %s" % (pkg, str(e))) +- local_size += sz +- continue +- +- local_size += sz +- if hasattr(urlgrabber.progress, 'text_meter_total_size'): +- urlgrabber.progress.text_meter_total_size(remote_size, local_size) +- if opts.gpgcheck: ++ rpmfn = os.path.basename(pkg.remote_path) ++ pkg.localpath = os.path.join(local_repo_path, rpmfn) ++ pkg.repo.copy_local = True ++ pkg.repo.cache = 0 ++ ++ # use downloader from YumBase ++ exit_code = 0 ++ probs = my.downloadPkgs(download_list) ++ if probs: ++ exit_code = 1 ++ for key in probs: ++ for error in probs[key]: ++ self.logger.error('%s: %s', key, error) ++ ++ if opts.gpgcheck: ++ for pkg in download_list: + result, error = my.sigCheckPkg(pkg) + if result != 0: ++ rpmfn = os.path.basename(pkg.remote_path) + if result == 1: +- my.logger.warning('Removing %s, due to missing GPG key.' % os.path.basename(remote)) ++ my.logger.warning('Removing %s, due to missing GPG key.' % rpmfn) + elif result == 2: +- my.logger.warning('Removing %s due to failed signature check.' % os.path.basename(remote)) ++ my.logger.warning('Removing %s due to failed signature check.' % rpmfn) else: - my.logger.warning('Removing %s due to failed signature check: %s' % (os.path.basename(remote), error)) - os.unlink(path) +- my.logger.warning('Removing %s due to failed signature check: %s' % (os.path.basename(remote), error)) +- os.unlink(path) ++ my.logger.warning('Removing %s due to failed signature check: %s' % rpmfn) ++ os.unlink(pkg.localpath) + exit_code = 1 continue - if not os.path.exists(local) or not os.path.samefile(path, local): - shutil.copy2(path, local) - +- if not os.path.exists(local) or not os.path.samefile(path, local): +- shutil.copy2(path, local) +- my.closeRpmDB() + sys.exit(exit_code) @@ -1765,6 +1923,49 @@ index 3489247..f314ef0 100755 if opts.cache: yb.conf.cache = 1 elif not yb.setCacheDir(): +diff --git a/show-installed.py b/show-installed.py +index 737f97e..65aae11 100755 +--- a/show-installed.py ++++ b/show-installed.py +@@ -360,7 +360,7 @@ def __main__(): + choices=('kickstart','human','yum'), default="human", + help='yum, kickstart or human; yum gives the result as a yum command line; kickstart the content of a %packages section; "human" readable is default.') + parser.add_option("-i", "--input", dest="input", action="store", default=None, help="File to read the package list from instead of using the rpmdb. - for stdin. The file must contain package names only separated by white space (including newlines). rpm -qa --qf='%{name}\\n' produces proper output.") +- parser.add_option("-o", "--output", dest="output", action="store", default=None, help="File to write the result to. Stdout is used if option is omited.") ++ parser.add_option("-o", "--output", dest="output", action="store", default=None, help="File to write the result to. Stdout is used if option is omitted.") + parser.add_option("-q", "--quiet", dest="quiet", action="store_true", help="Do not show warnings.") + parser.add_option("-e", "--no-excludes", dest="excludes", + action="store_false", default=True, +diff --git a/test/yum-utils-pylintrc b/test/yum-utils-pylintrc +index 1a03789..6acaba4 100644 +--- a/test/yum-utils-pylintrc ++++ b/test/yum-utils-pylintrc +@@ -1,6 +1,6 @@ + # lint Python modules using external checkers. + # +-# This is the main checker controling the other ones and the reports ++# This is the main checker controlling the other ones and the reports + # generation. It is itself both a raw checker and an astng checker in order + # to: + # * handle message activation / deactivation at the module level +@@ -106,7 +106,7 @@ reports=yes + + # Python expression which should return a note less than 10 (10 is the highest + # note).You have access to the variables errors warning, statement which +-# respectivly contain the number of errors / warnings messages and the total ++# respectively contain the number of errors / warnings messages and the total + # number of statements analyzed. This is used by the global evaluation report + # (R0004). + evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +@@ -246,7 +246,7 @@ int-import-graph= + # checks for : + # * methods without self as first argument + # * overridden methods signature +-# * access only to existant members via self ++# * access only to existent members via self + # * attributes not defined in the __init__ method + # * supported interfaces implementation + # * unreachable code diff --git a/verifytree.py b/verifytree.py index d1fe5e2..cb89285 100755 --- a/verifytree.py @@ -1785,10 +1986,10 @@ index d1fe5e2..cb89285 100755 import yum diff --git a/yum-builddep.py b/yum-builddep.py -index d7a37c3..f67c810 100755 +index d7a37c3..fa00414 100755 --- a/yum-builddep.py +++ b/yum-builddep.py -@@ -8,11 +8,11 @@ +@@ -8,17 +8,18 @@ # 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 @@ -1803,7 +2004,14 @@ index d7a37c3..f67c810 100755 import sys sys.path.insert(0,'/usr/share/yum-cli') -@@ -26,6 +26,8 @@ import logging + + import yum + from yum.misc import setup_locale ++from yum.i18n import exception2msg + import yum.Errors + from utils import YumUtilBase + +@@ -26,6 +27,8 @@ import logging import rpmUtils import rpm @@ -1812,7 +2020,7 @@ index d7a37c3..f67c810 100755 # Copied from yumdownloader (need a yum-utils python module ;) # This is to fix Bug 469 # To convert from a pkg to a source pkg, we have a problem in that all we have -@@ -61,6 +63,9 @@ class YumBuildDep(YumUtilBase): +@@ -61,6 +64,9 @@ class YumBuildDep(YumUtilBase): self.logger = logging.getLogger("yum.verbose.cli.yumbuildep") # Add util commandline options to the yum-cli ones self.optparser = self.getOptionParser() @@ -1822,7 +2030,7 @@ index d7a37c3..f67c810 100755 self.main() def main(self): -@@ -118,9 +123,16 @@ class YumBuildDep(YumUtilBase): +@@ -118,9 +124,16 @@ class YumBuildDep(YumUtilBase): # enable the -source repos for enabled primary repos archlist = rpmUtils.arch.getArchList() + ['src'] for repo in self.repos.listEnabled(): @@ -1840,7 +2048,32 @@ index d7a37c3..f67c810 100755 repo.close() self.repos.disableRepo(repo.id) srcrepo = repo.id -@@ -170,10 +182,14 @@ class YumBuildDep(YumUtilBase): +@@ -140,6 +153,7 @@ class YumBuildDep(YumUtilBase): + sys.exit(1) + + def install_deps(self, deplist): ++ errors = set() + for dep in deplist: + self.logger.debug(' REQ: %s' % dep) + if dep.startswith("rpmlib("): +@@ -152,10 +166,13 @@ class YumBuildDep(YumUtilBase): + pkg = self.returnPackageByDep(dep) + self.logger.info(' --> %s' % pkg) + self.install(pkg) +- + except yum.Errors.YumBaseError, e: +- self.logger.error("Error: %s" % e) +- sys.exit(1) ++ errors.add(exception2msg(e)) ++ ++ if errors: ++ for i in sorted(errors): ++ self.logger.error("Error: %s" % i) ++ sys.exit(1) + + # go through each of the pkgs, figure out what they are/where they are + # if they are not a local package then run +@@ -170,10 +187,14 @@ class YumBuildDep(YumUtilBase): specnames = [] srpms = [] specworks = False @@ -1855,7 +2088,7 @@ index d7a37c3..f67c810 100755 for arg in self.cmds: if arg.endswith('.src.rpm'): -@@ -216,12 +232,20 @@ class YumBuildDep(YumUtilBase): +@@ -216,12 +237,20 @@ class YumBuildDep(YumUtilBase): self.install_deps(srpm.requiresList()) for name in specnames: @@ -2327,7 +2560,7 @@ index 8a4888e..4e549cd 100755 args.pop(0) if args: diff --git a/yumdownloader.py b/yumdownloader.py -index e6107d4..d37f15d 100755 +index e6107d4..ba17edd 100755 --- a/yumdownloader.py +++ b/yumdownloader.py @@ -7,11 +7,11 @@ @@ -2354,33 +2587,170 @@ index e6107d4..d37f15d 100755 # This is to fix Bug 469 # To convert from a pkg to a source pkg, we have a problem in that all we have # is "sourcerpm", which can be a different nevra ... but just to make it fun -@@ -112,7 +114,10 @@ class YumDownloader(YumUtilBase): +@@ -92,53 +94,27 @@ class YumDownloader(YumUtilBase): + + # Setup yum (Ts, RPM db, Repo & Sack) + self.doUtilYumSetup(opts) +- # Setup source repos +- if opts.source: +- self.setupSourceRepos() + # Do the real action + self.exit_code = self.downloadPackages(opts) + + def setupSourceRepos(self): + # enable the -source repos for enabled primary repos +- archlist = rpmUtils.arch.getArchList() + ['src'] +- # Ok, we have src and bin repos. What we want to do here is: +- # +- # 1. _enable_ source repos for which the bin repos are enabled. +- # 2. _disable_ the _other_ src repos. +- # +- # ...also we don't want to disable the src repos. for #1 and then +- # re-enable them as then we get annoying messages and call .close() on +- # them losing the primarydb data etc. - # Get all src repos. - src_repos = {} +- # Get all src repos. +- src_repos = {} - for repo in self.repos.findRepos('*-source'): -+ repos_source = self.repos.findRepos('*-source') -+ if rhn_source_repos: # RHN -+ repos_source += self.repos.findRepos('*-source-rpms') -+ for repo in repos_source: - src_repos[repo.id] = False +- src_repos[repo.id] = False ++ enabled = {} ++ for repo in self.repos.findRepos('*'): ++ enabled[repo.id] = repo.isEnabled() - # Find the enabled bin repos, and mark their respective *-source repo. -@@ -122,9 +127,16 @@ class YumDownloader(YumUtilBase): - srcrepo = '%s-source' % repo.id - if srcrepo in src_repos: - src_repos[srcrepo] = True -+ if not rhn_source_repos: -+ continue -+ if not repo.id.endswith("-rpms"): -+ continue -+ srcrepo = repo.id[:-len('-rpms')] + '-source-rpms' -+ if srcrepo in src_repos: -+ src_repos[srcrepo] = True +- # Find the enabled bin repos, and mark their respective *-source repo. +- # as good. +- for repo in self.repos.listEnabled(): +- if repo.id not in src_repos: +- srcrepo = '%s-source' % repo.id +- if srcrepo in src_repos: +- src_repos[srcrepo] = True ++ for repo in self.repos.findRepos('*'): ++ if repo.id.endswith('-source'): ++ primary = repo.id[:-7] ++ elif rhn_source_repos and repo.id.endswith('-source-rpms'): ++ primary = repo.id[:-12] + '-rpms' ++ else: ++ continue - # Toggle src repos that are set the wrong way +- # Toggle src repos that are set the wrong way - for repo in self.repos.findRepos('*-source'): -+ for repo in repos_source: - if repo.isEnabled() and not src_repos[repo.id]: - repo.close() - self.repos.disableRepo(repo.id) +- if repo.isEnabled() and not src_repos[repo.id]: +- repo.close() +- self.repos.disableRepo(repo.id) +- if not repo.isEnabled() and src_repos[repo.id]: ++ if not repo.isEnabled() and enabled.get(primary): + self.logger.info('Enabling %s repository' % repo.id) + repo.enable() +- # Setup the repo, without a cache +- repo.setup(0) +- try: +- # Setup pkgSack with 'src' in the archlist +- self._getSacks(archlist=archlist, thisrepo=repo.id) +- except yum.Errors.YumBaseError, msg: +- self.logger.critical(str(msg)) +- sys.exit(1) + + def downloadPackages(self,opts): + +@@ -216,52 +192,30 @@ class YumDownloader(YumUtilBase): + if len(toDownload) == 0: + self.logger.error('Nothing to download') + sys.exit(1) ++ if opts.urls: ++ for pkg in toDownload: ++ print urljoin(pkg.repo.urls[0], pkg.relativepath) ++ return 0 + +- exit_code = 0 ++ # create dest dir ++ if not os.path.exists(opts.destdir): ++ os.makedirs(opts.destdir) ++ ++ # set localpaths + for pkg in toDownload: +- n,a,e,v,r = pkg.pkgtup +- packages = self.pkgSack.searchNevra(n,e,v,r,a) +- packages.sort() +- last = None +- for download in packages: +- if download.pkgtup == last : +- continue +- last = download.pkgtup +- repo = self.repos.getRepo(download.repoid) +- remote = download.returnSimple('relativepath') +- if opts.urls: +- url = urljoin(repo.urls[0]+'/',remote) +- self.logger.info('%s' % url) +- continue +- local = os.path.basename(remote) +- if not os.path.exists(opts.destdir): +- os.makedirs(opts.destdir) +- local = os.path.join(opts.destdir, local) +- if (os.path.exists(local) and +- os.path.getsize(local) == int(download.returnSimple('packagesize'))): +- self.logger.error("%s already exists and appears to be complete" % local) +- continue +- # Disable cache otherwise things won't download +- repo.cache = 0 +- download.localpath = local # Hack: to set the localpath we want. +- try: +- checkfunc = (self.verifyPkg, (download, 1), {}) +- path = repo.getPackage(download, checkfunc=checkfunc) +- except IOError, e: +- self.logger.error("Cannot write to file %s. Error was: %s" % (local, e)) +- exit_code = 2 +- continue +- except RepoError, e: +- self.logger.error("Could not download/verify pkg %s: %s" % (download, e)) +- exit_code = 2 +- continue +- +- if not os.path.exists(local) or not os.path.samefile(path, local): +- progress = TextMeter() +- progress.start(basename=os.path.basename(local), +- size=os.stat(path).st_size) +- shutil.copy2(path, local) +- progress.end(progress.size) ++ rpmfn = os.path.basename(pkg.remote_path) ++ pkg.localpath = os.path.join(opts.destdir, rpmfn) ++ pkg.repo.copy_local = True ++ pkg.repo.cache = 0 ++ ++ # use downloader from YumBase ++ exit_code = 0 ++ probs = self.downloadPkgs(toDownload) ++ if probs: ++ exit_code = 2 ++ for key in probs: ++ for error in probs[key]: ++ self.logger.error('%s: %s', key, error) + return exit_code + + def _groupPackages(self,pkglist): +@@ -279,6 +233,9 @@ class YumDownloader(YumUtilBase): + """do a default setup for all the normal/necessary yum components, + really just a shorthand for testing""" + try: ++ # Setup source repos ++ if opts.source: ++ self.setupSourceRepos() + self._getRepos(doSetup = True) + # if '--source' is used the add src to the archlist + if opts.source: +@@ -294,15 +251,8 @@ class YumDownloader(YumUtilBase): + self.logger.critical(str(msg)) + sys.exit(1) + +- def _removeEnabledSourceRepos(self): +- ''' Disable all enabled *-source repos.''' +- for repo in self.repos.listEnabled(): +- if repo.id.endswith('-source'): +- repo.close() +- self.repos.disableRepo(repo.id) +- + def addCmdOptions(self): +- # this if for compability with old API (utils.py from yum < 3.2.23) ++ # this if for compatibility with old API (utils.py from yum < 3.2.23) + if hasattr(self,'getOptionGroup'): # check if the group option API is available + group = self.getOptionGroup() + else: diff --git a/yum-utils.spec b/yum-utils.spec index 258be93..7c4185a 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -9,7 +9,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 6%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -697,6 +697,10 @@ fi /usr/lib/yum-plugins/puppetverify.* %changelog +* Wed Aug 8 2012 Zdenek Pavlas - 1.1.31-7 +- Update to latest HEAD. +- Use package downloader from Yum. + * Sun Jul 22 2012 Fedora Release Engineering - 1.1.31-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild From 9db05e602045e6d297377bfce82fd5ea4a1d3fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zden=C4=9Bk=20Pavlas?= Date: Wed, 21 Nov 2012 10:11:26 +0100 Subject: [PATCH 02/55] Update to latest HEAD --- yum-utils-HEAD.patch | 219 +++++++++++++++++++++++++++++++++++++++---- yum-utils.spec | 25 +---- 2 files changed, 207 insertions(+), 37 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index e2a7991..ba851fe 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -920,6 +920,68 @@ index 39993ad..9ff927c 100644 for opt, repoexp in opts.repos: if opt == '--disablerepo': mdrs.add(repoexp) +diff --git a/plugins/downloadonly/downloadonly.conf b/plugins/downloadonly/downloadonly.conf +deleted file mode 100644 +index 8e4d76c..0000000 +--- a/plugins/downloadonly/downloadonly.conf ++++ /dev/null +@@ -1,2 +0,0 @@ +-[main] +-enabled=1 +diff --git a/plugins/downloadonly/downloadonly.py b/plugins/downloadonly/downloadonly.py +deleted file mode 100644 +index 8486bb0..0000000 +--- a/plugins/downloadonly/downloadonly.py ++++ /dev/null +@@ -1,48 +0,0 @@ +-#!/usr/bin/python +- +-# 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 Library General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-# +-# by Menno Smits +- +-from yum.plugins import PluginYumExit, TYPE_INTERACTIVE +- +-requires_api_version = '2.1' +-plugin_type = (TYPE_INTERACTIVE,) +- +-def config_hook(conduit): +- parser = conduit.getOptParser() +- if hasattr(parser, 'plugin_option_group'): +- parser = parser.plugin_option_group +- +- parser.add_option('', '--downloadonly', dest='dlonly', action='store_true', +- default=False, help="don't update, just download") +- parser.add_option('', '--downloaddir', dest='dldir', +- action='store', default=None, +- help="specifies an alternate directory to store packages") +- +-def postreposetup_hook(conduit): +- opts, commands = conduit.getCmdLine() +- if opts.dldir: +- repos = conduit.getRepos() +- rlist = repos.listEnabled() +- for repo in rlist: +- repo.setAttribute('pkgdir',opts.dldir) +- +- +-def postdownload_hook(conduit): +- opts, commands = conduit.getCmdLine() +- # Don't die on errors, or we'll never see them. +- if not conduit.getErrors() and opts.dlonly: +- raise PluginYumExit('exiting because --downloadonly specified ') diff --git a/plugins/fedorakmod/fedorakmod.py b/plugins/fedorakmod/fedorakmod.py index b3aed61..82a43d5 100644 --- a/plugins/fedorakmod/fedorakmod.py @@ -975,11 +1037,33 @@ index 3342576..4d2ca96 100644 yum.pgpmsg.str_to_hex(gpg_cert.public_key.key_id())) +diff --git a/plugins/local/local.py b/plugins/local/local.py +index c45a1ce..cab69c5 100644 +--- a/plugins/local/local.py ++++ b/plugins/local/local.py +@@ -146,7 +146,7 @@ def _reposetup(conduit): + if repo.id == "_local"] + if lrepo: + lrepo = lrepo[0] +- os.unlink("%s/cachecookie" % lrepo.cachedir) ++ yum.misc.unlink_f("%s/cachecookie" % lrepo.cachedir) + return + + conf_fname = '/etc/yum.repos.d/_local.repo' diff --git a/plugins/priorities/priorities.py b/plugins/priorities/priorities.py -index 202c203..0cdfae2 100644 +index 202c203..ce98583 100644 --- a/plugins/priorities/priorities.py +++ b/plugins/priorities/priorities.py -@@ -164,6 +164,10 @@ def exclude_hook(conduit): +@@ -161,9 +161,19 @@ def exclude_hook(conduit): + conduit.delPackage(po) + cnt += 1 + conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid)) ++ # Remove all occurances of this package ++ for p in conduit.getPackages(repo): ++ if p.name==po.name: ++ conduit.delPackage(p) ++ cnt += 1 ++ conduit.info(3," --> %s from %s excluded (priority)" % (p,p.repoid)) break if cnt: conduit.info(2, '%d packages excluded due to repository priority protections' % cnt) @@ -990,6 +1074,30 @@ index 202c203..0cdfae2 100644 def _pkglist_to_dict(pl, priority, addArch = False): out = dict() +diff --git a/plugins/versionlock/versionlock.py b/plugins/versionlock/versionlock.py +index 40756b2..69458cd 100644 +--- a/plugins/versionlock/versionlock.py ++++ b/plugins/versionlock/versionlock.py +@@ -170,6 +170,7 @@ class VersionLockCommand: + if not count: + os.unlink(tmpfilename) + return 1, ['Error: versionlock delete: no matches'] ++ os.chmod(tmpfilename, 0644) + os.rename(tmpfilename, filename) + return 0, ['versionlock deleted: ' + str(count)] + +diff --git a/po/POTFILES.in b/po/POTFILES.in +index 581da0a..d85030c 100644 +--- a/po/POTFILES.in ++++ b/po/POTFILES.in +@@ -28,7 +28,6 @@ plugins/ps/ps.py + plugins/auto-update-debuginfo/auto-update-debuginfo.py + plugins/show-leaves/show-leaves.py + plugins/list-data/list-data.py +-plugins/downloadonly/downloadonly.py + plugins/allowdowngrade/allowdowngrade.py + plugins/tsflags/tsflags.py + plugins/merge-conf/merge-conf.py diff --git a/repo-check.py b/repo-check.py index 7c4ae77..2aa8bde 100755 --- a/repo-check.py @@ -1706,7 +1814,7 @@ index a3bb111..a854c23 100755 # setup the fake repos for repo in opts.repofrompath: diff --git a/reposync.py b/reposync.py -index 7950854..ad4e441 100755 +index 7950854..f868594 100755 --- a/reposync.py +++ b/reposync.py @@ -11,8 +11,8 @@ @@ -1720,6 +1828,15 @@ index 7950854..ad4e441 100755 # copyright 2006 Duke University # author seth vidal +@@ -47,7 +47,7 @@ from yum.constants import * + from yum.packageSack import ListPackageSack + import rpmUtils.arch + import logging +-from urlgrabber.progress import TextMeter ++from urlgrabber.progress import TextMeter, TextMultiFileMeter + import urlgrabber + + # for yum 2.4.X compat @@ -96,7 +96,7 @@ def parseArgs(): parser.add_option("-c", "--config", default='/etc/yum.conf', help='config file to use (defaults to /etc/yum.conf)') @@ -1736,7 +1853,7 @@ index 7950854..ad4e441 100755 + # Use progress bar display when downloading repo metadata + # and package files ... needs to be setup before .repos (ie. RHN/etc.). + if not opts.quiet: -+ my.repos.setProgressBar(TextMeter(fo=sys.stdout)) ++ my.repos.setProgressBar(TextMeter(fo=sys.stdout), TextMultiFileMeter(fo=sys.stdout)) + my.doRepoSetup() + if len(opts.repoid) > 0: @@ -1986,7 +2103,7 @@ index d1fe5e2..cb89285 100755 import yum diff --git a/yum-builddep.py b/yum-builddep.py -index d7a37c3..fa00414 100755 +index d7a37c3..b9e682a 100755 --- a/yum-builddep.py +++ b/yum-builddep.py @@ -8,17 +8,18 @@ @@ -2088,7 +2205,20 @@ index d7a37c3..fa00414 100755 for arg in self.cmds: if arg.endswith('.src.rpm'): -@@ -216,12 +237,20 @@ class YumBuildDep(YumUtilBase): +@@ -206,22 +227,30 @@ class YumBuildDep(YumUtilBase): + sys.exit(1) + + toActOn = [] ++ # Get the best matching srpms + for newpkg in srpms: +- toActOn.extend(_best_convert_pkg2srcpkgs(self, opts, newpkg)) +- # Get the best matching srpm +- toActOn = self.bestPackagesFromList(toActOn, 'src') ++ srcpkg = _best_convert_pkg2srcpkgs(self, opts, newpkg) ++ toActOn.extend(self.bestPackagesFromList(srcpkg, 'src')) + + for srpm in toActOn: + self.logger.info('Getting requirements for %s' % srpm) self.install_deps(srpm.requiresList()) for name in specnames: @@ -2110,7 +2240,7 @@ index d7a37c3..fa00414 100755 for d in rpm.ds(spec.sourceHeader, 'requires'): buildreqs.append(d.DNEVR()[2:]) diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py -index c5074ab..66c4504 100755 +index c5074ab..b61df9c 100755 --- a/yum-complete-transaction.py +++ b/yum-complete-transaction.py @@ -8,11 +8,11 @@ @@ -2128,6 +2258,15 @@ index c5074ab..66c4504 100755 import sys sys.path.insert(0,'/usr/share/yum-cli') +@@ -93,7 +93,7 @@ except ImportError: + return to_complete_items + + class YumCompleteTransaction(YumUtilBase): +- NAME = 'yum-complete-transactions' ++ NAME = 'yum-complete-transaction' + VERSION = '1.0' + USAGE = """ + yum-complete-transaction: completes unfinished yum transactions which occur due to error, failure diff --git a/yum-debug-dump.py b/yum-debug-dump.py index 4653f3c..67d943f 100755 --- a/yum-debug-dump.py @@ -2148,7 +2287,7 @@ index 4653f3c..67d943f 100755 import os diff --git a/yum-debug-restore.py b/yum-debug-restore.py -index fd95741..1e2a659 100755 +index fd95741..1d827f4 100755 --- a/yum-debug-restore.py +++ b/yum-debug-restore.py @@ -8,11 +8,11 @@ @@ -2201,6 +2340,19 @@ index fd95741..1e2a659 100755 return ret def main(): +@@ -223,10 +232,8 @@ def main(): + sys.exit(0) + + # Want to do the transaction, hacky method +- if xtra_args: +- os.system("yum shell %s %s" % (" ".join(xtra_args), fo.name)) +- else: +- os.system("yum shell %s" % fo.name) ++ xtra_args.append('--setopt=installonly_limit=0') ++ os.system("yum shell %s %s" % (" ".join(xtra_args), fo.name)) + + if __name__ == "__main__": + main() diff --git a/yum-util-cli-template b/yum-util-cli-template index 8bfdbcd..250ebc9 100644 --- a/yum-util-cli-template @@ -2425,7 +2577,7 @@ index 1d37231..20e8e5c 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..f67f713 100644 +index ce7fb64..cdefb85 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,3 +1,9 @@ @@ -2438,7 +2590,26 @@ index ce7fb64..f67f713 100644 %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Summary: Utilities based around the yum package manager -@@ -130,6 +136,7 @@ This plugin allows repositories to have different priorities. +@@ -105,18 +111,6 @@ Requires: yum >= 3.0 + This plugin allows you to specify optional transaction flags on the yum + command line + +-%package -n yum-plugin-downloadonly +-Summary: Yum plugin to add downloadonly command option +-Group: System Environment/Base +-Provides: yum-downloadonly = %{version}-%{release} +-Obsoletes: yum-downloadonly < 1.1.20-0 +-Conflicts: yum-downloadonly < 1.1.20-0 +-Requires: yum >= 3.0 +- +-%description -n yum-plugin-downloadonly +-This plugin adds a --downloadonly flag to yum so that yum will only download +-the packages and not install/update them. +- + %package -n yum-plugin-priorities + Summary: plugin to give priorities to packages from different repos + Group: System Environment/Base +@@ -130,6 +124,7 @@ This plugin allows repositories to have different priorities. Packages in a repository with a lower priority can't be overridden by packages from a repository with a higher priority even if repo has a later version. @@ -2446,7 +2617,7 @@ index ce7fb64..f67f713 100644 %package -n yum-plugin-refresh-updatesd Summary: Tell yum-updatesd to check for updates when yum exits Group: System Environment/Base -@@ -143,6 +150,7 @@ Requires: yum-updatesd +@@ -143,6 +138,7 @@ Requires: yum-updatesd yum-refresh-updatesd tells yum-updatesd to check for updates when yum exits. This way, if you run 'yum update' and install all available updates, puplet will almost instantly update itself to reflect this. @@ -2454,15 +2625,17 @@ index ce7fb64..f67f713 100644 %package -n yum-plugin-merge-conf Summary: Yum plugin to merge configuration changes when installing packages -@@ -397,7 +405,6 @@ plugins="\ +@@ -395,9 +391,7 @@ plugins="\ + protectbase \ + versionlock \ tsflags \ - downloadonly \ +- downloadonly \ priorities \ - refresh-updatesd \ merge-conf \ security \ upgrade-helper \ -@@ -418,6 +425,12 @@ plugins="\ +@@ -418,6 +412,12 @@ plugins="\ puppetverify \ " @@ -2475,7 +2648,7 @@ index ce7fb64..f67f713 100644 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/post-actions -@@ -469,8 +482,8 @@ fi +@@ -469,8 +469,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -2485,7 +2658,7 @@ index ce7fb64..f67f713 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,6 +500,7 @@ fi +@@ -487,6 +487,7 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -2493,7 +2666,19 @@ index ce7fb64..f67f713 100644 %{_mandir}/man8/yum-complete-transaction.8.* %{_mandir}/man1/yum-groups-manager.1.* %{_mandir}/man8/yumdb.8.* -@@ -545,11 +559,13 @@ fi +@@ -533,23 +534,19 @@ fi + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf + /usr/lib/yum-plugins/tsflags.* + +-%files -n yum-plugin-downloadonly +-%defattr(-, root, root) +-%doc COPYING +-%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/downloadonly.conf +-/usr/lib/yum-plugins/downloadonly.* +- + %files -n yum-plugin-priorities + %defattr(-, root, root) + %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/priorities.conf /usr/lib/yum-plugins/priorities.* diff --git a/yum-utils.spec b/yum-utils.spec index 7c4185a..0950349 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -9,7 +9,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 7%{?dist} +Release: 8%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -113,18 +113,6 @@ Requires: yum >= 3.0 This plugin allows you to specify optional transaction flags on the yum command line -%package -n yum-plugin-downloadonly -Summary: Yum plugin to add downloadonly command option -Group: System Environment/Base -Provides: yum-downloadonly = %{version}-%{release} -Obsoletes: yum-downloadonly < 1.1.20-0 -Conflicts: yum-downloadonly < 1.1.20-0 -Requires: yum >= 3.0 - -%description -n yum-plugin-downloadonly -This plugin adds a --downloadonly flag to yum so that yum will only download -the packages and not install/update them. - %package -n yum-plugin-priorities Summary: plugin to give priorities to packages from different repos Group: System Environment/Base @@ -407,7 +395,6 @@ plugins="\ protectbase \ versionlock \ tsflags \ - downloadonly \ priorities \ merge-conf \ security \ @@ -551,12 +538,6 @@ fi %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf /usr/lib/yum-plugins/tsflags.* -%files -n yum-plugin-downloadonly -%defattr(-, root, root) -%doc COPYING -%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/downloadonly.conf -/usr/lib/yum-plugins/downloadonly.* - %files -n yum-plugin-priorities %defattr(-, root, root) %doc COPYING @@ -697,6 +678,10 @@ fi /usr/lib/yum-plugins/puppetverify.* %changelog +* Wed Nov 21 2012 Zdenek Pavlas - 1.1.31-8 +- Update to latest HEAD. +- Remove downloadonly plugin. + * Wed Aug 8 2012 Zdenek Pavlas - 1.1.31-7 - Update to latest HEAD. - Use package downloader from Yum. From 2f3174c0b2c3140c19f2ff15070ee1f606143e76 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Mon, 14 Jan 2013 13:30:48 +0100 Subject: [PATCH 03/55] Update to latest HEAD. --- yum-utils-HEAD.patch | 268 +++++++++++++++++++++++++++++++++++++++---- yum-utils.spec | 71 ++++++------ 2 files changed, 286 insertions(+), 53 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index ba851fe..bb499ec 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -1814,7 +1814,7 @@ index a3bb111..a854c23 100755 # setup the fake repos for repo in opts.repofrompath: diff --git a/reposync.py b/reposync.py -index 7950854..f868594 100755 +index 7950854..a749973 100755 --- a/reposync.py +++ b/reposync.py @@ -11,8 +11,8 @@ @@ -1846,10 +1846,29 @@ index 7950854..f868594 100755 parser.add_option("--source", default=False, dest="source", action="store_true", help='operate on source packages') parser.add_option("-r", "--repoid", default=[], action='append', -@@ -162,6 +162,12 @@ def main(): +@@ -153,15 +153,27 @@ def main(): + opts.tempcache = True + + if opts.tempcache: +- cachedir = getCacheDir() +- if cachedir is None: ++ if not my.setCacheDir(force=True): + print >> sys.stderr, "Error: Could not make cachedir, exiting" + sys.exit(50) +- +- my.repos.setCacheDir(cachedir) ++ my.conf.uid = 1 # force locking of user cache elif opts.cachedir: my.repos.setCacheDir(opts.cachedir) ++ # Lock if they've not given an explicit cachedir ++ if not opts.cachedir: ++ try: ++ my.doLock() ++ except yum.Errors.LockError, e: ++ print >> sys.stderr, "Error: %s" % e ++ sys.exit(50) ++ + # Use progress bar display when downloading repo metadata + # and package files ... needs to be setup before .repos (ie. RHN/etc.). + if not opts.quiet: @@ -1859,7 +1878,7 @@ index 7950854..f868594 100755 if len(opts.repoid) > 0: myrepos = [] -@@ -182,13 +188,6 @@ def main(): +@@ -182,13 +194,6 @@ def main(): print >> sys.stderr, "Error: Can't use --norepopath with multiple repositories" sys.exit(1) @@ -1873,7 +1892,15 @@ index 7950854..f868594 100755 try: arches = rpmUtils.arch.getArchList(opts.arch) if opts.source: -@@ -277,73 +276,48 @@ def main(): +@@ -199,6 +204,7 @@ def main(): + # maybe this shouldn't be entirely fatal + sys.exit(1) + ++ exit_code = 0 + for repo in my.repos.listEnabled(): + reposack = ListPackageSack(my.pkgSack.returnPackages(repoid=repo.id)) + +@@ -277,73 +283,47 @@ def main(): urlgrabber.progress.text_meter_total_size(remote_size) download_list.sort(sortPkgObj) @@ -1945,7 +1972,6 @@ index 7950854..f868594 100755 + pkg.repo.cache = 0 + + # use downloader from YumBase -+ exit_code = 0 + probs = my.downloadPkgs(download_list) + if probs: + exit_code = 1 @@ -2577,10 +2603,10 @@ index 1d37231..20e8e5c 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..cdefb85 100644 +index ce7fb64..16b568e 100644 --- a/yum-utils.spec +++ b/yum-utils.spec -@@ -1,3 +1,9 @@ +@@ -1,4 +1,11 @@ +%if 0%{?rhel} +%define package_yum_updatesd 0 +%else @@ -2588,9 +2614,11 @@ index ce7fb64..cdefb85 100644 +%endif + %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} ++%define pluginhome /usr/lib/yum-plugins Summary: Utilities based around the yum package manager -@@ -105,18 +111,6 @@ Requires: yum >= 3.0 + Name: yum-utils +@@ -105,18 +112,6 @@ Requires: yum >= 3.0 This plugin allows you to specify optional transaction flags on the yum command line @@ -2609,7 +2637,7 @@ index ce7fb64..cdefb85 100644 %package -n yum-plugin-priorities Summary: plugin to give priorities to packages from different repos Group: System Environment/Base -@@ -130,6 +124,7 @@ This plugin allows repositories to have different priorities. +@@ -130,6 +125,7 @@ This plugin allows repositories to have different priorities. Packages in a repository with a lower priority can't be overridden by packages from a repository with a higher priority even if repo has a later version. @@ -2617,7 +2645,7 @@ index ce7fb64..cdefb85 100644 %package -n yum-plugin-refresh-updatesd Summary: Tell yum-updatesd to check for updates when yum exits Group: System Environment/Base -@@ -143,6 +138,7 @@ Requires: yum-updatesd +@@ -143,6 +139,7 @@ Requires: yum-updatesd yum-refresh-updatesd tells yum-updatesd to check for updates when yum exits. This way, if you run 'yum update' and install all available updates, puplet will almost instantly update itself to reflect this. @@ -2625,7 +2653,16 @@ index ce7fb64..cdefb85 100644 %package -n yum-plugin-merge-conf Summary: Yum plugin to merge configuration changes when installing packages -@@ -395,9 +391,7 @@ plugins="\ +@@ -290,7 +287,7 @@ This plugin allows the user to run arbitrary actions immediately following a + transaction when specified packages are changed. + + %package -n yum-NetworkManager-dispatcher +-Summary: NetworkManager script which tells yum to check it's cache on network change ++Summary: NetworkManager script which tells yum to check its cache on network change + Group: System Environment/Base + Requires: yum >= 3.2.17 + +@@ -395,9 +392,7 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -2635,20 +2672,31 @@ index ce7fb64..cdefb85 100644 merge-conf \ security \ upgrade-helper \ -@@ -418,6 +412,12 @@ plugins="\ +@@ -418,14 +413,20 @@ plugins="\ puppetverify \ " +-mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ +%if %{package_yum_updatesd} +plugins="$plugins \ + refresh-updatesd \ +" +%endif + - mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ ++mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/%pluginhome mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/post-actions -@@ -469,8 +469,8 @@ fi + cd plugins + for plug in $plugins; do + install -m 644 $plug/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ +- install -m 644 $plug/*.py $RPM_BUILD_ROOT/usr/lib/yum-plugins/ +- %{__python} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/usr/lib/yum-plugins', 1)" ++ install -m 644 $plug/*.py $RPM_BUILD_ROOT/%pluginhome ++ %{__python} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/%pluginhome', 1)" + done + install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf + install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ +@@ -469,8 +470,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -2658,7 +2706,7 @@ index ce7fb64..cdefb85 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,6 +487,7 @@ fi +@@ -487,6 +488,7 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -2666,32 +2714,210 @@ index ce7fb64..cdefb85 100644 %{_mandir}/man8/yum-complete-transaction.8.* %{_mandir}/man1/yum-groups-manager.1.* %{_mandir}/man8/yumdb.8.* -@@ -533,23 +534,19 @@ fi - %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf - /usr/lib/yum-plugins/tsflags.* +@@ -502,7 +504,7 @@ fi + %defattr(-, root, root) + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf + %doc COPYING +-/usr/lib/yum-plugins/changelog.* ++%{pluginhome}/changelog.* + %{_mandir}/man1/yum-changelog.1.* + %{_mandir}/man5/yum-changelog.conf.5.* +@@ -510,20 +512,20 @@ fi + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf +-/usr/lib/yum-plugins/fastestmirror*.* ++%{pluginhome}/fastestmirror*.* + + %files -n yum-plugin-protectbase + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/protectbase.conf +-/usr/lib/yum-plugins/protectbase.* ++%{pluginhome}/protectbase.* + + %files -n yum-plugin-versionlock + %defattr(-, root, root) + %doc plugins/versionlock/README COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.conf + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.list +-/usr/lib/yum-plugins/versionlock.* ++%{pluginhome}/versionlock.* + %{_mandir}/man1/yum-versionlock.1.* + %{_mandir}/man5/yum-versionlock.conf.5.* + +@@ -531,85 +533,81 @@ fi + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf +-/usr/lib/yum-plugins/tsflags.* +- -%files -n yum-plugin-downloadonly -%defattr(-, root, root) -%doc COPYING -%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/downloadonly.conf -/usr/lib/yum-plugins/downloadonly.* -- ++%{pluginhome}/tsflags.* + %files -n yum-plugin-priorities %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/priorities.conf - /usr/lib/yum-plugins/priorities.* +-/usr/lib/yum-plugins/priorities.* ++%{pluginhome}/priorities.* +%if %{package_yum_updatesd} %files -n yum-plugin-refresh-updatesd %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/refresh-updatesd.conf - /usr/lib/yum-plugins/refresh-updatesd.* +-/usr/lib/yum-plugins/refresh-updatesd.* ++%{pluginhome}/refresh-updatesd.* +%endif %files -n yum-plugin-merge-conf %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf +-/usr/lib/yum-plugins/merge-conf.* ++%{pluginhome}/merge-conf.* + + %files -n yum-plugin-security + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/security.conf +-/usr/lib/yum-plugins/security.* ++%{pluginhome}/security.* + %{_mandir}/man8/yum-security.8.* + + %files -n yum-plugin-upgrade-helper + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/upgrade-helper.conf +-/usr/lib/yum-plugins/upgrade-helper.* ++%{pluginhome}/upgrade-helper.* + + %files -n yum-plugin-aliases + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/aliases.conf + %config(noreplace) %{_sysconfdir}/yum/aliases.conf +-/usr/lib/yum-plugins/aliases.* ++%{pluginhome}/aliases.* + %{_mandir}/man1/yum-aliases.1.* + + %files -n yum-plugin-list-data + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/list-data.conf +-/usr/lib/yum-plugins/list-data.* ++%{pluginhome}/list-data.* + %{_mandir}/man1/yum-list-data.1.* + + %files -n yum-plugin-filter-data + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/filter-data.conf +-/usr/lib/yum-plugins/filter-data.* ++%{pluginhome}/filter-data.* + %{_mandir}/man1/yum-filter-data.1.* + + %files -n yum-plugin-tmprepo + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tmprepo.conf +-/usr/lib/yum-plugins/tmprepo.* ++%{pluginhome}/tmprepo.* + + %files -n yum-plugin-verify + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/verify.conf +-/usr/lib/yum-plugins/verify.* ++%{pluginhome}/verify.* + %{_mandir}/man1/yum-verify.1.* + + %files -n yum-plugin-keys + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/keys.conf +-/usr/lib/yum-plugins/keys.* ++%{pluginhome}/keys.* + + %files -n yum-NetworkManager-dispatcher + %defattr(-, root, root) +@@ -619,13 +617,13 @@ fi + %files -n yum-plugin-remove-with-leaves + %defattr(-, root, root) + %doc COPYING +-/usr/lib/yum-plugins/remove-with-leaves.* ++%{pluginhome}/remove-with-leaves.* + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/remove-with-leaves.conf + + %files -n yum-plugin-post-transaction-actions + %defattr(-, root, root) + %doc COPYING +-/usr/lib/yum-plugins/post-transaction-actions.* ++%{pluginhome}/post-transaction-actions.* + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf + %doc plugins/post-transaction-actions/sample.action + # Default *.action file dropping dir. +@@ -634,19 +632,19 @@ fi + %files -n yum-plugin-rpm-warm-cache + %defattr(-, root, root) + %doc COPYING +-/usr/lib/yum-plugins/rpm-warm-cache.* ++%{pluginhome}/rpm-warm-cache.* + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/rpm-warm-cache.conf + + %files -n yum-plugin-auto-update-debug-info + %defattr(-, root, root) + %doc COPYING +-/usr/lib/yum-plugins/auto-update-debuginfo.* ++%{pluginhome}/auto-update-debuginfo.* + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/auto-update-debuginfo.conf + + %files -n yum-plugin-show-leaves + %defattr(-, root, root) + %doc COPYING +-/usr/lib/yum-plugins/show-leaves.* ++%{pluginhome}/show-leaves.* + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf + + %files -n yum-plugin-local +@@ -654,13 +652,13 @@ fi + %doc COPYING + %ghost %{_sysconfdir}/yum.repos.d/_local.repo + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf +-/usr/lib/yum-plugins/local.* ++%{pluginhome}/local.* + + %files -n yum-plugin-fs-snapshot + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fs-snapshot.conf +-/usr/lib/yum-plugins/fs-snapshot.* ++%{pluginhome}/fs-snapshot.* + %{_mandir}/man1/yum-fs-snapshot.1.* + %{_mandir}/man5/yum-fs-snapshot.conf.5.* + +@@ -668,13 +666,13 @@ fi + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf +-/usr/lib/yum-plugins/ps.* ++%{pluginhome}/ps.* + + %files -n yum-plugin-puppetverify + %defattr(-, root, root) + %doc COPYING + %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf +-/usr/lib/yum-plugins/puppetverify.* ++%{pluginhome}/puppetverify.* + + %changelog + * Thu Aug 10 2011 Tim Lauridsen diff --git a/yumdb.py b/yumdb.py index 8a4888e..4e549cd 100755 --- a/yumdb.py diff --git a/yum-utils.spec b/yum-utils.spec index 0950349..ab5c74b 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -5,11 +5,12 @@ %endif %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%define pluginhome /usr/lib/yum-plugins Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -288,7 +289,7 @@ This plugin allows the user to run arbitrary actions immediately following a transaction when specified packages are changed. %package -n yum-NetworkManager-dispatcher -Summary: NetworkManager script which tells yum to check it's cache on network change +Summary: NetworkManager script which tells yum to check its cache on network change Group: System Environment/Base Requires: yum >= 3.2.17 @@ -422,14 +423,14 @@ plugins="$plugins \ " %endif -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/%pluginhome mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/post-actions cd plugins for plug in $plugins; do install -m 644 $plug/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ - install -m 644 $plug/*.py $RPM_BUILD_ROOT/usr/lib/yum-plugins/ - %{__python} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/usr/lib/yum-plugins', 1)" + install -m 644 $plug/*.py $RPM_BUILD_ROOT/%pluginhome + %{__python} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/%pluginhome', 1)" done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ @@ -507,7 +508,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING -/usr/lib/yum-plugins/changelog.* +%{pluginhome}/changelog.* %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* @@ -515,20 +516,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf -/usr/lib/yum-plugins/fastestmirror*.* +%{pluginhome}/fastestmirror*.* %files -n yum-plugin-protectbase %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/protectbase.conf -/usr/lib/yum-plugins/protectbase.* +%{pluginhome}/protectbase.* %files -n yum-plugin-versionlock %defattr(-, root, root) %doc plugins/versionlock/README COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.conf %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.list -/usr/lib/yum-plugins/versionlock.* +%{pluginhome}/versionlock.* %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* @@ -536,81 +537,81 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf -/usr/lib/yum-plugins/tsflags.* +%{pluginhome}/tsflags.* %files -n yum-plugin-priorities %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/priorities.conf -/usr/lib/yum-plugins/priorities.* +%{pluginhome}/priorities.* %if %{package_yum_updatesd} %files -n yum-plugin-refresh-updatesd %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/refresh-updatesd.conf -/usr/lib/yum-plugins/refresh-updatesd.* +%{pluginhome}/refresh-updatesd.* %endif %files -n yum-plugin-merge-conf %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf -/usr/lib/yum-plugins/merge-conf.* +%{pluginhome}/merge-conf.* %files -n yum-plugin-security %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/security.conf -/usr/lib/yum-plugins/security.* +%{pluginhome}/security.* %{_mandir}/man8/yum-security.8.* %files -n yum-plugin-upgrade-helper %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/upgrade-helper.conf -/usr/lib/yum-plugins/upgrade-helper.* +%{pluginhome}/upgrade-helper.* %files -n yum-plugin-aliases %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/aliases.conf %config(noreplace) %{_sysconfdir}/yum/aliases.conf -/usr/lib/yum-plugins/aliases.* +%{pluginhome}/aliases.* %{_mandir}/man1/yum-aliases.1.* %files -n yum-plugin-list-data %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/list-data.conf -/usr/lib/yum-plugins/list-data.* +%{pluginhome}/list-data.* %{_mandir}/man1/yum-list-data.1.* %files -n yum-plugin-filter-data %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/filter-data.conf -/usr/lib/yum-plugins/filter-data.* +%{pluginhome}/filter-data.* %{_mandir}/man1/yum-filter-data.1.* %files -n yum-plugin-tmprepo %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tmprepo.conf -/usr/lib/yum-plugins/tmprepo.* +%{pluginhome}/tmprepo.* %files -n yum-plugin-verify %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/verify.conf -/usr/lib/yum-plugins/verify.* +%{pluginhome}/verify.* %{_mandir}/man1/yum-verify.1.* %files -n yum-plugin-keys %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/keys.conf -/usr/lib/yum-plugins/keys.* +%{pluginhome}/keys.* %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) @@ -620,13 +621,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING -/usr/lib/yum-plugins/remove-with-leaves.* +%{pluginhome}/remove-with-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/remove-with-leaves.conf %files -n yum-plugin-post-transaction-actions %defattr(-, root, root) %doc COPYING -/usr/lib/yum-plugins/post-transaction-actions.* +%{pluginhome}/post-transaction-actions.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. @@ -635,19 +636,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING -/usr/lib/yum-plugins/rpm-warm-cache.* +%{pluginhome}/rpm-warm-cache.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/rpm-warm-cache.conf %files -n yum-plugin-auto-update-debug-info %defattr(-, root, root) %doc COPYING -/usr/lib/yum-plugins/auto-update-debuginfo.* +%{pluginhome}/auto-update-debuginfo.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/auto-update-debuginfo.conf %files -n yum-plugin-show-leaves %defattr(-, root, root) %doc COPYING -/usr/lib/yum-plugins/show-leaves.* +%{pluginhome}/show-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local @@ -655,13 +656,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf -/usr/lib/yum-plugins/local.* +%{pluginhome}/local.* %files -n yum-plugin-fs-snapshot %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fs-snapshot.conf -/usr/lib/yum-plugins/fs-snapshot.* +%{pluginhome}/fs-snapshot.* %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* @@ -669,18 +670,24 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf -/usr/lib/yum-plugins/ps.* +%{pluginhome}/ps.* %files -n yum-plugin-puppetverify %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf -/usr/lib/yum-plugins/puppetverify.* +%{pluginhome}/puppetverify.* %changelog -* Wed Nov 21 2012 Zdenek Pavlas - 1.1.31-8 +* Wed Nov 21 2013 Zdenek Pavlas - 1.1.31-9 +- Update to latest HEAD. +- Added pluginhome %define to get rid of hardcoded paths +- Fix yum-NetworkManager-dispatcher description, BZ 894729 +- reposync should lock. BZ 880722 +- Initialize exit_code correctly. BZ 882536 + +* Mon Jan 14 2013 Zdenek Pavlas - 1.1.31-8 - Update to latest HEAD. -- Remove downloadonly plugin. * Wed Aug 8 2012 Zdenek Pavlas - 1.1.31-7 - Update to latest HEAD. From df71791f460acdf45919f13891b5ace4ac510f97 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Mon, 14 Jan 2013 13:42:40 +0100 Subject: [PATCH 04/55] rm auto-update-debuginfo.patch (already merged) --- auto-update-debuginfo.patch | 24 ------------------------ yum-utils.spec | 2 -- 2 files changed, 26 deletions(-) delete mode 100644 auto-update-debuginfo.patch diff --git a/auto-update-debuginfo.patch b/auto-update-debuginfo.patch deleted file mode 100644 index 5c3e5aa..0000000 --- a/auto-update-debuginfo.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Zdeněk Pavlas -Date: Thu, 11 Aug 2011 12:34:42 +0000 (+0200) -Subject: Fix check for repos in opts, in auto-update-debuginfo plugin. BZ 729964. -X-Git-Url: http://yum.baseurl.org/gitweb?p=yum-utils.git;a=commitdiff_plain;h=efb3c7b3fb96523bb5997c163bf4e33ab897f1b8 - - Fix check for repos in opts, in auto-update-debuginfo plugin. BZ 729964. - - Also hasattr(None, 'repos') == False, so we don't need -to check for None explicitly. ---- - -diff --git a/plugins/auto-update-debuginfo/auto-update-debuginfo.py b/plugins/auto-update-debuginfo/auto-update-debuginfo.py -index 39993ad..9ff927c 100644 ---- a/plugins/auto-update-debuginfo/auto-update-debuginfo.py -+++ b/plugins/auto-update-debuginfo/auto-update-debuginfo.py -@@ -38,7 +38,7 @@ def _check_man_disable(mdrs, di): - def enable_debuginfo_repos(yb, conduit): - mdrs = set() - opts, args = conduit.getCmdLine() -- if opts is not None and hasattr(opts.repos) : -+ if hasattr(opts, 'repos'): - for opt, repoexp in opts.repos: - if opt == '--disablerepo': - mdrs.add(repoexp) diff --git a/yum-utils.spec b/yum-utils.spec index ab5c74b..569cb5b 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -14,7 +14,6 @@ Release: 9%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz -Patch0: auto-update-debuginfo.patch Patch1: yum-utils-HEAD.patch URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -379,7 +378,6 @@ Supplies checksums for files in packages from puppet's state file. %prep %setup -q -# patch0 -p1 %patch1 -p1 %install From ba31af680e74319e8269d17aff4fe55cdd2fc4c3 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Wed, 6 Feb 2013 10:26:53 +0100 Subject: [PATCH 05/55] Update to latest HEAD --- yum-utils-HEAD.patch | 116 +++++++++++++++++++++++++++++++++++-------- yum-utils.spec | 8 ++- 2 files changed, 102 insertions(+), 22 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index bb499ec..6e01019 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -621,6 +621,26 @@ index 7e260b0..9c8dbf3 100644 +The update-minimal command can only directly affect things atm., so if you update pkgA minimally but that requires an update to pkgB then pkgB will be updated to the newest version by the depsolver. Also the above will happen even if you've also minimally updated pkgB, if either the direct (minimal) update for pkgB happens after or if the minimal update for pkgB doesn't satisfy the requirements of pkgA. The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "--bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. +diff --git a/docs/yum-utils.1 b/docs/yum-utils.1 +index fa830b6..fdfbe24 100644 +--- a/docs/yum-utils.1 ++++ b/docs/yum-utils.1 +@@ -15,6 +15,7 @@ yum\-utils \- tools for manipulating repositories and extended package managemen + \fBrepoquery\fR \- query yum repositories and get additional information on the them + \fBreposync\fR \- synchronize a remote yum repository to a local directory using yum to retrieve packages + \fBrepotrack\fR \- track packages and its dependencies and downloads them ++\fBshow-changed-rco\fR \- list of changes to a package Requires, Conflicts and Obsoletes data from installed to a specified rpm file + \fBshow-installed\fR \- gives a compact description of packages installed and makes use of comps groups in repositories + \fBverifytree\fR - verify that a local yum repository is consistent + \fByum\-builddep\fR \- installs missing dependencies to build a specified package +@@ -32,6 +33,6 @@ is a collection of tools and programs for managing yum repositories, installing + .SH "NOTES" + See respective tools for additional help for commands without a manual page + .SH "SEE ALSO" +-debuginfo\-install(1), package\-cleanup(1), repodiff(1), repoquery(1), reposync(1), repo\-rss(1), yumdownloader(1), yum\-builddep(1), yum\-debug\-dump(1), yum\-groups\-manager(1), yumdb(8), yum\-complete\-transaction(8) ++debuginfo\-install(1), package\-cleanup(1), repodiff(1), repoquery(1), reposync(1), repo\-rss(1), show\-changed\-rco(1), show\-installed(1), yumdownloader(1), yum\-builddep(1), yum\-debug\-dump(1), yum\-groups\-manager(1), yumdb(8), yum\-complete\-transaction(8) + .SH "AUTHOR" + Shawn Starr diff --git a/docs/yum-verify.1 b/docs/yum-verify.1 index 706c38e..50ede75 100644 --- a/docs/yum-verify.1 @@ -1436,7 +1456,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..a854c23 100755 +index a3bb111..45c6826 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -1528,7 +1548,16 @@ index a3bb111..a854c23 100755 __req2pkgs = {} def req2pkgs(ignore, req): req = str(req) -@@ -413,14 +432,9 @@ class pkgQuery: +@@ -406,6 +425,8 @@ class pkgQuery: + providers = matches.keys() + + ++ except yum.Errors.RepoError: ++ raise + except yum.Errors.YumBaseError, err: + print >>sys.stderr, "No package provides %s" % req + return [] +@@ -413,14 +434,9 @@ class pkgQuery: __req2pkgs[req] = providers return providers @@ -1544,7 +1573,7 @@ index a3bb111..a854c23 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -449,6 +463,7 @@ class pkgQuery: +@@ -449,6 +465,7 @@ class pkgQuery: def fmt_tree_obsoletes(self, **kw): pkg = kw.get('pkg', self.pkg) @@ -1552,7 +1581,7 @@ index a3bb111..a854c23 100755 level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) -@@ -457,6 +472,7 @@ class pkgQuery: +@@ -457,6 +474,7 @@ class pkgQuery: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -1560,7 +1589,7 @@ index a3bb111..a854c23 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -467,6 +483,15 @@ class pkgQuery: +@@ -467,6 +485,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -1576,7 +1605,7 @@ index a3bb111..a854c23 100755 def obs2pkgs(): if self.yb is None: return [] -@@ -496,10 +521,7 @@ class pkgQuery: +@@ -496,10 +523,7 @@ class pkgQuery: else: reason = 'cmd line' rpkgs = obs2pkgs() @@ -1588,7 +1617,7 @@ index a3bb111..a854c23 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 all_reqs[pkg] = None -@@ -514,6 +536,7 @@ class pkgQuery: +@@ -514,6 +538,7 @@ class pkgQuery: self._tree_print_req(rpkg, '', nlevel) continue self.fmt_tree_obsoletes(pkg=rpkg, level=nlevel, all_reqs=all_reqs, @@ -1596,7 +1625,7 @@ index a3bb111..a854c23 100755 tree_level = kw['tree_level'], output = kw['output'], dot = dot) -@@ -527,6 +550,7 @@ class pkgQuery: +@@ -527,6 +552,7 @@ class pkgQuery: if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() @@ -1604,7 +1633,7 @@ index a3bb111..a854c23 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -537,6 +561,15 @@ class pkgQuery: +@@ -537,6 +563,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -1620,7 +1649,16 @@ index a3bb111..a854c23 100755 __prov2pkgs = {} def prov2pkgs(prov, ignore): if str(prov) in __prov2pkgs: -@@ -575,12 +608,8 @@ class pkgQuery: +@@ -562,6 +597,8 @@ class pkgQuery: + arequirers = [pkg for pkg in areqs + if pkg.pkgtup not in skip] + ++ except yum.Errors.RepoError: ++ raise + except yum.Errors.YumBaseError, err: + print >>sys.stderr, "No package provides %s" % str(prov) + return [] +@@ -575,12 +612,8 @@ class pkgQuery: tups = pkg.provides + filetupes rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, prov2pkgs) @@ -1634,7 +1672,7 @@ index a3bb111..a854c23 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -719,13 +748,13 @@ class groupQuery: +@@ -719,13 +752,13 @@ class groupQuery: raise queryError("Invalid group query: %s" % method) # XXX temporary hack to make --group -a query work @@ -1651,7 +1689,7 @@ index a3bb111..a854c23 100755 pkgs = [] for t in self.grouppkgs.split(','): if t == "mandatory": -@@ -741,10 +770,10 @@ class groupQuery: +@@ -741,10 +774,10 @@ class groupQuery: return pkgs @@ -1664,7 +1702,7 @@ index a3bb111..a854c23 100755 return ["%s:\n\n%s\n" % (self.name, self.group.description)] -@@ -826,6 +855,8 @@ class YumBaseQuery(yum.YumBase): +@@ -826,6 +859,8 @@ class YumBaseQuery(yum.YumBase): pkgs = self.pkgSack.returnNewestByNameArch(**kwargs) except yum.Errors.PackageSackError: pkgs = [] @@ -1673,7 +1711,16 @@ index a3bb111..a854c23 100755 else: what = self.options.pkgnarrow ygh = self.doPackageLists(what, **kwargs) -@@ -1008,12 +1039,12 @@ class YumBaseQuery(yum.YumBase): +@@ -848,6 +883,8 @@ class YumBaseQuery(yum.YumBase): + matches = yum.YumBase.searchPackageProvides(self, [str(depstring)]) + provider = matches.keys() + # provider.extend(yum.YumBase.returnPackagesByDep(self, depstring)) ++ except yum.Errors.RepoError: ++ raise + except yum.Errors.YumBaseError, err: + self.logger.error("No package provides %s" % depstring) + return self.queryPkgFactory(provider) +@@ -1008,12 +1045,12 @@ class YumBaseQuery(yum.YumBase): def fmt_whatrequires(self, name, **kw): pkgs = {} @@ -1688,7 +1735,7 @@ index a3bb111..a854c23 100755 provs = [name] -@@ -1054,10 +1085,21 @@ class YumBaseQuery(yum.YumBase): +@@ -1054,10 +1091,21 @@ class YumBaseQuery(yum.YumBase): def fmt_requires(self, name, **kw): pkgs = {} @@ -1711,7 +1758,7 @@ index a3bb111..a854c23 100755 return pkgs.values() def fmt_location(self, name): -@@ -1070,6 +1112,44 @@ class YumBaseQuery(yum.YumBase): +@@ -1070,6 +1118,44 @@ class YumBaseQuery(yum.YumBase): loc.append("%s/%s" % (repo.urls[0], pkg['relativepath'])) return loc @@ -1756,7 +1803,7 @@ index a3bb111..a854c23 100755 def main(args): -@@ -1198,6 +1278,9 @@ def main(args): +@@ -1198,6 +1284,9 @@ def main(args): parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") @@ -1766,7 +1813,7 @@ index a3bb111..a854c23 100755 (opts, regexs) = parser.parse_args() -@@ -1261,9 +1344,10 @@ def main(args): +@@ -1261,9 +1350,10 @@ def main(args): if opts.srpm: needsource = 1 if opts.whatrequires: @@ -1778,7 +1825,7 @@ index a3bb111..a854c23 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1303,6 +1387,13 @@ def main(args): +@@ -1303,6 +1393,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -1792,7 +1839,7 @@ index a3bb111..a854c23 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1314,6 +1405,20 @@ def main(args): +@@ -1314,6 +1411,20 @@ def main(args): repoq.preconf.init_plugins = opts.plugins repoq.conf @@ -1813,6 +1860,22 @@ index a3bb111..a854c23 100755 if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: +@@ -1396,10 +1507,15 @@ def main(args): + except (yum.Errors.RepoError, yum.Errors.GroupsError), e: + repoq.logger.error(e) + sys.exit(1) ++ + try: + repoq.runQuery(regexs) ++ except yum.Errors.RepoError, e: ++ repoq.logger.error(e) ++ sys.exit(1) + except queryError, e: + repoq.logger.error(e) ++ sys.exit(1) + + if __name__ == "__main__": + misc.setup_locale() diff --git a/reposync.py b/reposync.py index 7950854..a749973 100755 --- a/reposync.py @@ -2293,6 +2356,19 @@ index c5074ab..b61df9c 100755 VERSION = '1.0' USAGE = """ yum-complete-transaction: completes unfinished yum transactions which occur due to error, failure +diff --git a/yum-config-manager.py b/yum-config-manager.py +index 50f5123..aed64a2 100755 +--- a/yum-config-manager.py ++++ b/yum-config-manager.py +@@ -153,7 +153,7 @@ if (not args and not opts.addrepo) or 'main' in args: + ybc = yb.conf + writeRawConfigFile(fn, 'main', ybc.yumvar, + ybc.cfg.options, ybc.iteritems, ybc.optionobj, +- only) ++ only=yb.main_setopts.items) + + if opts.enable or opts.disable: + opts.save = True diff --git a/yum-debug-dump.py b/yum-debug-dump.py index 4653f3c..67d943f 100755 --- a/yum-debug-dump.py diff --git a/yum-utils.spec b/yum-utils.spec index 569cb5b..8df6c68 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 9%{?dist} +Release: 10%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,7 +677,11 @@ fi %{pluginhome}/puppetverify.* %changelog -* Wed Nov 21 2013 Zdenek Pavlas - 1.1.31-9 +* Wed Feb 6 2013 Zdenek Pavlas - 1.1.31-10 +- Update to latest HEAD +- Small fixes in documentation and error handling + +* Mon Jan 14 2013 Zdenek Pavlas - 1.1.31-9 - Update to latest HEAD. - Added pluginhome %define to get rid of hardcoded paths - Fix yum-NetworkManager-dispatcher description, BZ 894729 From 835165acb2a5ed6b776920ae84e017eb2e7f31d8 Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 11 Mar 2013 14:33:01 -0400 Subject: [PATCH 06/55] Add helper scripts from yum. --- commit-build.sh | 6 ++++++ diff-specs.sh | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100755 commit-build.sh create mode 100755 diff-specs.sh diff --git a/commit-build.sh b/commit-build.sh new file mode 100755 index 0000000..7094099 --- /dev/null +++ b/commit-build.sh @@ -0,0 +1,6 @@ +#! /bin/sh -e + +fedpkg clog +git commit -a -F clog +git push +fedpkg build diff --git a/diff-specs.sh b/diff-specs.sh new file mode 100755 index 0000000..fd23347 --- /dev/null +++ b/diff-specs.sh @@ -0,0 +1,7 @@ +#! /bin/sh -e + +# yum-utils-3.4.3-44.fc19 +ver=$(/usr/bin/fedpkg verrel | perl -lpe 's/-[^-]+$//') + +fedpkg prep > /dev/null +diff -u yum-utils.spec $ver/yum-utils.spec From f110a25042aa9098a479dce60f243c52ccbb1a1b Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 11 Mar 2013 14:37:45 -0400 Subject: [PATCH 07/55] Update to latest HEAD. - FS snapshot fixes, and thin provisioning support. - search-quiet for yumdb. --- yum-utils-HEAD.patch | 160 ++++++++++++++++++++++++++++++++++++++++--- yum-utils.spec | 9 ++- 2 files changed, 158 insertions(+), 11 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 6e01019..cf4abcb 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -480,6 +480,20 @@ index 6d7f1e4..b26f1fd 100644 Apart from that there are no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful +diff --git a/docs/yum-fs-snapshot.conf.5 b/docs/yum-fs-snapshot.conf.5 +index a4b4f02..dc5c0c1 100644 +--- a/docs/yum-fs-snapshot.conf.5 ++++ b/docs/yum-fs-snapshot.conf.5 +@@ -28,7 +28,8 @@ created for filesystems built on LVM logical volumes. + .IP lvcreate_size_args + This is the space delimited lvcreate argument list that is used to + specify the size of the snapshot LV. Valid lvcreate size options are -l +-or -L. If not specified then LVM snapshots will not be created. ++or -L. If not specified then LVM snapshots will not be created for ++volumes that are not thinly provisioned. + .SH AUTHOR + .RS + Josef Bacik diff --git a/docs/yum-groups-manager.1 b/docs/yum-groups-manager.1 index f49bde9..c256c45 100644 --- a/docs/yum-groups-manager.1 @@ -1016,7 +1030,7 @@ index b3aed61..82a43d5 100644 # Modified by Jack Neely to return a kernel provides tuple """This takes the output of uname and figures out the (version, release) diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py -index 5094881..ef4afe8 100644 +index 5094881..7483c2d 100644 --- a/plugins/fs-snapshot/fs-snapshot.py +++ b/plugins/fs-snapshot/fs-snapshot.py @@ -21,7 +21,7 @@ This plugin creates a snapshot before any yum update or yum remove operation on @@ -1028,6 +1042,80 @@ index 5094881..ef4afe8 100644 snapshot takes place will not be in the snapshot. You of course can mount the newer version elsewhere and copy the new versions of the files back to your rolled-back snapshot. You have been warned. +@@ -62,6 +62,9 @@ def kernel_supports_dm_snapshot_merge(): + dm_snapshot_merge_checked = 1 + return dm_snapshot_merge_support + ++def is_thin_volume(volume): ++ return volume["segtype"] == "thin" ++ + def inspect_volume_lvm(conduit, volume): + """ + If volume is an LVM logical volume: +@@ -80,7 +83,7 @@ def inspect_volume_lvm(conduit, volume): + # convert /dev/mapper name to /dev/vg/lv for use with LVM2 tools + # - 'dmsetup splitname' will collapse any escaped characters + p = Popen(["/sbin/dmsetup", "splitname", "--separator", "/", +- "--noheadings", ++ "--noheadings", "-c", + "-o", "vg_name,lv_name", device], stdout=PIPE, stderr=PIPE) + err = p.wait() + if err: +@@ -92,12 +95,14 @@ def inspect_volume_lvm(conduit, volume): + # Check if device is managed by lvm + # - FIXME filter out snapshot (and other) LVs; for now just rely + # on 'lvcreate' to prevent snapshots of unsupported LV types +- p = Popen(["/sbin/lvs", device], stdout=PIPE, stderr=PIPE) ++ p = Popen(["/sbin/lvs", "--noheadings", "-o", "segtype", device], stdout=PIPE, stderr=PIPE) + err = p.wait() + if not err: ++ volume["segtype"] = p.communicate()[0].strip() ++ + # FIXME allow creating snapshot LVs even if kernel doesn't + # support snapshot-merge based system rollback? make configurable? +- if not kernel_supports_dm_snapshot_merge(): ++ if not is_thin_volume(volume) and not kernel_supports_dm_snapshot_merge(): + conduit.error(1, "fs-snapshot: skipping volume: %s, " + "kernel doesn't support snapshot-merge" % device) + return 0 +@@ -223,16 +228,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): + has enough free space to accommodate a snapshot LV. + - Also assumes user has configured 'lvcreate_size_args'. + """ +- lvcreate_size_args = conduit.confString('lvm', 'lvcreate_size_args', +- default=None) +- if not lvcreate_size_args: +- conduit.error(1, "fs-snapshot: 'lvcreate_size_args' was not provided " +- "in the '[lvm]' section of the config file") +- return 1 ++ if not is_thin_volume(volume): ++ lvcreate_size_args = conduit.confString('lvm', 'lvcreate_size_args', ++ default=None) + +- if not lvcreate_size_args.startswith("-L") and not lvcreate_size_args.startswith("-l"): +- conduit.error(1, "fs-snapshot: 'lvcreate_size_args' did not use -L or -l") +- return 1 ++ if not lvcreate_size_args: ++ conduit.error(1, "fs-snapshot: 'lvcreate_size_args' was not provided " ++ "in the '[lvm]' section of the config file") ++ return 1 ++ ++ if not lvcreate_size_args.startswith("-L") and not lvcreate_size_args.startswith("-l"): ++ conduit.error(1, "fs-snapshot: 'lvcreate_size_args' did not use -L or -l") ++ return 1 + + device = volume["device"] + if device.count('/') != 3: +@@ -259,7 +266,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): + (mntpnt, device, snap_lvname)) + # Create snapshot LV + lvcreate_cmd = ["/sbin/lvcreate", "-s", "-n", snap_lvname] +- lvcreate_cmd.extend(lvcreate_size_args.split()) ++ if not is_thin_volume(volume): ++ lvcreate_cmd.extend(lvcreate_size_args.split()) + lvcreate_cmd.append(device) + p = Popen(lvcreate_cmd, stdout=PIPE, stderr=PIPE) + err = p.wait() diff --git a/plugins/keys/keys.py b/plugins/keys/keys.py index 3342576..4d2ca96 100644 --- a/plugins/keys/keys.py @@ -1456,7 +1544,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..45c6826 100755 +index a3bb111..0d3e33c 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -1825,7 +1913,15 @@ index a3bb111..45c6826 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1303,6 +1393,13 @@ def main(args): +@@ -1280,7 +1370,6 @@ def main(args): + needgroup = 1 + if opts.installed: + opts.pkgnarrow = 'installed' +- opts.disablerepos = ['*'] + + if opts.nevra: + pkgops.append("nevra") +@@ -1303,6 +1392,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -1839,7 +1935,7 @@ index a3bb111..45c6826 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1314,6 +1411,20 @@ def main(args): +@@ -1314,6 +1410,20 @@ def main(args): repoq.preconf.init_plugins = opts.plugins repoq.conf @@ -1860,7 +1956,21 @@ index a3bb111..45c6826 100755 if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: -@@ -1396,10 +1507,15 @@ def main(args): +@@ -1359,6 +1469,13 @@ def main(args): + if opts.show_dupes: + repoq.conf.showdupesfromrepos = True + ++ ++ if opts.pkgnarrow == 'installed': ++ # Just use a blunt hammer here, to make everyone sane: ++ opts.repoid = [] ++ opts.disablerepos = ['*'] ++ opts.enablerepos = [] ++ + if opts.repoid: + found_repos = set() + for repo in repoq.repos.findRepos('*'): +@@ -1396,10 +1513,15 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -2995,7 +3105,7 @@ index ce7fb64..16b568e 100644 %changelog * Thu Aug 10 2011 Tim Lauridsen diff --git a/yumdb.py b/yumdb.py -index 8a4888e..4e549cd 100755 +index 8a4888e..c50159e 100755 --- a/yumdb.py +++ b/yumdb.py @@ -7,8 +7,24 @@ import fnmatch @@ -3031,7 +3141,32 @@ index 8a4888e..4e549cd 100755 shell [filename]... """ parser = optparse.OptionParser(usage = usage_txt, version = vers_txt) -@@ -183,6 +200,14 @@ def run_cmd(yb, args, inshell=False): +@@ -99,8 +116,8 @@ def run_cmd(yb, args, inshell=False): + delattr(pkg.yumdb_info, ykey) + print pkg + print " " * 4, ykey, '' +- elif args[0] == 'search' and len(args) > 2: +- args.pop(0) ++ elif args[0] in ('search', 'search-q', 'search-quiet') and len(args) > 2: ++ cmd = args.pop(0) + ykey = args.pop(0) + done = False + # Maybe need some API so we don't have to load everything? +@@ -115,10 +132,11 @@ def run_cmd(yb, args, inshell=False): + break + if not found: + continue +- if done: print '' ++ if done and cmd == 'search': print '' + done = True + print pkg +- print " " * 4, ykey, '=', yval ++ if cmd == 'search': ++ print " " * 4, ykey, '=', yval + elif args[0] in ['exist?', 'exist', 'exists'] and len(args) > 1: + args.pop(0) + ykey = args.pop(0) +@@ -183,6 +201,14 @@ def run_cmd(yb, args, inshell=False): if ykey not in ndata: continue print " " * 4, ykey, '=', getattr(pkg.yumdb_info, ykey) @@ -3047,7 +3182,7 @@ index 8a4888e..4e549cd 100755 args.pop(0) if args: diff --git a/yumdownloader.py b/yumdownloader.py -index e6107d4..ba17edd 100755 +index e6107d4..990ab85 100755 --- a/yumdownloader.py +++ b/yumdownloader.py @@ -7,11 +7,11 @@ @@ -3139,7 +3274,14 @@ index e6107d4..ba17edd 100755 def downloadPackages(self,opts): -@@ -216,52 +192,30 @@ class YumDownloader(YumUtilBase): +@@ -211,57 +187,35 @@ class YumDownloader(YumUtilBase): + self.resolveDeps() + # Add newly added packages to the toDownload list + for pkg in self.tsInfo.getMembers(): +- if not pkg in toDownload: +- toDownload.append(pkg) ++ if pkg.ts_state in ('i', 'u') and pkg.po not in toDownload: ++ toDownload.append(pkg.po) if len(toDownload) == 0: self.logger.error('Nothing to download') sys.exit(1) diff --git a/yum-utils.spec b/yum-utils.spec index 8df6c68..e33cb71 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,13 +677,18 @@ fi %{pluginhome}/puppetverify.* %changelog +* Mon Mar 11 2013 James Antill - 1.1.31-11 +- Update to latest HEAD. +- FS snapshot fixes, and thin provisioning support. +- search-quiet for yumdb. + * Wed Feb 6 2013 Zdenek Pavlas - 1.1.31-10 - Update to latest HEAD - Small fixes in documentation and error handling * Mon Jan 14 2013 Zdenek Pavlas - 1.1.31-9 - Update to latest HEAD. -- Added pluginhome %define to get rid of hardcoded paths +- Added pluginhome define to get rid of hardcoded paths - Fix yum-NetworkManager-dispatcher description, BZ 894729 - reposync should lock. BZ 880722 - Initialize exit_code correctly. BZ 882536 From d28faaa455202cec2d420b7f413b5fc8eb095122 Mon Sep 17 00:00:00 2001 From: James Antill Date: Tue, 12 Mar 2013 14:48:30 -0400 Subject: [PATCH 08/55] Update to latest HEAD. - FS snapshot tweaks for snapper support. --- yum-utils-HEAD.patch | 98 +++++++++++++++++++++++++++++++++++++++++--- yum-utils.spec | 6 ++- 2 files changed, 98 insertions(+), 6 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index cf4abcb..22a3c1c 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -481,10 +481,21 @@ index 6d7f1e4..b26f1fd 100644 Apart from that there are no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful diff --git a/docs/yum-fs-snapshot.conf.5 b/docs/yum-fs-snapshot.conf.5 -index a4b4f02..dc5c0c1 100644 +index a4b4f02..4ac623a 100644 --- a/docs/yum-fs-snapshot.conf.5 +++ b/docs/yum-fs-snapshot.conf.5 -@@ -28,7 +28,8 @@ created for filesystems built on LVM logical volumes. +@@ -20,6 +20,10 @@ utilizes configuration options in the form of + .IP exclude + This is a space delimited list of the mount points you do not wish to have + snapshotted by this plugin. ++.SH OPTION ++.IP create_snapshots_in_post ++This is a boolean value used to control whether snapshots are also created ++after running the yum transaction. + .SH OPTION - [lvm] section + .IP enabled + This is a boolean value used to control whether LVM snapshots will be +@@ -28,7 +32,8 @@ created for filesystems built on LVM logical volumes. .IP lvcreate_size_args This is the space delimited lvcreate argument list that is used to specify the size of the snapshot LV. Valid lvcreate size options are -l @@ -1029,8 +1040,19 @@ index b3aed61..82a43d5 100644 # Copyright 2005 Red Hat, Inc. # Modified by Jack Neely to return a kernel provides tuple """This takes the output of uname and figures out the (version, release) +diff --git a/plugins/fs-snapshot/fs-snapshot.conf b/plugins/fs-snapshot/fs-snapshot.conf +index 3a67c69..9ada717 100644 +--- a/plugins/fs-snapshot/fs-snapshot.conf ++++ b/plugins/fs-snapshot/fs-snapshot.conf +@@ -1,5 +1,6 @@ + [main] + enabled = 1 ++create_snapshots_in_post = 0 + + [lvm] + enabled = 0 diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py -index 5094881..7483c2d 100644 +index 5094881..8099b19 100644 --- a/plugins/fs-snapshot/fs-snapshot.py +++ b/plugins/fs-snapshot/fs-snapshot.py @@ -21,7 +21,7 @@ This plugin creates a snapshot before any yum update or yum remove operation on @@ -1078,7 +1100,22 @@ index 5094881..7483c2d 100644 conduit.error(1, "fs-snapshot: skipping volume: %s, " "kernel doesn't support snapshot-merge" % device) return 0 -@@ -223,16 +228,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -216,6 +221,14 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): + return 1 + return 2 + ++def add_lvm_tag_to_snapshot(conduit, tag, snap_volume): ++ p = Popen(["/sbin/lvchange", "--addtag", tag, snap_volume], ++ stdout=PIPE, stderr=PIPE) ++ err = p.wait() ++ if err: ++ conduit.error(1, "fs-snapshot: couldn't add tag to snapshot: %s" % ++ snap_volume) ++ + def _create_lvm_snapshot(conduit, snapshot_tag, volume): + """ + Create LVM snapshot LV and tag it with $snapshot_tag. +@@ -223,16 +236,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): has enough free space to accommodate a snapshot LV. - Also assumes user has configured 'lvcreate_size_args'. """ @@ -1106,7 +1143,7 @@ index 5094881..7483c2d 100644 device = volume["device"] if device.count('/') != 3: -@@ -259,7 +266,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -259,7 +274,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): (mntpnt, device, snap_lvname)) # Create snapshot LV lvcreate_cmd = ["/sbin/lvcreate", "-s", "-n", snap_lvname] @@ -1116,6 +1153,57 @@ index 5094881..7483c2d 100644 lvcreate_cmd.append(device) p = Popen(lvcreate_cmd, stdout=PIPE, stderr=PIPE) err = p.wait() +@@ -270,16 +286,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): + # Add tag ($snapshot_tag) to snapshot LV + # - should help facilitate merge of all snapshot LVs created + # by a yum transaction, e.g.: lvconvert --merge @snapshot_tag +- p = Popen(["/sbin/lvchange", "--addtag", snapshot_tag, snap_device], +- stdout=PIPE, stderr=PIPE) +- err = p.wait() +- if err: +- conduit.error(1, "fs-snapshot: couldn't add tag to snapshot: %s" % +- snap_device) ++ if add_lvm_tag_to_snapshot(conduit, snapshot_tag, snap_device): + return 1 ++ if conduit._base.__plugin_fs_snapshot_post_snapshot_tag == snapshot_tag: ++ # Add tag to allow other tools (e.g. snapper) to link pre ++ # and post snapshot LVs together ++ pre_snap_lv_name = "%s_%s" % (device, conduit._base.__plugin_fs_snapshot_pre_snapshot_tag) ++ pre_snapshot_tag = "yum_fs_snapshot_pre_lv_name=" + pre_snap_lv_name ++ if add_lvm_tag_to_snapshot(conduit, pre_snapshot_tag, snap_device): ++ return 1 + return 2 + +-def pretrans_hook(conduit): ++def create_snapshots(conduit): + """ + This runs before the transaction starts. Try to snapshot anything and + everything that is snapshottable, since we do not know what an RPM will +@@ -287,6 +305,10 @@ def pretrans_hook(conduit): + """ + # common snapshot tag format: yum_${year}${month}${day}${hour}${minute}${sec} + snapshot_tag = "yum_" + time.strftime("%Y%m%d%H%M%S") ++ if not conduit._base.__plugin_fs_snapshot_pre_snapshot_tag: ++ conduit._base.__plugin_fs_snapshot_pre_snapshot_tag = snapshot_tag ++ else: ++ conduit._base.__plugin_fs_snapshot_post_snapshot_tag = snapshot_tag + + volumes = get_volumes(conduit) + for volume in volumes: +@@ -296,3 +318,13 @@ def pretrans_hook(conduit): + elif rc == 2 and hasattr(conduit, 'registerPackageName'): + # A snapshot was successfully created + conduit.registerPackageName("yum-plugin-fs-snapshot") ++ ++def pretrans_hook(conduit): ++ conduit._base.__plugin_fs_snapshot_pre_snapshot_tag = None ++ conduit._base.__plugin_fs_snapshot_post_snapshot_tag = None ++ create_snapshots(conduit) ++ ++def posttrans_hook(conduit): ++ create_snapshots_in_post = conduit.confBool('main', 'create_snapshots_in_post', default=0) ++ if create_snapshots_in_post: ++ create_snapshots(conduit) diff --git a/plugins/keys/keys.py b/plugins/keys/keys.py index 3342576..4d2ca96 100644 --- a/plugins/keys/keys.py diff --git a/yum-utils.spec b/yum-utils.spec index e33cb71..2151f5b 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 11%{?dist} +Release: 12%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,10 @@ fi %{pluginhome}/puppetverify.* %changelog +* Tue Mar 12 2013 James Antill - 1.1.31-12 +- Update to latest HEAD. +- FS snapshot tweaks for snapper support. + * Mon Mar 11 2013 James Antill - 1.1.31-11 - Update to latest HEAD. - FS snapshot fixes, and thin provisioning support. From 7add1a4b31181472884944e9e4e8aaa7b8d8c50a Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Wed, 17 Apr 2013 17:21:00 +0200 Subject: [PATCH 09/55] Update to latest HEAD --- yum-utils-HEAD.patch | 159 +++++++++++++++++++++++++++++++++++++------ yum-utils.spec | 10 ++- 2 files changed, 148 insertions(+), 21 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 22a3c1c..f60a1ac 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -127,7 +127,7 @@ index e77696a..d159169 100644 +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/debuginfo-install.py b/debuginfo-install.py -index 177c6c3..27d19ac 100755 +index 177c6c3..4215700 100755 --- a/debuginfo-install.py +++ b/debuginfo-install.py @@ -7,11 +7,11 @@ @@ -145,6 +145,17 @@ index 177c6c3..27d19ac 100755 # Copyright 2007 Seth Vidal import sys +@@ -156,6 +156,10 @@ class DebugInfoInstall(YumUtilBase): + self.di_try_install(deppo) + except yum.Errors.InstallError, e: + self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo) ++ ++ for pkgname in u: ++ self.logger.critical('Could not find a pacakge for: %s' % pkgname) ++ + # This is kinda hacky, accessing the option from the plugins code + # but I'm not sure of a better way of doing it + if not self.no_debuginfo_plugin and self.tsInfo: diff --git a/docs/Makefile b/docs/Makefile index d01c1e4..13ea4e7 100644 --- a/docs/Makefile @@ -1271,10 +1282,63 @@ index 202c203..ce98583 100644 def _pkglist_to_dict(pl, priority, addArch = False): out = dict() diff --git a/plugins/versionlock/versionlock.py b/plugins/versionlock/versionlock.py -index 40756b2..69458cd 100644 +index 40756b2..dfe4dd3 100644 --- a/plugins/versionlock/versionlock.py +++ b/plugins/versionlock/versionlock.py -@@ -170,6 +170,7 @@ class VersionLockCommand: +@@ -56,6 +56,23 @@ def _read_locklist(): + raise PluginYumExit('Unable to read version lock configuration: %s' % e) + return locklist + ++def _match(ent, patterns): ++ # there should be an API for this in Yum ++ (n, v, r, e, a) = splitFilename(ent) ++ for name in ( ++ '%s' % n, ++ '%s.%s' % (n, a), ++ '%s-%s' % (n, v), ++ '%s-%s-%s' % (n, v, r), ++ '%s-%s-%s.%s' % (n, v, r, a), ++ '%s:%s-%s-%s.%s' % (e, n, v, r, a), ++ '%s-%s:%s-%s.%s' % (n, e, v, r, a), ++ ): ++ for pat in patterns: ++ if fnmatch.fnmatch(name, pat): ++ return True ++ return False ++ + class VersionLockCommand: + created = 1247693044 + +@@ -99,9 +116,13 @@ class VersionLockCommand: + if not pkgs: + pkgs = base.pkgSack.returnPackages(patterns=extcmds) + ++ done = set() ++ for ent in _read_locklist(): ++ (n, v, r, e, a) = splitFilename(ent) ++ done.add((n, a, e, v, r)) ++ + fo = open(filename, 'a') + count = 0 +- done = set() + for pkg in pkgs: + # We ignore arch, so only add one entry for foo-1.i386 and + # foo-1.x86_64. +@@ -155,12 +176,7 @@ class VersionLockCommand: + out = os.fdopen(out, 'w', -1) + count = 0 + for ent in _read_locklist(): +- found = False +- for match in extcmds: +- if fnmatch.fnmatch(ent, match): +- found = True +- break +- if found: ++ if _match(ent, extcmds): + print "Deleting versionlock for:", ent + count += 1 + continue +@@ -170,6 +186,7 @@ class VersionLockCommand: if not count: os.unlink(tmpfilename) return 1, ['Error: versionlock delete: no matches'] @@ -1387,7 +1451,7 @@ index e710d8c..e5aae1b 100755 continue for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'): diff --git a/repodiff.py b/repodiff.py -index 67c162e..c16c03e 100755 +index 67c162e..003294c 100755 --- a/repodiff.py +++ b/repodiff.py @@ -10,8 +10,8 @@ @@ -1418,13 +1482,15 @@ index 67c162e..c16c03e 100755 class DiffYum(yum.YumBase): def __init__(self): yum.YumBase.__init__(self) -@@ -43,8 +51,12 @@ class DiffYum(yum.YumBase): +@@ -43,8 +51,14 @@ class DiffYum(yum.YumBase): # make our new repo obj newrepo = yum.yumRepo.YumRepository(repoid) newrepo.name = repoid - newrepo.baseurl = [baseurl] + if baseurl.startswith("mirror:"): + newrepo.mirrorlist = baseurl[len("mirror:"):] ++ elif baseurl.startswith("/"): ++ newrepo.baseurl = ["file:" + baseurl] + else: + newrepo.baseurl = [baseurl] newrepo.basecachedir = self.dy_basecachedir @@ -1432,7 +1498,7 @@ index 67c162e..c16c03e 100755 newrepo.metadata_expire = 0 newrepo.timestamp_check = False # add our new repo -@@ -157,6 +169,8 @@ def parseArgs(args): +@@ -157,6 +171,8 @@ def parseArgs(args): help="When comparing binary repos. also compare the arch of packages, to see if they are different") parser.add_option("-s", "--size", default=False, action='store_true', help="Output size changes for any new->old packages") @@ -1441,7 +1507,7 @@ index 67c162e..c16c03e 100755 parser.add_option("--simple", default=False, action='store_true', help="output simple format") (opts, argsleft) = parser.parse_args() -@@ -177,6 +191,47 @@ def parseArgs(args): +@@ -177,6 +193,47 @@ def parseArgs(args): return opts @@ -1489,7 +1555,7 @@ index 67c162e..c16c03e 100755 def main(args): opts = parseArgs(args) -@@ -221,6 +276,11 @@ def main(args): +@@ -221,6 +278,11 @@ def main(args): total_sizechange = 0 add_sizechange = 0 remove_sizechange = 0 @@ -1501,7 +1567,7 @@ index 67c162e..c16c03e 100755 if ygh.add: for pkg in sorted(ygh.add): if opts.compare_arch: -@@ -243,49 +303,32 @@ def main(args): +@@ -243,49 +305,32 @@ def main(args): if ygh.modified: print '\nUpdated Packages:\n' for (pkg, oldpkg) in sorted(ygh.modified): @@ -1574,7 +1640,7 @@ index 67c162e..c16c03e 100755 if (not ygh.add and not ygh.remove and not ygh.modified and not my.pkgSack.searchNevra(arch='src')): -@@ -294,11 +337,33 @@ def main(args): +@@ -294,11 +339,33 @@ def main(args): print '\nSummary:' print 'Added Packages: %s' % len(ygh.add) print 'Removed Packages: %s' % len(ygh.remove) @@ -1632,7 +1698,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..0d3e33c 100755 +index a3bb111..303ee3e 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -2044,7 +2110,17 @@ index a3bb111..0d3e33c 100755 if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: -@@ -1359,6 +1469,13 @@ def main(args): +@@ -1328,7 +1438,8 @@ def main(args): + baseurl = repopath + + repoq.add_enable_repo(repoid, baseurls=[baseurl], +- basecachedir=repoq.conf.cachedir) ++ basecachedir=repoq.conf.cachedir, ++ timestamp_check=False) + if not opts.quiet: + repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) + +@@ -1359,6 +1470,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -2058,7 +2134,7 @@ index a3bb111..0d3e33c 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1396,10 +1513,15 @@ def main(args): +@@ -1396,10 +1514,15 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -3270,7 +3346,7 @@ index 8a4888e..c50159e 100755 args.pop(0) if args: diff --git a/yumdownloader.py b/yumdownloader.py -index e6107d4..990ab85 100755 +index e6107d4..4c5eefb 100755 --- a/yumdownloader.py +++ b/yumdownloader.py @@ -7,11 +7,11 @@ @@ -3288,7 +3364,15 @@ index e6107d4..990ab85 100755 import sys import os -@@ -31,6 +31,8 @@ import shutil +@@ -22,6 +22,7 @@ import yum + from yum.misc import setup_locale + from yum.packages import parsePackages + from yum.Errors import RepoError ++from yum.i18n import exception2msg + from utils import YumUtilBase + + from urlparse import urljoin +@@ -31,6 +32,8 @@ import shutil import rpmUtils import logging @@ -3297,7 +3381,29 @@ index e6107d4..990ab85 100755 # This is to fix Bug 469 # To convert from a pkg to a source pkg, we have a problem in that all we have # is "sourcerpm", which can be a different nevra ... but just to make it fun -@@ -92,53 +94,27 @@ class YumDownloader(YumUtilBase): +@@ -68,7 +71,11 @@ class YumDownloader(YumUtilBase): + + # Add util commandline options to the yum-cli ones + self.optparser = self.getOptionParser() +- self.main() ++ try: ++ self.main() ++ except (OSError, IOError), e: ++ self.logger.error(exception2msg(e)) ++ sys.exit(1) + + def main(self): + # Add command line option specific to yumdownloader +@@ -77,7 +84,7 @@ class YumDownloader(YumUtilBase): + try: + opts = self.doUtilConfigSetup() + except yum.Errors.RepoError, e: +- self.logger.error(str(e)) ++ self.logger.error(exception2msg(e)) + sys.exit(50) + + # Check if there is anything to do. +@@ -92,53 +99,27 @@ class YumDownloader(YumUtilBase): # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup(opts) @@ -3362,7 +3468,16 @@ index e6107d4..990ab85 100755 def downloadPackages(self,opts): -@@ -211,57 +187,35 @@ class YumDownloader(YumUtilBase): +@@ -177,7 +158,7 @@ class YumDownloader(YumUtilBase): + installable = self.returnPackagesByDep(pkg) + installable = yum.misc.unique(installable) + except yum.Errors.YumBaseError, msg: +- self.logger.error(str(msg)) ++ self.logger.error(exception2msg(msg)) + continue + + if not installable: # doing one at a time, apart from groups +@@ -211,57 +192,35 @@ class YumDownloader(YumUtilBase): self.resolveDeps() # Add newly added packages to the toDownload list for pkg in self.tsInfo.getMembers(): @@ -3444,7 +3559,7 @@ index e6107d4..990ab85 100755 return exit_code def _groupPackages(self,pkglist): -@@ -279,6 +233,9 @@ class YumDownloader(YumUtilBase): +@@ -279,6 +238,9 @@ class YumDownloader(YumUtilBase): """do a default setup for all the normal/necessary yum components, really just a shorthand for testing""" try: @@ -3454,8 +3569,12 @@ index e6107d4..990ab85 100755 self._getRepos(doSetup = True) # if '--source' is used the add src to the archlist if opts.source: -@@ -294,15 +251,8 @@ class YumDownloader(YumUtilBase): - self.logger.critical(str(msg)) +@@ -291,18 +253,11 @@ class YumDownloader(YumUtilBase): + archlist = rpmUtils.arch.getArchList() + self._getSacks(archlist=archlist) + except yum.Errors.YumBaseError, msg: +- self.logger.critical(str(msg)) ++ self.logger.critical(exception2msg(msg)) sys.exit(1) - def _removeEnabledSourceRepos(self): diff --git a/yum-utils.spec b/yum-utils.spec index 2151f5b..b2dec54 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,14 @@ fi %{pluginhome}/puppetverify.* %changelog +* Wed Apr 17 2013 Zdenek Pavlas - 1.1.31-13 +- Update to latest HEAD +- versionlock add: Skip packages already locked. +- versionlock delete: Match all names, not just envra. +- Allow --old=/foo urls for repodiff. +- Don't check timestamps for repofrompath repos. BZ 880944 +- Output couldn't find a pkg. for 'foo'. BZ 838158 + * Tue Mar 12 2013 James Antill - 1.1.31-12 - Update to latest HEAD. - FS snapshot tweaks for snapper support. From 9e52a88e8c6260b640490c1a04d15da040d6de75 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Thu, 18 Apr 2013 10:48:44 +0200 Subject: [PATCH 10/55] yum-utils.bash: load yum.bash first --- yum-utils-HEAD.patch | 29 ++++++++++++++++++----------- yum-utils.spec | 5 ++++- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index f60a1ac..50d609f 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -2743,10 +2743,17 @@ index 8bfdbcd..250ebc9 100644 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software diff --git a/yum-utils.bash b/yum-utils.bash -index 1d37231..20e8e5c 100644 +index 1d37231..6578bb3 100644 --- a/yum-utils.bash +++ b/yum-utils.bash -@@ -100,7 +100,7 @@ _yu_repo_graph() +@@ -1,3 +1,6 @@ ++# need functions from yum.bash ++type -t _yum >/dev/null || . $(pkg-config --variable=completionsdir bash-completion)/yum ++ + # bash completion for yum-utils + + _yu_init_completion() +@@ -100,7 +103,7 @@ _yu_repo_graph() return 0 ;; --repoid) @@ -2755,7 +2762,7 @@ index 1d37231..20e8e5c 100644 return 0 ;; -c) -@@ -136,7 +136,7 @@ _yu_repo_rss() +@@ -136,7 +139,7 @@ _yu_repo_rss() COMPREPLY=( $( compgen -W '--help -f -l -t -d -r --tempcache -g -a -c' \ -- "$2" ) ) @@ -2764,7 +2771,7 @@ index 1d37231..20e8e5c 100644 } && complete -F _yu_repo_rss -o filenames repo-rss repo-rss.py -@@ -155,7 +155,7 @@ _yu_repoclosure() +@@ -155,7 +158,7 @@ _yu_repoclosure() return 0 ;; -l|--lookaside|-r|--repoid) @@ -2773,7 +2780,7 @@ index 1d37231..20e8e5c 100644 return 0 ;; -p|--pkg) -@@ -163,7 +163,7 @@ _yu_repoclosure() +@@ -163,7 +166,7 @@ _yu_repoclosure() return 0 ;; -g|--group) @@ -2782,7 +2789,7 @@ index 1d37231..20e8e5c 100644 return 0 ;; esac -@@ -188,26 +188,23 @@ _yu_repoquery() +@@ -188,26 +191,23 @@ _yu_repoquery() done case $prev in @@ -2816,7 +2823,7 @@ index 1d37231..20e8e5c 100644 --grouppkgs) COMPREPLY=( $( compgen -W 'all default optional mandatory' \ -- "$cur" ) ) -@@ -219,38 +216,52 @@ _yu_repoquery() +@@ -219,38 +219,52 @@ _yu_repoquery() return 0 ;; --repoid) @@ -2881,7 +2888,7 @@ index 1d37231..20e8e5c 100644 } && complete -F _yu_repoquery -o filenames repoquery repoquery.py -@@ -278,8 +289,8 @@ _yu_yumdb() +@@ -278,8 +292,8 @@ _yu_yumdb() if [ $COMP_CWORD -le 1 ] ; then COMPREPLY=( $( compgen -W 'get set del rename rename-force copy search @@ -2892,7 +2899,7 @@ index 1d37231..20e8e5c 100644 fi } && complete -F _yu_yumdb -o filenames yumdb yumdb.py -@@ -299,7 +310,7 @@ _yu_repodiff() +@@ -299,7 +313,7 @@ _yu_repodiff() $split && return 0 COMPREPLY=( $( compgen -W '--version --help --new --old --quiet --archlist @@ -2901,7 +2908,7 @@ index 1d37231..20e8e5c 100644 } && complete -F _yu_repodiff repodiff repodiff.py -@@ -311,6 +322,13 @@ _yu_builddep() +@@ -311,6 +325,13 @@ _yu_builddep() _yum_complete_baseopts "$cur" "$prev" && return 0 @@ -2915,7 +2922,7 @@ index 1d37231..20e8e5c 100644 $split && return 0 if [[ $cur == -* ]] ; then -@@ -363,6 +381,36 @@ _yu_debug_dump() +@@ -363,6 +384,36 @@ _yu_debug_dump() } && complete -F _yu_debug_dump -o filenames yum-debug-dump yum-debug-dump.py diff --git a/yum-utils.spec b/yum-utils.spec index b2dec54..3ccbe88 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 13%{?dist} +Release: 14%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,9 @@ fi %{pluginhome}/puppetverify.* %changelog +* Thu Apr 18 2013 Zdenek Pavlas - 1.1.31-14 +- yum-utils.bash: load yum.bash first + * Wed Apr 17 2013 Zdenek Pavlas - 1.1.31-13 - Update to latest HEAD - versionlock add: Skip packages already locked. From 4ee3196fc1f4b3046c3d0374eec54955bbe12a66 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Mon, 24 Jun 2013 10:27:17 +0200 Subject: [PATCH 11/55] Update to latest HEAD - debuginfo-install: handle YumBaseError - fs-snapshot: "dmsetup -o" workaround. BZ 954358, BZ 949569 - tmprepo: avoid spaces in repoid. BZ 965806 - repoquery: add cachedir locking. BZ 969776 - Fix a bug in Modified/Upgraded/Downgraded output. BZ 819502 --- yum-utils-HEAD.patch | 114 +++++++++++++++++++++++++++++++++++-------- yum-utils.spec | 10 +++- 2 files changed, 104 insertions(+), 20 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 50d609f..e8cee66 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -127,7 +127,7 @@ index e77696a..d159169 100644 +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. diff --git a/debuginfo-install.py b/debuginfo-install.py -index 177c6c3..4215700 100755 +index 177c6c3..be2ff2d 100755 --- a/debuginfo-install.py +++ b/debuginfo-install.py @@ -7,11 +7,11 @@ @@ -145,7 +145,31 @@ index 177c6c3..4215700 100755 # Copyright 2007 Seth Vidal import sys -@@ -156,6 +156,10 @@ class DebugInfoInstall(YumUtilBase): +@@ -52,7 +52,12 @@ class DebugInfoInstall(YumUtilBase): + action="store_true", + help="Turn off automatic installation/update of the yum debuginfo plugin") + +- self.main() ++ self.done = set() ++ try: ++ self.main() ++ except yum.Errors.YumBaseError, e: ++ print e ++ sys.exit(1) + + def doUtilConfigSetup(self, *args, **kwargs): + """ We override this to get our extra option out. """ +@@ -117,6 +122,9 @@ class DebugInfoInstall(YumUtilBase): + sys.exit(self.doUtilTransaction()) + + def di_try_install(self, po): ++ if po in self.done: ++ return ++ self.done.add(po) + if po.name.endswith('-debuginfo'): # Wildcard matches produce this + return + di_name = '%s-debuginfo' % po.name +@@ -156,6 +164,10 @@ class DebugInfoInstall(YumUtilBase): self.di_try_install(deppo) except yum.Errors.InstallError, e: self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo) @@ -1063,7 +1087,7 @@ index 3a67c69..9ada717 100644 [lvm] enabled = 0 diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py -index 5094881..8099b19 100644 +index 5094881..4f99b6a 100644 --- a/plugins/fs-snapshot/fs-snapshot.py +++ b/plugins/fs-snapshot/fs-snapshot.py @@ -21,7 +21,7 @@ This plugin creates a snapshot before any yum update or yum remove operation on @@ -1085,16 +1109,25 @@ index 5094881..8099b19 100644 def inspect_volume_lvm(conduit, volume): """ If volume is an LVM logical volume: -@@ -80,7 +83,7 @@ def inspect_volume_lvm(conduit, volume): +@@ -79,25 +82,28 @@ def inspect_volume_lvm(conduit, volume): + if device.startswith("/dev/mapper/"): # convert /dev/mapper name to /dev/vg/lv for use with LVM2 tools # - 'dmsetup splitname' will collapse any escaped characters - p = Popen(["/sbin/dmsetup", "splitname", "--separator", "/", +- p = Popen(["/sbin/dmsetup", "splitname", "--separator", "/", - "--noheadings", +- "-o", "vg_name,lv_name", device], stdout=PIPE, stderr=PIPE) ++ p = Popen(["/sbin/dmsetup", "splitname", "--separator", " ", + "--noheadings", "-c", - "-o", "vg_name,lv_name", device], stdout=PIPE, stderr=PIPE) ++ device], stdout=PIPE, stderr=PIPE) err = p.wait() if err: -@@ -92,12 +95,14 @@ def inspect_volume_lvm(conduit, volume): + return 0 + output = p.communicate()[0] +- device = output.strip().replace("/dev/mapper/", "/dev/") ++ device = "/".join(output.split()[:2]) ++ device = device.replace("/dev/mapper/", "/dev/") + volume["device"] = device + # Check if device is managed by lvm # - FIXME filter out snapshot (and other) LVs; for now just rely # on 'lvcreate' to prevent snapshots of unsupported LV types @@ -1111,7 +1144,7 @@ index 5094881..8099b19 100644 conduit.error(1, "fs-snapshot: skipping volume: %s, " "kernel doesn't support snapshot-merge" % device) return 0 -@@ -216,6 +221,14 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): +@@ -216,6 +222,14 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): return 1 return 2 @@ -1126,7 +1159,7 @@ index 5094881..8099b19 100644 def _create_lvm_snapshot(conduit, snapshot_tag, volume): """ Create LVM snapshot LV and tag it with $snapshot_tag. -@@ -223,16 +236,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -223,16 +237,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): has enough free space to accommodate a snapshot LV. - Also assumes user has configured 'lvcreate_size_args'. """ @@ -1154,7 +1187,7 @@ index 5094881..8099b19 100644 device = volume["device"] if device.count('/') != 3: -@@ -259,7 +274,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -259,7 +275,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): (mntpnt, device, snap_lvname)) # Create snapshot LV lvcreate_cmd = ["/sbin/lvcreate", "-s", "-n", snap_lvname] @@ -1164,7 +1197,7 @@ index 5094881..8099b19 100644 lvcreate_cmd.append(device) p = Popen(lvcreate_cmd, stdout=PIPE, stderr=PIPE) err = p.wait() -@@ -270,16 +286,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -270,16 +287,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): # Add tag ($snapshot_tag) to snapshot LV # - should help facilitate merge of all snapshot LVs created # by a yum transaction, e.g.: lvconvert --merge @snapshot_tag @@ -1190,7 +1223,7 @@ index 5094881..8099b19 100644 """ This runs before the transaction starts. Try to snapshot anything and everything that is snapshottable, since we do not know what an RPM will -@@ -287,6 +305,10 @@ def pretrans_hook(conduit): +@@ -287,6 +306,10 @@ def pretrans_hook(conduit): """ # common snapshot tag format: yum_${year}${month}${day}${hour}${minute}${sec} snapshot_tag = "yum_" + time.strftime("%Y%m%d%H%M%S") @@ -1201,7 +1234,7 @@ index 5094881..8099b19 100644 volumes = get_volumes(conduit) for volume in volumes: -@@ -296,3 +318,13 @@ def pretrans_hook(conduit): +@@ -296,3 +319,13 @@ def pretrans_hook(conduit): elif rc == 2 and hasattr(conduit, 'registerPackageName'): # A snapshot was successfully created conduit.registerPackageName("yum-plugin-fs-snapshot") @@ -1281,6 +1314,19 @@ index 202c203..ce98583 100644 def _pkglist_to_dict(pl, priority, addArch = False): out = dict() +diff --git a/plugins/tmprepo/tmprepo.py b/plugins/tmprepo/tmprepo.py +index e60dd4d..93e560a 100644 +--- a/plugins/tmprepo/tmprepo.py ++++ b/plugins/tmprepo/tmprepo.py +@@ -133,7 +133,7 @@ def add_repomd_repo(base, repomd): + AutoCleanupDir(trepo_data) + trepo_name = os.path.basename(os.path.dirname(os.path.dirname(repomd))) + tmp_fname = "%s/tmp-%s.repo" % (trepo_data, trepo_name) +- repoid = "T-%4.4s-%x" % (trepo_name, int(time.time())) ++ repoid = "T-%0.4s-%x" % (trepo_name, int(time.time())) + pgpgcheck, rgpgcheck = rpgpgcheck, rrgpgcheck + if repomd.startswith("file:"): + pgpgcheck, rgpgcheck = lpgpgcheck, lrgpgcheck diff --git a/plugins/versionlock/versionlock.py b/plugins/versionlock/versionlock.py index 40756b2..dfe4dd3 100644 --- a/plugins/versionlock/versionlock.py @@ -1423,7 +1469,7 @@ index 4a2917c..f14ff2a 100755 import yum diff --git a/repoclosure.py b/repoclosure.py -index e710d8c..e5aae1b 100755 +index e710d8c..f895f84 100755 --- a/repoclosure.py +++ b/repoclosure.py @@ -8,11 +8,11 @@ @@ -1450,8 +1496,24 @@ index e710d8c..e5aae1b 100755 # packages from lookaside repositories continue for (req, flags, (reqe, reqv, reqr)) in pkg.returnPrco('requires'): +@@ -298,12 +298,12 @@ def main(): + req = '%s %s' % (req, v) + + my.logger.info(' %s' % req) ++ if baddeps: ++ sys.exit(1) + + if __name__ == "__main__": + try: + main() + except (yum.Errors.YumBaseError, ValueError), e: + print >> sys.stderr, str(e) +- sys.exit(1) +- +- ++ sys.exit(2) diff --git a/repodiff.py b/repodiff.py -index 67c162e..003294c 100755 +index 67c162e..21be5af 100755 --- a/repodiff.py +++ b/repodiff.py @@ -10,8 +10,8 @@ @@ -1640,14 +1702,15 @@ index 67c162e..003294c 100755 if (not ygh.add and not ygh.remove and not ygh.modified and not my.pkgSack.searchNevra(arch='src')): -@@ -294,11 +339,33 @@ def main(args): +@@ -294,11 +339,34 @@ def main(args): print '\nSummary:' print 'Added Packages: %s' % len(ygh.add) print 'Removed Packages: %s' % len(ygh.remove) - print 'Modified Packages: %s' % len(ygh.modified) + if not opts.downgrade: -+ print 'Upgraded Packages: %s' % upgraded_pkgs ++ print 'Modified Packages: %s' % len(ygh.modified) + else: ++ print 'Upgraded Packages: %s' % upgraded_pkgs + print 'Downgraded Packages: %s' % downgraded_pkgs if opts.size: - print 'Size of added packages: %s' % add_sizechange @@ -1698,7 +1761,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..303ee3e 100755 +index a3bb111..403074b 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -2134,7 +2197,20 @@ index a3bb111..303ee3e 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1396,10 +1514,15 @@ def main(args): +@@ -1381,6 +1499,12 @@ def main(args): + repo.enable() + + try: ++ repoq.doLock() ++ except yum.Errors.LockError, e: ++ repoq.logger.error(e) ++ sys.exit(50) ++ ++ try: + if not hasattr(repoq, 'arch'): + repoq.doSackSetup(archlist=archlist) + elif archlist is not None: +@@ -1396,10 +1520,15 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) diff --git a/yum-utils.spec b/yum-utils.spec index 3ccbe88..ae71f95 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 14%{?dist} +Release: 15%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,14 @@ fi %{pluginhome}/puppetverify.* %changelog +* Mon Jun 24 2013 Zdenek Pavlas - 1.1.31-15 +- Update to latest HEAD +- debuginfo-install: handle YumBaseError +- fs-snapshot: "dmsetup -o" workaround. BZ 954358, BZ 949569 +- tmprepo: avoid spaces in repoid. BZ 965806 +- repoquery: add cachedir locking. BZ 969776 +- Fix a bug in Modified/Upgraded/Downgraded output. BZ 819502 + * Thu Apr 18 2013 Zdenek Pavlas - 1.1.31-14 - yum-utils.bash: load yum.bash first From 59f88ca09285012dedfd08d6f87ada0095800831 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Thu, 25 Jul 2013 11:17:39 +0200 Subject: [PATCH 12/55] Update to latest HEAD - Fix pacakge => package typos - docs: Add missing man page short descriptions - docs: Escape dashes in command-line options - docs: Add missing man pages for all yum-utils - Add --show-duplicates to repoquery manpage. BZ 975565 - yum-complete-transaction: unlock yum.pid. BZ 984119 - sanitize repoquery --repofrompath. BZ 988140 - yum changelog: implicit since=all. BZ 961782 - repoquery: retry doLock() BZ 988223 --- yum-utils-HEAD.patch | 1214 ++++++++++++++++++++++++++++++++++++++---- yum-utils.spec | 14 +- 2 files changed, 1124 insertions(+), 104 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index e8cee66..2015378 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -126,8 +126,21 @@ index e77696a..d159169 100644 -library. If this is what you want to do, use the GNU Library General +library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. +diff --git a/ChangeLog b/ChangeLog +index bc802f6..e9be2e4 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -3370,7 +3370,7 @@ + 2008-08-04 James Antill + + * yum-builddep.py: Allow yum-builddep to use "extras" +- (installed/not-available pacakges ++ (installed/not-available packages + + 2008-08-04 James Antill + diff --git a/debuginfo-install.py b/debuginfo-install.py -index 177c6c3..be2ff2d 100755 +index 177c6c3..0f026f1 100755 --- a/debuginfo-install.py +++ b/debuginfo-install.py @@ -7,11 +7,11 @@ @@ -175,28 +188,144 @@ index 177c6c3..be2ff2d 100755 self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo) + + for pkgname in u: -+ self.logger.critical('Could not find a pacakge for: %s' % pkgname) ++ self.logger.critical('Could not find a package for: %s' % pkgname) + # This is kinda hacky, accessing the option from the plugins code # but I'm not sure of a better way of doing it if not self.no_debuginfo_plugin and self.tsInfo: diff --git a/docs/Makefile b/docs/Makefile -index d01c1e4..13ea4e7 100644 +index d01c1e4..acb8559 100644 --- a/docs/Makefile +++ b/docs/Makefile -@@ -1,7 +1,7 @@ +@@ -1,7 +1,9 @@ DOCS = repoquery package-cleanup repo-rss yumdownloader yum-builddep yum-changelog reposync \ yum-list-data yum-filter-data yum-verify yum-utils yum-aliases yum-debug-dump yum-versionlock \ yum-groups-manager debuginfo-install repodiff yum-fs-snapshot \ - show-installed show-changed-rco -+ show-installed show-changed-rco yum-debug-restore ++ show-installed show-changed-rco yum-debug-restore \ ++ find-repos-of-install needs-restarting repo-graph repoclosure \ ++ repomanage repotrack verifytree yum-config-manager DOCS5 = yum-changelog.conf yum-versionlock.conf yum-fs-snapshot.conf DOCS8 = yum-security yum-complete-transaction yumdb +diff --git a/docs/debuginfo-install.1 b/docs/debuginfo-install.1 +index a47e28a..a829869 100644 +--- a/docs/debuginfo-install.1 ++++ b/docs/debuginfo-install.1 +@@ -1,7 +1,7 @@ + .\" debuginfo-install + .TH "debuginfo-install" "1" "21 October 2008" "James Antill" "" + .SH "NAME" +-debuginfo-install ++debuginfo-install \- install debuginfo packages and their dependencies + .SH "SYNOPSIS" + \fBdebuginfo-install\fP package + .SH "DESCRIPTION" +diff --git a/docs/find-repos-of-install.1 b/docs/find-repos-of-install.1 +new file mode 100644 +index 0000000..77be909 +--- /dev/null ++++ b/docs/find-repos-of-install.1 +@@ -0,0 +1,51 @@ ++.\" find-repos-of-install ++.TH "find-repos-of-install" "1" "13 January 2013" "" "" ++.SH "NAME" ++find-repos-of-install \- report which Yum repository a package was installed from ++.SH "SYNOPSIS" ++\fBfind-repos-of-install\fP [options] package1 [package2...] ++.SH "DESCRIPTION" ++.PP ++\fBfind-repos-of-install\fP is a program which reports the Yum repository that ++a specified package was installed from. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-\-version\fP" ++Report program version and exit. ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-\-repoid=REPOID\fP" ++Specify repo ids to query, can be specified multiple times (default is ++all enabled). ++.IP "\fB\-\-enablerepo=ENABLEREPOS\fP" ++In addition to the default set, query the given additional repository, even if ++it is disabled in YUM configuration. Can be used multiple times. ++.IP "\fB\-\-disablerepo=DISABLEREPOS\fP" ++Do not query the given repository, even if it is enabled in YUM ++configuration. Can be used multiple times. ++.IP "\fB\-\-repofrompath=REPOID,PATH/URL\fP" ++Specify a path or url to a repository (same path as in a baseurl) to add to ++the repositories for this query. This option can be used multiple times. If ++you want to view only the pkgs from this repository combine this with ++\-\-repoid. The repoid for the repository is specified by REPOID. ++.IP "\fB\-C, \-\-cache\fP" ++Tells repoquery to run entirely from YUM cache - does not download any metadata ++or update the cache. Queries in this mode can fail or give partial/incorrect ++results if the cache isn't fully populated beforehand with eg "yum makecache". ++.IP "\fB\-\-tempcache\fP" ++Use a temp dir for storing/accessing yum-cache. ++.IP "\fB\-\-sync2yumdb\fP" ++Sync anything that is found to the yumdb, if available. ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH AUTHORS ++.nf ++See the Authors file included with this program. ++.fi +diff --git a/docs/needs-restarting.1 b/docs/needs-restarting.1 +new file mode 100644 +index 0000000..74b1904 +--- /dev/null ++++ b/docs/needs-restarting.1 +@@ -0,0 +1,29 @@ ++.\" needs-restarting ++.TH "needs-restarting" "1" "13 January 2013" "" "" ++.SH "NAME" ++needs-restarting \- report running processes that have been updated ++.SH "SYNOPSIS" ++\fBneeds-restarting\fP [options] ++.SH "DESCRIPTION" ++.PP ++\fBneeds-restarting\fP is a program that reports a list of process ids that ++started running before they or some component that they use were updated. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-u, \-\-useronly\fP" ++Show processes for my userid only. ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi diff --git a/docs/package-cleanup.1 b/docs/package-cleanup.1 -index 867cf4d..0405e09 100644 +index 867cf4d..61959ac 100644 --- a/docs/package-cleanup.1 +++ b/docs/package-cleanup.1 +@@ -1,7 +1,7 @@ + .\" package-cleanup + .TH "package-cleanup" "1" "03 November 2005" "Gijs Hollestelle" "" + .SH "NAME" +-package-cleanup ++package-cleanup \- clean up locally installed, duplicate, or orphaned packages + .SH "SYNOPSIS" + \fBpackage-cleanup\fP [options] + .SH "DESCRIPTION" @@ -14,7 +14,7 @@ Use alternative config file (default is /etc/yum.conf). .IP "\fB\-h, \-\-help\fP" Help; display a help message and then quit\&. @@ -215,7 +344,7 @@ index 867cf4d..0405e09 100644 .PP .SH "LEAVES OPTIONS" .IP "\fB\-\-all\fP" -@@ -49,8 +51,6 @@ When listing leaf nodes do not list development packages. +@@ -49,21 +51,19 @@ When listing leaf nodes do not list development packages. When listing leaf nodes do not list packages with files in bin directories. .PP .SH "OLDKERNELS OPTIONS" @@ -224,31 +353,188 @@ index 867cf4d..0405e09 100644 .IP "\fB\-\-keepdevel\fP" Do not remove kernel-devel packages when removing kernels + .SH "EXAMPLES" + .IP "List all dependency problems:" +-\fBpackage-cleanup --problems\fP ++\fBpackage-cleanup \-\-problems\fP + .IP "List all packages that are not in any Yum repository:" +-\fBpackage-cleanup --orphans\fP ++\fBpackage-cleanup \-\-orphans\fP + .IP "Remove old kernels keeping 3 and leaving old kernel-devel packages installed:" +-\fBpackage-cleanup --oldkernels --count=3 --keepdevel\fP ++\fBpackage-cleanup \-\-oldkernels \-\-count=3 \-\-keepdevel\fP + .PP + .IP "List all leaf packages with no files in a bin directory whose name begins with either 'perl' or 'python':" +-\fBpackage-cleanup --leaves --exclude-bin --leaf-regex="^(perl)|(python)"\fP ++\fBpackage-cleanup \-\-leaves \-\-exclude\-bin \-\-leaf\-regex="^(perl)|(python)"\fP + .PP + .SH "FILES" + As package-cleanup uses YUM libraries for retrieving all the information, it +diff --git a/docs/repo-graph.1 b/docs/repo-graph.1 +new file mode 100644 +index 0000000..9bdbb20 +--- /dev/null ++++ b/docs/repo-graph.1 +@@ -0,0 +1,32 @@ ++.\" repo-graph ++.TH "repo-graph" "1" "13 January 2013" "" "" ++.SH "NAME" ++repo-graph \- output a full package dependency graph in dot format ++.SH "SYNOPSIS" ++\fBrepo-graph\fP [options] ++.SH "DESCRIPTION" ++.PP ++\fBrepo-graph\fP is a program that generates a full package dependency list ++from a yum repository and outputs it in dot format. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-\-repoid=REPOID\fP" ++Specify repo ids to query, can be specified multiple times (default is ++all enabled). ++.IP "\fB\-c CONFIG\fP" ++Config file to use (defaults to /etc/yum.conf). ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi +diff --git a/docs/repo-rss.1 b/docs/repo-rss.1 +index 90788b8..62e00cc 100644 +--- a/docs/repo-rss.1 ++++ b/docs/repo-rss.1 +@@ -1,7 +1,7 @@ + .\" repo-rss + .TH "repo-rss" "1" "2005" "Seth Vidal" "" + .SH "NAME" +-repo-rss ++repo-rss \- generates an RSS feed from one or more Yum repositories + .SH "SYNOPSIS" + \fBrepo-rss\fP [options] repoid1 [repoid2...] + .SH "DESCRIPTION" +@@ -28,7 +28,7 @@ default for non-root users. + + .SH "EXAMPLES" + .IP "Generate an RSS for the updates-released repository and save it as updates-release.xml:" +-\fBrepo-rss -f updates-released.xml updates-released\fP ++\fBrepo-rss \-f updates-released.xml updates-released\fP + .PP + .SH "FILES" + As repo-rss uses YUM libraries for retrieving all the information, it +diff --git a/docs/repoclosure.1 b/docs/repoclosure.1 +new file mode 100644 +index 0000000..e0f7091 +--- /dev/null ++++ b/docs/repoclosure.1 +@@ -0,0 +1,57 @@ ++.\" repoclosure ++.TH "repoclosure" "1" "13 January 2013" "" "" ++.SH "NAME" ++repoclosure \- display a list of unresolved dependencies for a yum repository ++.SH "SYNOPSIS" ++\fBrepoclosure\fP [options] ++.SH "DESCRIPTION" ++.PP ++\fBrepoclosure\fP is a program that reads package metadata from one or more yum ++repositories, checks all dependencies, and displays a list of packages with ++unresolved dependencies. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-c CONFIG, \-\-config=CONFIG\fP" ++Config file to use (defaults to /etc/yum.conf). ++.IP "\fB\-a ARCH, \-\-arch=ARCH\fP" ++Check packages of the given archs, can be specified multiple times (default: ++current arch). ++.IP "\fB\-\-basearch=BASEARCH\fP" ++Set the basearch for yum to run as. ++.IP "\fB\-b, \-\-builddeps\fP" ++Check build dependencies only (needs source repos enabled). ++.IP "\fB\-l LOOKASIDE, \-\-lookaside=LOOKASIDE\fP" ++Specify a lookaside repo id to query, can be specified multiple times. ++.IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" ++Specify repo ids to query, can be specified multiple times (default is ++all enabled). ++.IP "\fB\-t, \-\-tempcache\fP" ++Use a temp dir for storing/accessing yum-cache. ++.IP "\fB\-q, \-\-quiet\fP" ++Run quietly: no warnings printed to stderr. ++.IP "\fB\-n, \-\-newest\fP" ++Check only the newest packages in the repos. ++.IP "\fB\-\-repofrompath=REPOID,PATH/URL\fP" ++Specify a path or url to a repository (same path as in a baseurl) to add to ++the repositories for this query. This option can be used multiple times. If ++you want to view only the pkgs from this repository combine this with ++\-\-repoid. The repoid for the repository is specified by REPOID. ++.IP "\fB\-p PKG, \-\-pkg=PKG\fP" ++Check closure for this package only ++.IP "\fB\-g GROUP, \-\-group=GROUP\fP" ++Check closure for packages in this group only ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi diff --git a/docs/repodiff.1 b/docs/repodiff.1 -index c421c5d..ef2a373 100644 +index c421c5d..75a8860 100644 --- a/docs/repodiff.1 +++ b/docs/repodiff.1 -@@ -11,9 +11,11 @@ repositories. \fBNote\fP that by default only source packages are compared. +@@ -1,37 +1,45 @@ + .\" repodiff + .TH "repodiff" "1" "21 October 2008" "James Antill" "" + .SH "NAME" +-repodiff ++repodiff \- list differences between two or more Yum repositories + .SH "SYNOPSIS" +-\fBrepodiff\fP --old=old_repo_baseurl --new=new_repo_baseurl ++\fBrepodiff\fP \-\-old=old_repo_baseurl \-\-new=new_repo_baseurl + .SH "DESCRIPTION" + .PP + \fBrepodiff\fP is a program which will list differences between two sets of + repositories. \fBNote\fP that by default only source packages are compared. .PP .SH "GENERAL OPTIONS" - .IP "\fB\-\-old, -o\fP" +-.IP "\fB\-\-old, -o\fP" -Add a repo. as an old repo. +-.IP "\fB\-\-new, -n\fP" +-Add a repo. as an new repo. +-.IP "\fB\-\-archlist, -a\fP" ++.IP "\fB\-\-old, \-o\fP" +Add a repo. as an old repo. Note that if you prefix the url with "mirror:" then +the following url is treated as a mirror and not a baseurl. - .IP "\fB\-\-new, -n\fP" --Add a repo. as an new repo. ++.IP "\fB\-\-new, \-n\fP" +Add a repo. as an new repo. Note that if you prefix the url with "mirror:" then +the following url is treated as a mirror and not a baseurl. - .IP "\fB\-\-archlist, -a\fP" ++.IP "\fB\-\-archlist, \-a\fP" Add architectures to change the default from just comparing source packages. Note that if you want the same as a native -@@ -21,10 +23,14 @@ Note that if you want the same as a native + "x86_64" architecture machine you just need to pass "x86_64" (this is different from earlier versions where you needed to specify "x86_64,athlon,i686,i586,i486,i386,noarch" and you still got "src"). - .IP "\fB\-\-size, -s\fP" +-.IP "\fB\-\-size, -s\fP" -Ouput additional data about the size of the changes. +-.IP "\fB\-\-compare-arch\fP" ++.IP "\fB\-\-size, \-s\fP" +Output additional data about the size of the changes. - .IP "\fB\-\-compare-arch\fP" ++.IP "\fB\-\-compare\-arch\fP" Normally packages are just compared based on their name, this flag makes the comparison also use the arch. So foo.i386 and foo.x86_64 are different. +.IP "\fB\-\-simple\fP" @@ -257,43 +543,222 @@ index c421c5d..ef2a373 100644 +Split the data for modified packages between upgraded and downgraded packages. .SH "EXAMPLES" .IP "Compare source pkgs in two local repos:" - \fBrepodiff --old=/tmp/repo-old --new=/tmp/repo-new\fP -@@ -32,6 +38,8 @@ comparison also use the arch. So foo.i386 and foo.x86_64 are different. - \fBrepodiff -a x86_64 --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP +-\fBrepodiff --old=/tmp/repo-old --new=/tmp/repo-new\fP ++\fBrepodiff \-\-old=/tmp/repo-old \-\-new=/tmp/repo-new\fP + .IP "Compare x86_64 compat. binary pkgs in two remote repos, and two local one:" +-\fBrepodiff -a x86_64 --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP ++\fBrepodiff \-a x86_64 \-\-old=http://example.com/repo1-old \-\-old=/tmp/repo-old \-\-new=http://example.com/repo1-new \-\-new=/tmp/repo-new\fP .IP "Compare x86_64 compat. binary pkgs, but also compare arch:" - \fBrepodiff -a x86_64 --compare-arch --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP +-\fBrepodiff -a x86_64 --compare-arch --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP ++\fBrepodiff \-a x86_64 \-\-compare\-arch \-\-old=http://example.com/repo1-old \-\-old=/tmp/repo-old \-\-new=http://example.com/repo1-new \-\-new=/tmp/repo-new\fP +.IP "Compare two releases of Fedora (15 => 16):" -+\fBrepodiff --old='mirror:https://mirrors.fedoraproject.org/metalink?repo=fedora-source-15&arch=i386' --new='mirror:https://mirrors.fedoraproject.org/metalink?repo=fedora-source-16&arch=i386' --size --simple --downgrade\fP ++\fBrepodiff \-\-old='mirror:https://mirrors.fedoraproject.org/metalink?repo=fedora-source-15&arch=i386' \-\-new='mirror:https://mirrors.fedoraproject.org/metalink?repo=fedora-source-16&arch=i386' \-\-size \-\-simple \-\-downgrade\fP .PP .SH "SEE ALSO" +diff --git a/docs/repomanage.1 b/docs/repomanage.1 +new file mode 100644 +index 0000000..4d336a5 +--- /dev/null ++++ b/docs/repomanage.1 +@@ -0,0 +1,38 @@ ++.\" repomanage ++.TH "repomanage" "1" "13 January 2013" "" "" ++.SH "NAME" ++repomanage \- list the newest or oldest RPM packages in a directory ++.SH "SYNOPSIS" ++\fBrepomanage\fP [options] directory ++.SH "DESCRIPTION" ++.PP ++\fBrepomanage\fP is a program to manage a directory of RPM packages. It ++displays a list of the newest or oldest packages in a directory for easy ++piping to xargs or similar programs. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-o, \-\-old\fP" ++Print the oldest packages. ++.IP "\fB\-n, \-\-new\fP" ++Print the newest packages. ++.IP "\fB\-s, \-\-space\fP" ++Space-separated instead of newline-separated output. ++.IP "\fB\-k KEEP, \-\-keep=KEEP\fP" ++Newest N packages to keep - defaults to 1. ++.IP "\fB\-c, \-\-nocheck\fP" ++Do not check package payload signatures/digests. ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..fe842f5 100644 +index f5a8c5d..81601ac 100644 --- a/docs/repoquery.1 +++ b/docs/repoquery.1 -@@ -130,7 +130,8 @@ package names). This is the default. - When used with --whatrequires, search for dependencies only exactly as given. - This is effectively the opposite of --alldeps. +@@ -1,11 +1,11 @@ + .\" repoquery + .TH "repoquery" "1" "17 October 2005" "Panu Matilainen" "" + .SH "NAME" +-repoquery ++repoquery \- query information from Yum repositories + .SH "SYNOPSIS" + \fBrepoquery\fP [options] + .br +-\fBrepoquery\fP -a [options] ++\fBrepoquery\fP \-a [options] + .SH "DESCRIPTION" + .PP + \fBrepoquery\fP is a program for querying information from YUM repositories +@@ -18,7 +18,7 @@ List valid queryformat tags and exit.. + Report program version and exit. + .IP "\fB\-\-repoid=\fP" + Specify which repository to query. Using this option disables all repositories +-not explicitly enabled with --repoid option (can be used multiple times). By ++not explicitly enabled with \-\-repoid option (can be used multiple times). By + default repoquery uses whatever repositories are enabled in YUM configuration. + .IP "\fB\-\-enablerepo=\fP" + In addition to the default set, query the given additional repository, even if +@@ -30,7 +30,7 @@ configuration. Can be used multiple times. + Specify a path or url to a repository (same path as in a baseurl) to add to + the repositories for this query. This option can be used multiple times. If + you want to view only the pkgs from this repository combine this with +---repoid. The repoid for the repository is specified by . ++\-\-repoid. The repoid for the repository is specified by . + .IP "\fB\-\-plugins\fP" + Enable YUM plugin support. + .IP "\fB\-q, \-\-query\fP" +@@ -64,13 +64,13 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid + .PP + .SH "PACKAGE QUERY OPTIONS" + .IP "\fB\-i, \-\-info\fP" +-Show general information about package similarly to "rpm -qi" ++Show general information about package similarly to "rpm \-qi" + .IP "\fB\-l, \-\-list\fP" + List files in package. + .IP "\fB\-R, \-\-requires\fP" + List package dependencies. + .IP "\fB\-\-resolve\fP" +-When used with --requires, resolve capabilities to originating packages. ++When used with \-\-requires, resolve capabilities to originating packages. + .IP "\fB\-\-provides\fP" + List capabilities package provides. + .IP "\fB\-\-obsoletes\fP" +@@ -81,7 +81,7 @@ List capabilities conflicting with package. + List package changelog. + .IP "\fB\-\-location\fP" + Show a location where the package could be downloaded from. +-For example: \fBwget `repoquery --location yum`\fP ++For example: \fBwget `repoquery \-\-location yum`\fP + .IP "\fB\-s, \-\-source\fP" + Show package source RPM name. + .IP "\fB\-\-srpm\fP" +@@ -95,16 +95,16 @@ Use name-epoch:version-release.architecture output format (default) + .IP "\fB\-\-envra\fP" + Use epoch:name-version-release.architecture output format + (easier to parse than nevra) +-.IP "\fB\--qf=FORMAT, \-\-queryformat=FORMAT\fP" ++.IP "\fB\-\-qf=FORMAT, \-\-queryformat=FORMAT\fP" + Specify custom output format for queries. You can add ":date", ":day" and + ":isodate" to all the tags that are a time, and you can add ":k", ":m", ":g", + ":t" and ":h" to sizes. You can also specify field width as in + sprintf (Eg. %-20{name}) + .IP "\fB\-\-output [text|ascii-tree|dot-tree]\fP" +-Output format which can be used with --requires/--whatrequires/--obsoletes/--conflicts. ++Output format which can be used with \-\-requires/\-\-whatrequires/\-\-obsoletes/\-\-conflicts. + Default output is 'text'. + .IP "\fB\-\-level [all|any int]\fP" +-In combination with --output ascii-tree|dot-tree this option specifies the ++In combination with \-\-output ascii-tree|dot-tree this option specifies the + number of level to print on the tree. Default level is 'all'. + .PP + +@@ -112,6 +112,8 @@ number of level to print on the tree. Default level is 'all'. + .IP "\fB\-a, \-\-all\fP" + Query all available packages (for rpmquery compatibility / shorthand for + repoquery '*') ++.IP "\fB\--show-duplicates\fP" ++Query all versions of packages. + .IP "\fB\-f, \-\-file FILE\fP" + Query package owning FILE. + .IP "\fB\-\-whatobsoletes CAPABILITY\fP" +@@ -123,14 +125,15 @@ Query all packages that provide CAPABILITY. + .IP "\fB\-\-whatrequires CAPABILITY\fP" + Query all packages that require CAPABILITY. + .IP "\fB\-\-alldeps\fP" +-When used with --whatrequires, look for non-explicit dependencies in ++When used with \-\-whatrequires, look for non-explicit dependencies in + addition to explicit ones (e.g. files and Provides in addition to + package names). This is the default. + .IP "\fB\-\-exactdeps\fP" +-When used with --whatrequires, search for dependencies only exactly as given. +-This is effectively the opposite of --alldeps. ++When used with \-\-whatrequires, search for dependencies only exactly as given. ++This is effectively the opposite of \-\-alldeps. .IP "\fB\-\-recursive\fP" -When used with --whatrequires, query packages recursively. -+When used with --whatrequires, and --requires --resolve, query packages ++When used with \-\-whatrequires, and \-\-requires \-\-resolve, query packages +recursively. .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" Limit the query to packages of given architecture(s). Valid values are all architectures known to rpm/yum such as 'i386' and 'src' for -@@ -166,7 +167,7 @@ Query groups instead of packages. +@@ -166,19 +169,19 @@ Query groups instead of packages. .SH "EXAMPLES" .IP "List all packages whose name contains 'perl':" -\fBrepoquery '*perl*'\fP +\fBrepoquery \(aq*perl*\(aq\fP .IP "List all packages depending on openssl:" - \fBrepoquery --whatrequires openssl\fP +-\fBrepoquery --whatrequires openssl\fP ++\fBrepoquery \-\-whatrequires openssl\fP .IP "List all package names and the repository they come from, nicely formatted:" +-\fBrepoquery -a --qf "%-20{repoid} %{name}"\fP ++\fBrepoquery \-a \-\-qf "%-20{repoid} %{name}"\fP + .IP "List name and summary of all available updates (if any), nicely formatted:" +-\fBrepoquery -a --pkgnarrow=updates --qf "%{name}:\\n%{summary}\\n"\fP ++\fBrepoquery \-a \-\-pkgnarrow=updates \-\-qf "%{name}:\\n%{summary}\\n"\fP + .IP "List optional packages in base group:" +-\fBrepoquery -g --grouppkgs=optional -l base\fP ++\fBrepoquery \-g \-\-grouppkgs=optional \-l base\fP + .IP "List build requirements from 'anaconda' source rpm:" +-\fBrepoquery --requires anaconda.src\fP ++\fBrepoquery \-\-requires anaconda.src\fP + .IP "List packages which BuildRequire gail-devel" +-\fBrepoquery --archlist=src --whatrequires gail-devel\fP ++\fBrepoquery \-\-archlist=src \-\-whatrequires gail-devel\fP + NB: This command will only work if you have repositories enabled which include srpms. + + .\"TODO: Add more examples... +@@ -204,7 +207,7 @@ of the following: + .br + \fBepoch:name-ver-rel.arch\fP + .IP +-For example: \fBrepoquery -l kernel-2.4.1-10.i686\fP ++For example: \fBrepoquery \-l kernel-2.4.1-10.i686\fP + .br + Additionally wildcards (shell-style globs) can be used. + diff --git a/docs/reposync.1 b/docs/reposync.1 -index c1bc818..1e6c6c2 100644 +index c1bc818..29043fb 100644 --- a/docs/reposync.1 +++ b/docs/reposync.1 +@@ -1,7 +1,7 @@ + .\" reposync + .TH "reposync" "1" "27 April 2007" "" "" + .SH "NAME" +-reposync - synchronize yum repositories to a local directory ++reposync \- synchronize yum repositories to a local directory + .SH "SYNOPSIS" + \fBreposync\fP [options] + .SH "DESCRIPTION" @@ -14,7 +14,7 @@ Display a help message, and then quit. Config file to use (defaults to /etc/yum.conf). .IP "\fB\-a ARCH, \-\-arch=ARCH\fP" @@ -303,32 +768,106 @@ index c1bc818..1e6c6c2 100644 .IP "\fB\-\-source\fP" Also download .src.rpm files. .IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" -@@ -26,8 +26,11 @@ Use a temp dir for storing/accessing yum-cache. +@@ -26,21 +26,26 @@ Use a temp dir for storing/accessing yum-cache. Path to download packages to: defaults to current directory. .IP "\fB\-g, \-\-gpgcheck\fP" Remove packages that fail GPG signature checking after downloading. +exit status is '1' if at least one package was removed. .IP "\fB\-u, \-\-urls\fP" Just list urls of what would be downloaded, don't download. +-.IP "\fB\-n, \-\-newest-only\fP" +.IP "\fB\-l, \-\-plugins\fP" +Enable yum plugin support. - .IP "\fB\-n, \-\-newest-only\fP" ++.IP "\fB\-n, \-\-newest\-only\fP" Download only newest packages per-repo. .IP "\fB\-q, \-\-quiet\fP" -@@ -41,6 +44,8 @@ Output as little information as possible. - \fB reposync --repoid=updates --repoid=extras\fP + Output as little information as possible. + .SH "EXAMPLES" + .IP "Sync all packages from the 'updates' repo to the current directory:" +-\fB reposync --repoid=updates\fP ++\fB reposync \-\-repoid=updates\fP + .IP "Sync only the newest packages from the 'updates' repo to the current directory:" +-\fB reposync -n --repoid=updates\fP ++\fB reposync \-n \-\-repoid=updates\fP + .IP "Sync packages from the 'updates' and 'extras' repos to the current directory:" +-\fB reposync --repoid=updates --repoid=extras\fP ++\fB reposync \-\-repoid=updates \-\-repoid=extras\fP .IP "Sync all packages from the 'updates' repo to the \fBrepos\fP directory:" - \fB reposync -p repos --repoid=updates\fP +-\fB reposync -p repos --repoid=updates\fP ++\fB reposync \-p repos \-\-repoid=updates\fP +.IP "Sync all packages from the 'updates' repo to the \fBrepos\fP directory excluding x86_64 arch. Edit \fI/etc/yum.conf\fR adding option \fBexclude=*.x86_64\fR. Then: -+\fBreposync -p repos --repoid=updates\fP ++\fBreposync \-p repos \-\-repoid=updates\fP .SH "FILES" \fBreposync\fP uses the yum libraries for retrieving information and packages. If no configuration file is specified, the default yum +diff --git a/docs/repotrack.1 b/docs/repotrack.1 +new file mode 100644 +index 0000000..6b46ed0 +--- /dev/null ++++ b/docs/repotrack.1 +@@ -0,0 +1,44 @@ ++.\" repotrack ++.TH "repotrack" "1" "13 January 2013" "" "" ++.SH "NAME" ++repotrack \- track a package and its dependencies and download them ++.SH "SYNOPSIS" ++\fBrepotrack\fP [options] package1 [package2...] ++.SH "DESCRIPTION" ++.PP ++\fBrepotrack\fP is a program for keeping track of a particular package and its ++dependencies. It will download one or more packages and all dependencies. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-c CONFIG, \-\-config=CONFIG\fP" ++Config file to use (defaults to /etc/yum.conf). ++.IP "\fB\-a ARCH, \-\-arch=ARCH\fP" ++Act as if running the specified arch (default: current arch). ++.IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" ++Specify repo ids to query, can be specified multiple times (default is ++all enabled). ++.IP "\fB\-t, \-\-tempcache\fP" ++Use a temp dir for storing/accessing yum-cache. ++.IP "\fB\-p DESTDIR, \-\-download_path=DESTDIR\fP" ++Path to download packages to. ++.IP "\fB\-u, \-\-urls\fP" ++Instead of downloading RPMs, list the URLs that would be downloaded. ++.IP "\fB\-n, \-\-newest\fP" ++Toggle downloading only the newest packages (defaults to newest-only). ++.IP "\fB\-q, \-\-quiet\fP" ++Output as little information as possible. ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi diff --git a/docs/show-changed-rco.1 b/docs/show-changed-rco.1 -index 3e3b62c..1b0ea65 100644 +index 3e3b62c..a88c942 100644 --- a/docs/show-changed-rco.1 +++ b/docs/show-changed-rco.1 -@@ -11,7 +11,7 @@ packages Requires, Conflicts and Obsoletes data from the installed (or old) to +@@ -1,17 +1,17 @@ + .\" show-changed-rco + .TH "show-installed" "1" "30 March 2011" "James Antill" "" + .SH "NAME" +-show\-changed-\-rco ++show\-changed\-rco \- show changes in an RPM package + .SH "SYNOPSIS" +-\fBshow\-changed-\-rco\fP [options] ++\fBshow\-changed\-rco\fP [options] + .SH "DESCRIPTION" + .PP +-\fBshow\-changed-\-rco\fP gives a compact description of the changes to a ++\fBshow\-changed\-rco\fP gives a compact description of the changes to a + packages Requires, Conflicts and Obsoletes data from the installed (or old) to a specified rpm file. .SH OPTIONS .TP @@ -337,10 +876,46 @@ index 3e3b62c..1b0ea65 100644 show this help message and exit .IP "\fB\-C, \-\-cache\fP" Tells repoquery to run entirely from YUM cache - does not download any metadata +@@ -22,7 +22,7 @@ Use alternative config file (default is /etc/yum.conf). + + .IP "\fB\-\-repoid=\fP" + Specify which repository to query. Using this option disables all repositories +-not explicitly enabled with --repoid option (can be used multiple times). By ++not explicitly enabled with \-\-repoid option (can be used multiple times). By + default repoquery uses whatever repositories are enabled in YUM configuration. + .IP "\fB\-\-enablerepo=\fP" + In addition to the default set, query the given additional repository, even if +@@ -34,13 +34,13 @@ configuration. Can be used multiple times. + Specify a path or url to a repository (same path as in a baseurl) to add to + the repositories for this query. This option can be used multiple times. If + you want to view only the pkgs from this repository combine this with +---repoid. The repoid for the repository is specified by . ++\-\-repoid. The repoid for the repository is specified by . + +-.IP "\fB\-\-old-packages=\fP" ++.IP "\fB\-\-old\-packages=\fP" + Explicitly list the valid old packages to match the new packages against. +-.IP "\fB\-\-ignore-arch\fP" ++.IP "\fB\-\-ignore\-arch\fP" + Ignore arch. so you can compare foo-2.i686 to foo-1.x86_64. +-.IP "\fB\-\-skip-new\fP" ++.IP "\fB\-\-skip\-new\fP" + Only give output for packages which we've found an old package for. + + .PP diff --git a/docs/show-installed.1 b/docs/show-installed.1 -index 7072b63..18c4af8 100644 +index 7072b63..0907ea2 100644 --- a/docs/show-installed.1 +++ b/docs/show-installed.1 +@@ -1,7 +1,7 @@ + .\" show-installed + .TH "show-installed" "1" "21 October 2010" "Florian Festi" "" + .SH "NAME" +-show\-installed ++show\-installed \- show installed RPM packages and descriptions + .SH "SYNOPSIS" + \fBshow\-installed\fP [options] + .SH "DESCRIPTION" @@ -16,10 +16,10 @@ show this help message and exit yum, kickstart or human; yum gives the result as a yum command line; kickstart the content of a %packages section; "human" readable is default. .TP @@ -354,23 +929,203 @@ index 7072b63..18c4af8 100644 .TP .B \-q, \-\-quiet Do not show warnings. +diff --git a/docs/verifytree.1 b/docs/verifytree.1 +new file mode 100644 +index 0000000..1389e0f +--- /dev/null ++++ b/docs/verifytree.1 +@@ -0,0 +1,33 @@ ++.\" verifytree ++.TH "verifytree" "1" "13 January 2013" "" "" ++.SH "NAME" ++verifytree \- verify that a local yum repository is consistent ++.SH "SYNOPSIS" ++\fBverifytree\fP [options] directory ++.SH "DESCRIPTION" ++.PP ++\fBverifytree\fP is a program that verifies whether a local yum repository is ++consistent. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-a, \-\-checkall\fP" ++Check all packages in the repository. ++.IP "\fB\-t TESTOPIA, \-\-testopia=TESTOPIA\fP" ++Report results to the given testopia run number. ++.IP "\fB\-r, \-\-treeinfo\fP" ++Check the checksums of listed files in a .treeinfo file, if available. ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi diff --git a/docs/yum-aliases.1 b/docs/yum-aliases.1 -index c0f148d..8b943d4 100644 +index c0f148d..62fae3e 100644 --- a/docs/yum-aliases.1 +++ b/docs/yum-aliases.1 -@@ -28,7 +28,7 @@ last form creates a new alias. +@@ -26,9 +26,9 @@ last form creates a new alias. .PP - When you type an aliased command, like "yum --disableexcludes UPT lsu" using + .SH Explanation of alias to final result conversion + .PP +-When you type an aliased command, like "yum --disableexcludes UPT lsu" using ++When you type an aliased command, like "yum \-\-disableexcludes UPT lsu" using the default aliases, the yum-aliases plugin first takes the first "command", by -skiping over any options, and then looks up the result (in this case "UPT" is converted to "--enablerepo=updates-tesintg"). If there is a match, then it will -+skipping over any options, and then looks up the result (in this case "UPT" is converted to "--enablerepo=updates-testing"). If there is a match, then it will ++skipping over any options, and then looks up the result (in this case "UPT" is converted to "\-\-enablerepo=updates-testing"). If there is a match, then it will replace the aliased "command" in the argument list and try again (again skipping over any options). By convention, in the default aliases list, alias "commands" that are in all CAPS only add options so you can join together a +@@ -49,19 +49,19 @@ yum + .B alias + rm remove + .PP +-To always add the --skip-broken --disableexcludes=all --obsoletes options to ++To always add the \-\-skip\-broken \-\-disableexcludes=all \-\-obsoletes options to + the update command (but leaving the upgrade option alone), you could use: + .IP + yum + .B alias +-update \\update --skip-broken --disableexcludes=all --obsoletes ++update \\update \-\-skip\-broken \-\-disableexcludes=all \-\-obsoletes + .PP + To override the default "up" alias to use the above update command, and never + ask for confirmation, you could use: + .IP + yum + .B alias +-up update -y ++up update \-y + .br + + +diff --git a/docs/yum-builddep.1 b/docs/yum-builddep.1 +index 4e6c1d7..ac7601e 100644 +--- a/docs/yum-builddep.1 ++++ b/docs/yum-builddep.1 +@@ -1,7 +1,7 @@ + .\" yum-builddep + .TH "yum-builddep" "1" "17 July 2005 " "Panu Matilainen" "" + .SH "NAME" +-yum-builddep ++yum-builddep \- install missing dependencies for building an RPM package + .SH "SYNOPSIS" + \fByum-builddep\fP package + .SH "DESCRIPTION" +diff --git a/docs/yum-changelog.1 b/docs/yum-changelog.1 +index 64910dc..c7b5486 100644 +--- a/docs/yum-changelog.1 ++++ b/docs/yum-changelog.1 +@@ -14,12 +14,12 @@ is a Yum plugin for viewing package changelogs before/after updating. + yum will invoke + .BR yum-changelog(1) + plugin if the +-.B --changelog ++.B \-\-changelog + option or the + .B changelog + command is used with yum. + .SH OPTIONS +-.IP --changelog ++.IP \-\-changelog + Show changelog delta of updated packages + .SH COMMANDS + .IP changelog +@@ -53,7 +53,7 @@ changelog stats. 33 pkgs, 12 source pkgs, 1 changelog + .br + .br + # yum update ktechlab +-.B --changelog ++.B \-\-changelog + .br + Loading "changelog" plugin + .br +diff --git a/docs/yum-complete-transaction.8 b/docs/yum-complete-transaction.8 +index 945eee8..965c0b1 100644 +--- a/docs/yum-complete-transaction.8 ++++ b/docs/yum-complete-transaction.8 +@@ -1,13 +1,13 @@ + .\" yum-complete-transaction + .TH "yum-complete-transaction" "8" "10 December 2007" "Seth Vidal" "" + .SH "NAME" +-yum-complete-transaction ++yum-complete-transaction \- attempt to complete failed or aborted Yum transactions + .SH "SYNOPSIS" + \fByum-complete-transaction\fP [options] + .SH "GENERAL OPTIONS" + .IP "\fB\-h, \-\-help\fP" + Help; display a help message and then quit\&. +-.IP "\fB\-\-cleanup-only\fP" ++.IP "\fB\-\-cleanup\-only\fP" + Only clean up only transaction journal files and exit\&. + + .SH "DESCRIPTION" +diff --git a/docs/yum-config-manager.1 b/docs/yum-config-manager.1 +new file mode 100644 +index 0000000..81b895b +--- /dev/null ++++ b/docs/yum-config-manager.1 +@@ -0,0 +1,39 @@ ++.\" yum-config-manager ++.TH "yum-config-manager" "1" "13 January 2013" "" "" ++.SH "NAME" ++yum-config-manager \- manage yum configuration options and yum repositories ++.SH "SYNOPSIS" ++\fByum-config-manager\fP [options] ++.SH "DESCRIPTION" ++.PP ++\fByum-config-manager\fP is a program that can manage main yum configuration ++options, toggle which repositories are enabled or disabled, and add new ++repositories. ++.PP ++.SH "OPTIONS" ++.IP "\fB\-h, \-\-help\fP" ++Display a help message, and then quit. ++.IP "\fB\-\-save\fP" ++Save the current options (useful with \-\-setopt). ++.IP "\fB\-\-enable\fP" ++Enable the specified repos (automatically saves). ++.IP "\fB\-\-disable\fP" ++Disable the specified repos (automatically saves). ++.IP "\fB\-\-add\-repo=ADDREPO\fP" ++Add (and enable) the repo from the specified file or url. ++.SH "ADDITIONAL OPTIONS" ++Yum-config-manager inherits all other options from yum. See the yum(8) ++man page for more information. ++ ++.PP ++.SH "SEE ALSO" ++.nf ++.I yum.conf (5) ++http://yum.baseurl.org/ ++.fi ++ ++.PP ++.SH "AUTHORS" ++.nf ++See the Authors file included with this program. ++.fi diff --git a/docs/yum-debug-dump.1 b/docs/yum-debug-dump.1 -index 0e65a07..71e5f3f 100644 +index 0e65a07..3f1e2e5 100644 --- a/docs/yum-debug-dump.1 +++ b/docs/yum-debug-dump.1 +@@ -1,7 +1,7 @@ + .\" yum-debug-dump + .TH "yum-debug-dump" "1" "28 April 2008" "Seth Vidal" "" + .SH "NAME" +-yum-debug-dump ++yum-debug-dump \- write system RPM configuration to a debug-dump file + .SH "SYNOPSIS" + \fByum-debug-dump\fP + .SH "DESCRIPTION" @@ -10,11 +10,15 @@ yum-debug-dump lot of information useful to developers trying to debug a problem. .PP @@ -398,14 +1153,14 @@ index 0e65a07..71e5f3f 100644 .fi diff --git a/docs/yum-debug-restore.1 b/docs/yum-debug-restore.1 new file mode 100644 -index 0000000..ba96a05 +index 0000000..c9d388d --- /dev/null +++ b/docs/yum-debug-restore.1 @@ -0,0 +1,62 @@ +.\" yum-debug-dump +.TH "yum-debug-restore" "1" "15 December 2011" "James Antill" "" +.SH "NAME" -+yum-debug-restore ++yum-debug-restore \- replay Yum transactions captured in a debug-dump file +.SH "SYNOPSIS" +\fByum-debug-restore\fP +.SH "DESCRIPTION" @@ -420,13 +1175,13 @@ index 0000000..ba96a05 +Output the commands that would be run to stdout. +.IP "\fB\-\-shell=\fP" +Output the commands that would be run to a file. -+.IP "\fB\-\-install-latest\fP" ++.IP "\fB\-\-install\-latest\fP" +Ask yum to install the latest version of the given packages, instead of the +version that was installed in the debug-dump file. -+.IP "\fB\-\-ignore-arch\fP" ++.IP "\fB\-\-ignore\-arch\fP" +Ignore the architecture of the packages, so you can "restore" an i386 debug-dump +on an x86_64 machine. -+.IP "\fB\-\-filter-types=[install,remove,update,downgrade]\fP" ++.IP "\fB\-\-filter\-types=[install,remove,update,downgrade]\fP" +Only perform the given types of commands, so you can filter to just upgrades +and installs. + @@ -465,44 +1220,106 @@ index 0000000..ba96a05 + +.fi diff --git a/docs/yum-filter-data.1 b/docs/yum-filter-data.1 -index 6d7f1e4..b26f1fd 100644 +index 6d7f1e4..75a8236 100644 --- a/docs/yum-filter-data.1 +++ b/docs/yum-filter-data.1 -@@ -44,7 +44,7 @@ This option includes packages which have a committer which matches one of the +@@ -16,52 +16,52 @@ is treated as a match. + These are the options added to yum that are available in the "list updates", + "info updates", "check-update" and "update" commands. They are: + .PP +-.IP "\fB\--filter-vendors\fP" ++.IP "\fB\-\-filter\-vendors\fP" + This option includes packages which have a vendor which matches one of the + passed vendor wildcard strings, or is unknown. Note that vendors can have + spaces in their value, so "," is the only way to specify multiple vendors as one + option argument. +-.IP "\fB\--filter-rpm-groups\fP" ++.IP "\fB\-\-filter\-rpm\-groups\fP" + This option includes packages which have a group which matches one of the + passed rpm group wildcard strings, or is unknown. Note that rpm groups can have + spaces in their value, so "," is the only way to specify multiple rpm groups as + one option argument. +-.IP "\fB\--filter-packagers\fP" ++.IP "\fB\-\-filter\-packagers\fP" + This option includes packages which have a packager which matches one of the + passed packager wildcard strings, or is unknown. Note that vendors can have + spaces in their value, so "," is the only way to specify multiple packagers as + one option argument. +-.IP "\fB\--filter-licenses\fP" ++.IP "\fB\-\-filter\-licenses\fP" + This option includes packages which have a license which matches one of the + passed license wildcard strings, or is unknown. Note that licenses can have + spaces in their value, so "," is the only way to specify multiple licenses as + one option argument. +-.IP "\fB\--filter-arches\fP" ++.IP "\fB\-\-filter\-arches\fP" + This option includes packages which have a arch which matches one of the + passed arch wildcard strings, or is unknown. +-.IP "\fB\--filter-committers\fP" ++.IP "\fB\-\-filter\-committers\fP" + This option includes packages which have a committer which matches one of the passed committer wildcard strings, or is unknown. Note that committers can have spaces in their value, so "," is the only way to specify multiple committers as one option argument. Also, committer values are so loosely formed that they -could contain commas too, it is recommeneded to not do that but you can work +could contain commas too, it is recommended to not do that but you can work around it by using "?". - .IP "\fB\--filter-buildhosts\fP" +-.IP "\fB\--filter-buildhosts\fP" ++.IP "\fB\-\-filter\-buildhosts\fP" This option includes packages which have a buildhost which matches one of the -@@ -77,23 +77,23 @@ yum --filter-package-sizes=-1m check-update + passed buildhost wildcard strings, or is unknown. +-.IP "\fB\--filter-urls\fP" ++.IP "\fB\-\-filter\-urls\fP" + This option includes packages which have a url which matches one of the + passed url wildcard strings, or is unknown. +-.IP "\fB\--filter-package-sizes\fP" ++.IP "\fB\-\-filter\-package\-sizes\fP" + This option includes packages which have a packagesize which is within one of + the passed packagesize ranges, or is unknown. +-.IP "\fB\--filter-archive-sizes\fP" ++.IP "\fB\-\-filter\-archive\-sizes\fP" + This option includes packages which have a archivesize which is within one of + the passed archivesize ranges, or is unknown. +-.IP "\fB\--filter-installed-sizes\fP" ++.IP "\fB\-\-filter\-installed\-sizes\fP" + This option includes packages which have a installedsize which is within one of + the passed installedsize ranges, or is unknown. +-.IP "\fB\--filter-groups\fP" ++.IP "\fB\-\-filter\-groups\fP" + This option includes packages which are in a yum group which matches one of the + passed yum group id strings, or is unknown. Note that yum groups can have + spaces in their value, so "," is the only way to specify multiple yum groups as +@@ -73,27 +73,27 @@ one option argument. + .PP + To list all updates that are 1 MB or less use: + .IP +-yum --filter-package-sizes=-1m check-update ++yum \-\-filter\-package\-sizes=-1m check-update .PP To apply updates that Dan Walsh has committed use: .IP -yum --filter-committers='Dan Walsh *' update -+yum --filter-committers=\(aqDan Walsh *\(aq update ++yum \-\-filter\-committers=\(aqDan Walsh *\(aq update .PP To list updates for a specific group use: .IP -yum --filter-rpm-groups='App*/Sys*' list updates -+yum --filter-rpm-groups=\(aqApp*/Sys*\(aq list updates ++yum \-\-filter\-rpm\-groups=\(aqApp*/Sys*\(aq list updates .PP To apply updates to a specific set of groups use: .IP -yum --filter-rpm-groups='App*/System,Devel*/Lib*,System Environment/Base' update -+yum --filter-rpm-groups=\(aqApp*/System,Devel*/Lib*,System Environment/Base\(aq update ++yum \-\-filter\-rpm\-groups=\(aqApp*/System,Devel*/Lib*,System Environment/Base\(aq update .PP To list updates for a set of yum groups use: .IP -yum --filter-groups='PostgreSQL Database,Web Server' list updates -+yum --filter-groups=\(aqPostgreSQL Database,Web Server\(aq list updates ++yum \-\-filter\-groups=\(aqPostgreSQL Database,Web Server\(aq list updates .PP To apply updates to a specific set of yum groups use: .IP -yum --filter-groups='KDE,Core,Printing Support' update -+yum --filter-groups=\(aqKDE,Core,Printing Support\(aq update ++yum \-\-filter\-groups=\(aqKDE,Core,Printing Support\(aq update .SH "SEE ALSO" .nf @@ -516,7 +1333,7 @@ index 6d7f1e4..b26f1fd 100644 Apart from that there are no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful diff --git a/docs/yum-fs-snapshot.conf.5 b/docs/yum-fs-snapshot.conf.5 -index a4b4f02..4ac623a 100644 +index a4b4f02..68bb2e8 100644 --- a/docs/yum-fs-snapshot.conf.5 +++ b/docs/yum-fs-snapshot.conf.5 @@ -20,6 +20,10 @@ utilizes configuration options in the form of @@ -530,21 +1347,29 @@ index a4b4f02..4ac623a 100644 .SH OPTION - [lvm] section .IP enabled This is a boolean value used to control whether LVM snapshots will be -@@ -28,7 +32,8 @@ created for filesystems built on LVM logical volumes. +@@ -27,8 +31,9 @@ created for filesystems built on LVM logical volumes. + .SH OPTION - [lvm] section .IP lvcreate_size_args This is the space delimited lvcreate argument list that is used to - specify the size of the snapshot LV. Valid lvcreate size options are -l +-specify the size of the snapshot LV. Valid lvcreate size options are -l -or -L. If not specified then LVM snapshots will not be created. -+or -L. If not specified then LVM snapshots will not be created for ++specify the size of the snapshot LV. Valid lvcreate size options are \-l ++or \-L. If not specified then LVM snapshots will not be created for +volumes that are not thinly provisioned. .SH AUTHOR .RS Josef Bacik diff --git a/docs/yum-groups-manager.1 b/docs/yum-groups-manager.1 -index f49bde9..c256c45 100644 +index f49bde9..9854884 100644 --- a/docs/yum-groups-manager.1 +++ b/docs/yum-groups-manager.1 -@@ -6,7 +6,7 @@ yum-groups-manager - create and edit yum's group metadata +@@ -1,12 +1,12 @@ + .\" yum-groups-manager + .TH "yum-groups-manager" "1" "23 August 2008" "" "" + .SH "NAME" +-yum-groups-manager - create and edit yum's group metadata ++yum-groups-manager \- create and edit yum's group metadata + .SH "SYNOPSIS" \fByum-groups-manager\fP [options] [packages] .SH "DESCRIPTION" \fByum-groups-manager\fP is used to create or edit a group metadata file for a @@ -567,12 +1392,13 @@ index f49bde9..c256c45 100644 .SH "EXAMPLES" .IP "Create a new group metadata file, with a group called yum containing all the packages that start with yum:" -\fB yum-groups-manager --name YUM --save groups.xml 'yum*'\fP -+\fB yum-groups-manager --name YUM --save groups.xml \(aqyum*\(aq\fP ++\fB yum-groups-manager \-\-name YUM \-\-save groups.xml \(aqyum*\(aq\fP .IP "After the above command, load the groups.xml data, work with the yum group, make the group not user visible, and remove the yum-skip-broken and yum-priorities packages from it:" - \fB yum-groups-manager -n YUM --merge groups.xml --remove yum-skip-broken yum-priorities --not-user-visible\fP +-\fB yum-groups-manager -n YUM --merge groups.xml --remove yum-skip-broken yum-priorities --not-user-visible\fP ++\fB yum-groups-manager \-n YUM \-\-merge groups.xml \-\-remove yum-skip-broken yum-priorities \-\-not\-user\-visible\fP .IP "After the above commands, add a description and a translated name to the yum group:" -\fB yum-groups-manager -n YUM --merge groups.xml --description 'This is a group with most of the yum packages in it' --translated-name 'en:yum packages'\fP -+\fB yum-groups-manager -n YUM --merge groups.xml --description \(aqThis is a group with most of the yum packages in it\(aq --translated-name \(aqen:yum packages\(aq\fP ++\fB yum-groups-manager \-n YUM \-\-merge groups.xml \-\-description \(aqThis is a group with most of the yum packages in it\(aq \-\-translated\-name \(aqen:yum packages\(aq\fP .SH "FILES" \fByum-groups-manager\fP uses the yum libraries for retrieving information and packages. If no configuration file is specified, the default yum @@ -617,7 +1443,7 @@ index d855104..a5477d6 100644 To list ranges of the sizes of packages installed or available, use: .IP diff --git a/docs/yum-security.8 b/docs/yum-security.8 -index 7e260b0..9c8dbf3 100644 +index 7e260b0..c7d9c8b 100644 --- a/docs/yum-security.8 +++ b/docs/yum-security.8 @@ -6,13 +6,13 @@ yum security plugin @@ -646,25 +1472,50 @@ index 7e260b0..9c8dbf3 100644 .br .I \fR yum updateinfo * all .br -@@ -109,7 +109,7 @@ distribution. +@@ -108,40 +108,40 @@ distribution. + .SH "GENERAL OPTIONS" There are four options added to yum that are available in the "list updates", "info updates", "check-update" and "update" commands. They are: .PP - .IP "\fB\--advisory\fP" +-.IP "\fB\--advisory\fP" -This option includes packages coresponding to the advisory ID, Eg. FEDORA-2201-123. +-.IP "\fB\--bz\fP" ++.IP "\fB\-\-advisory\fP" +This option includes packages corresponding to the advisory ID, Eg. FEDORA-2201-123. - .IP "\fB\--bz\fP" ++.IP "\fB\-\-bz\fP" This option includes packages that say they fix a Bugzilla ID, Eg. 123. - .IP "\fB\--cve\fP" -@@ -123,7 +123,7 @@ This option includes packages that say they fix a security issue. +-.IP "\fB\--cve\fP" ++.IP "\fB\-\-cve\fP" + This option includes packages that say they fix a CVE - Common Vulnerabilities and Exposures ID (http://cve.mitre.org/about/), Eg. CVE-2201-0123. +-.IP "\fB\--bugfixes\fP" ++.IP "\fB\-\-bugfixes\fP" + This option includes packages that say they fix a bugfix issue. +-.IP "\fB\--security\fP" ++.IP "\fB\-\-security\fP" + This option includes packages that say they fix a security issue. + .PP + .PP .SH "EXAMPLES" .PP -To list all updates that are security relevant, and get a reutrn code on whether there are security updates use: +To list all updates that are security relevant, and get a return code on whether there are security updates use: .IP - yum --security check-update +-yum --security check-update ++yum \-\-security check-update .PP -@@ -141,7 +141,7 @@ To get a list of all BZs that are fixed for packages you have installed use: + To upgrade packages that have security errata (upgrades to the latest + available package) use: + .IP +-yum --security update ++yum \-\-security update + .PP + To upgrade packages that have security errata (upgrades to the last + security errata package) use: + .IP +-yum --security update-minimal ++yum \-\-security update-minimal + .PP + To get a list of all BZs that are fixed for packages you have installed use: .IP yum updateinfo list bugzillas .PP @@ -673,26 +1524,52 @@ index 7e260b0..9c8dbf3 100644 installed use: .IP yum updateinfo list all security -@@ -185,6 +185,6 @@ James Antill . +@@ -152,15 +152,15 @@ yum updateinfo info FEDORA-2707-4567 + .PP + To update packages to the latest version which contain fixes for Bugzillas 123, 456 and 789; and all security updates use: + .IP +-yum --bz 123 --bz 456 --bz 789 --security update ++yum \-\-bz 123 \-\-bz 456 \-\-bz 789 \-\-security update + .PP + To update to the packages which just update Bugzillas 123, 456 and 789; and all security updates use: + .IP +-yum --bz 123 --bz 456 --bz 789 --security update-minimal ++yum \-\-bz 123 \-\-bz 456 \-\-bz 789 \-\-security update-minimal + .PP + To get an info list of the latest packages which contain fixes for Bugzilla 123; CVEs CVE-2207-0123 and CVE-2207-3210; and Fedora advisories FEDORA-2707-4567 and FEDORA-2707-7654 use: + .IP +-yum --bz 123 --cve CVE-2207-0123 --cve CVE-2207-3210 --advisory FEDORA-2707-4567 --advisory FEDORA-2707-7654 info updates ++yum \-\-bz 123 \-\-cve CVE-2207-0123 \-\-cve CVE-2207-3210 \-\-advisory FEDORA-2707-4567 \-\-advisory FEDORA-2707-7654 info updates + .PP + To get a list of packages which are "new". + .IP +@@ -183,8 +183,8 @@ James Antill . + .fi + .SH "BUGS" - The update-minimal command ignores the --obsoletes flag. +-The update-minimal command ignores the --obsoletes flag. ++The update-minimal command ignores the \-\-obsoletes flag. -The update-minimal command can only directly affect things atm., so if you update pkgA minimally but that requires an update to pkgB then pkgB will be updated to the newest version by the depsolver. Also the above will happen even if you've also minimally updated pkgB, if either the direct (minimal) update for pkgB happens after or if the minimal update for pkgB doesn't satisy the requirements of pkgA. +The update-minimal command can only directly affect things atm., so if you update pkgA minimally but that requires an update to pkgB then pkgB will be updated to the newest version by the depsolver. Also the above will happen even if you've also minimally updated pkgB, if either the direct (minimal) update for pkgB happens after or if the minimal update for pkgB doesn't satisfy the requirements of pkgA. - The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "--bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. +-The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "--bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. ++The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "\-\-bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. diff --git a/docs/yum-utils.1 b/docs/yum-utils.1 -index fa830b6..fdfbe24 100644 +index fa830b6..3f858a8 100644 --- a/docs/yum-utils.1 +++ b/docs/yum-utils.1 -@@ -15,6 +15,7 @@ yum\-utils \- tools for manipulating repositories and extended package managemen +@@ -15,8 +15,9 @@ yum\-utils \- tools for manipulating repositories and extended package managemen \fBrepoquery\fR \- query yum repositories and get additional information on the them \fBreposync\fR \- synchronize a remote yum repository to a local directory using yum to retrieve packages \fBrepotrack\fR \- track packages and its dependencies and downloads them +\fBshow-changed-rco\fR \- list of changes to a package Requires, Conflicts and Obsoletes data from installed to a specified rpm file \fBshow-installed\fR \- gives a compact description of packages installed and makes use of comps groups in repositories - \fBverifytree\fR - verify that a local yum repository is consistent +-\fBverifytree\fR - verify that a local yum repository is consistent ++\fBverifytree\fR \- verify that a local yum repository is consistent \fByum\-builddep\fR \- installs missing dependencies to build a specified package + \fByum\-complete\-transaction\fR \- finds incomplete or aborted yum transactions and attempts to complete them + \fByum\-config\-manager\fR \- toggle yum repositories, add new repositories and set main yum configuration options @@ -32,6 +33,6 @@ is a collection of tools and programs for managing yum repositories, installing .SH "NOTES" See respective tools for additional help for commands without a manual page @@ -702,10 +1579,19 @@ index fa830b6..fdfbe24 100644 .SH "AUTHOR" Shawn Starr diff --git a/docs/yum-verify.1 b/docs/yum-verify.1 -index 706c38e..50ede75 100644 +index 706c38e..5246a1c 100644 --- a/docs/yum-verify.1 +++ b/docs/yum-verify.1 -@@ -24,7 +24,7 @@ only verify packages that are installed on the system. +@@ -6,7 +6,7 @@ yum verify plugin + \fByum\fP [options] verify [package ...] + .SH "DESCRIPTION" + .PP +-This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm -V. You can change how the verification is done and which files it applies to. ++This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm \-V. You can change how the verification is done and which files it applies to. + .PP + added yum \fIcommand\fPs are: + .br +@@ -24,12 +24,12 @@ only verify packages that are installed on the system. .br .PP .IP "\fBverify\fP" @@ -714,7 +1600,30 @@ index 706c38e..50ede75 100644 output. It removes all false matches due to multilib and ignores changes to configuration files by default. .IP -@@ -53,15 +53,15 @@ yum verify-rpm + .IP "\fBverify-rpm\fP" +-Is meant to be 100% compatible with rpm -V output, and any differences should be ++Is meant to be 100% compatible with rpm \-V output, and any differences should be + considered as bugs. + .IP + .IP "\fBverify-all\fP" +@@ -39,29 +39,29 @@ Is used to list all the differences, including some that rpm itself will ignore. + These are the options added to yum that are available in the verify commands. + They are: + .PP +-.IP "\fB\--verify-filenames\fP" ++.IP "\fB\-\-verify\-filenames\fP" + This option is used to limit the filenames that the packages will perform + verification. +-.IP "\fB\--verify-configuration-files\fP" ++.IP "\fB\-\-verify\-configuration\-files\fP" + This option is only useful in the generic verify command, and will + enable/disable verification of files that are tagged as configuration files. + .SH "EXAMPLES" + .PP +-To do the same as rpm -Va, use: ++To do the same as rpm \-Va, use: + .IP + yum verify-rpm .PP To verify the packages starting with the name yum, use: .IP @@ -724,12 +1633,12 @@ index 706c38e..50ede75 100644 To verify the binaries that are in a bin directory, use: .IP -yum verify --verify-filenames='*bin/*' -+yum verify --verify-filenames=\(aq*bin/*\(aq ++yum verify \-\-verify\-filenames=\(aq*bin/*\(aq .PP To verify all include files, Eg. for multilib problems, use: .IP -yum verify-all --verify-filenames='/usr/include/*' -+yum verify-all --verify-filenames=\(aq/usr/include/*\(aq ++yum verify-all \-\-verify\-filenames=\(aq/usr/include/*\(aq .SH "SEE ALSO" .nf @@ -743,9 +1652,18 @@ index 706c38e..50ede75 100644 Should you find any other bugs, you should first diff --git a/docs/yum-versionlock.1 b/docs/yum-versionlock.1 -index f68665e..ee5f053 100644 +index f68665e..f7cd467 100644 --- a/docs/yum-versionlock.1 +++ b/docs/yum-versionlock.1 +@@ -3,7 +3,7 @@ + .\" + .TH YUM-VERSIONLOCK 1 "28 December 2009" "" "User Manuals" + .SH NAME +-yum-versionlock - Version lock rpm packages ++yum-versionlock \- Version lock rpm packages + .SH SYNOPSIS + .B yum-versionlock + [ package-name [ package-name]] ... @@ -67,7 +67,7 @@ Panu Matilainen .br James Antill @@ -755,6 +1673,44 @@ index f68665e..ee5f053 100644 .br Gerhardus Geldenhuis .SH "SEE ALSO" +diff --git a/docs/yumdb.8 b/docs/yumdb.8 +index 63a3c6b..600a3a9 100644 +--- a/docs/yumdb.8 ++++ b/docs/yumdb.8 +@@ -1,7 +1,7 @@ + .\" yumdb command + .TH "yumdb" "8" "8 April 2010" "James Antill" "" + .SH "NAME" +-yumdb command ++yumdb \- query and alter the Yum database + .SH "SYNOPSIS" + \fByumdb\fP [command] [packages ...] + .SH "DESCRIPTION" +diff --git a/docs/yumdownloader.1 b/docs/yumdownloader.1 +index a8a3b16..e290268 100644 +--- a/docs/yumdownloader.1 ++++ b/docs/yumdownloader.1 +@@ -1,7 +1,7 @@ + .\" yumdownloader + .TH "yumdownloader" "1" "28 November 2005" "Gijs Hollestelle" "" + .SH "NAME" +-yumdownloader ++yumdownloader \- download RPM packages from Yum repositories + .SH "SYNOPSIS" + \fByumdownloader\fP [options] package1 [package2...] + .SH "DESCRIPTION" +@@ -31,9 +31,9 @@ for more information + + .SH "EXAMPLES" + .IP "Download the kernel RPM to /var/tmp:" +-\fByumdownloader --destdir /var/tmp kernel\fP ++\fByumdownloader \-\-destdir /var/tmp kernel\fP + .IP "List the URL for the kernel and kernel-smp RPMs:" +-\fByumdownloader --urls kernel kernel-smp\fP ++\fByumdownloader \-\-urls kernel kernel-smp\fP + .PP + .SH "FILES" + As yumdownloader uses YUM libraries for retrieving all the information, it diff --git a/find-repos-of-install.py b/find-repos-of-install.py index 0578295..aac29ea 100644 --- a/find-repos-of-install.py @@ -882,7 +1838,7 @@ index 6bc883f..a6946b0 100755 try: cmdline = open('/proc/' +pid+ '/cmdline', 'r').read() diff --git a/package-cleanup.py b/package-cleanup.py -index 4794369..aebae67 100755 +index 4794369..acad9f2 100755 --- a/package-cleanup.py +++ b/package-cleanup.py @@ -12,11 +12,11 @@ @@ -935,7 +1891,7 @@ index 4794369..aebae67 100755 def _find_installed_duplicates(self, ignore_kernel=True): """find installed duplicate packages returns a dict of pkgname = [[dupe1, dupe2], [dupe3, dupe4]] """ -@@ -282,12 +254,23 @@ class PackageCleanup(YumUtilBase): +@@ -282,18 +254,29 @@ class PackageCleanup(YumUtilBase): else: kver = runningkernel krel = "" @@ -961,6 +1917,13 @@ index 4794369..aebae67 100755 print "Not removing kernel %s-%s because it is the running kernel" % (kver,krel) else: toremove.append(kernel) + + +- # Now extend the list with all kernel-devel pacakges that either ++ # Now extend the list with all kernel-devel packages that either + # have no matching kernel installed or belong to a kernel that is to + # be removed + if not keepdevel: @@ -314,9 +297,9 @@ class PackageCleanup(YumUtilBase): self.setCacheDir() @@ -1000,6 +1963,35 @@ index 39993ad..9ff927c 100644 for opt, repoexp in opts.repos: if opt == '--disablerepo': mdrs.add(repoexp) +diff --git a/plugins/changelog/changelog.py b/plugins/changelog/changelog.py +index 16144c6..d09281a 100644 +--- a/plugins/changelog/changelog.py ++++ b/plugins/changelog/changelog.py +@@ -102,7 +102,7 @@ class ChangeLogCommand: + return ['changelog', 'ChangeLog'] + + def getUsage(self): +- return "||all [PACKAGE|all|installed|updates|extras|obsoletes|recent]" ++ return "[||all] [PACKAGE|all|installed|updates|extras|obsoletes|recent]" + + def getSummary(self): + return """\ +@@ -212,6 +212,15 @@ Display changelog data, since a specified time, on a group of packages""" + msg = "Argument -- %s -- is not valid: %s" % (since, to_str(e)) + raise PluginYumExit(msg) + ++ if self._since_dto == dateutil_parser.parse('garbage', fuzzy=True): ++ # 'since' was a package name, not a date ++ extcmds.insert(0, since) ++ ++ # assume since="all" ++ self._since_all = True ++ self._since_dto = None ++ self._since_tt = None ++ + ypl = base.returnPkgLists(extcmds) + self.show_data(msg, ypl.installed, 'Installed Packages') + self.show_data(msg, ypl.available, 'Available Packages') diff --git a/plugins/downloadonly/downloadonly.conf b/plugins/downloadonly/downloadonly.conf deleted file mode 100644 index 8e4d76c..0000000 @@ -1761,7 +2753,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..403074b 100755 +index a3bb111..1531583 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -2173,17 +3165,23 @@ index a3bb111..403074b 100755 if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: -@@ -1328,7 +1438,8 @@ def main(args): +@@ -1327,8 +1437,13 @@ def main(args): + else: baseurl = repopath - repoq.add_enable_repo(repoid, baseurls=[baseurl], +- repoq.add_enable_repo(repoid, baseurls=[baseurl], - basecachedir=repoq.conf.cachedir) -+ basecachedir=repoq.conf.cachedir, -+ timestamp_check=False) ++ try: ++ repoq.add_enable_repo(repoid, baseurls=[baseurl], ++ basecachedir=repoq.conf.cachedir, ++ timestamp_check=False) ++ except yum.Errors.DuplicateRepoError, e: ++ repoq.logger.error(e) ++ continue if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) -@@ -1359,6 +1470,13 @@ def main(args): +@@ -1359,6 +1474,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -2197,20 +3195,20 @@ index a3bb111..403074b 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1381,6 +1499,12 @@ def main(args): +@@ -1380,6 +1502,12 @@ def main(args): + for repo in repoq.repos.findRepos(repo_match): repo.enable() - try: -+ repoq.doLock() -+ except yum.Errors.LockError, e: ++ while True: ++ try: repoq.doLock(); break ++ except yum.Errors.LockError, e: pass + repoq.logger.error(e) -+ sys.exit(50) ++ time.sleep(2) + -+ try: + try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) - elif archlist is not None: -@@ -1396,10 +1520,15 @@ def main(args): +@@ -1396,10 +1524,15 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -2679,7 +3677,7 @@ index d7a37c3..b9e682a 100755 for d in rpm.ds(spec.sourceHeader, 'requires'): buildreqs.append(d.DNEVR()[2:]) diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py -index c5074ab..b61df9c 100755 +index c5074ab..3a9f305 100755 --- a/yum-complete-transaction.py +++ b/yum-complete-transaction.py @@ -8,11 +8,11 @@ @@ -2706,6 +3704,16 @@ index c5074ab..b61df9c 100755 VERSION = '1.0' USAGE = """ yum-complete-transaction: completes unfinished yum transactions which occur due to error, failure +@@ -115,7 +115,8 @@ class YumCompleteTransaction(YumUtilBase): + else: + self.optparser_grp = self.optparser + self.addCmdOptions() +- self.main() ++ try: self.main() ++ finally: self.unlock() + + def clean_up_ts_files(self, timestamp, path, disable=False): + diff --git a/yum-config-manager.py b/yum-config-manager.py index 50f5123..aed64a2 100755 --- a/yum-config-manager.py diff --git a/yum-utils.spec b/yum-utils.spec index ae71f95..42d8edf 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 15%{?dist} +Release: 16%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,18 @@ fi %{pluginhome}/puppetverify.* %changelog +* Thu Jul 25 2013 Zdenek Pavlas - 1.1.31-16 +- Update to latest HEAD +- Fix pacakge => package typos +- docs: Add missing man page short descriptions +- docs: Escape dashes in command-line options +- docs: Add missing man pages for all yum-utils +- Add --show-duplicates to repoquery manpage. BZ 975565 +- yum-complete-transaction: unlock yum.pid. BZ 984119 +- sanitize repoquery --repofrompath. BZ 988140 +- yum changelog: implicit since=all. BZ 961782 +- repoquery: retry doLock() BZ 988223 + * Mon Jun 24 2013 Zdenek Pavlas - 1.1.31-15 - Update to latest HEAD - debuginfo-install: handle YumBaseError From e733b6dca0cee8f5a81f20f8e1885c3cbd0d6801 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Thu, 25 Jul 2013 11:36:29 +0200 Subject: [PATCH 13/55] docs: Package missing man pages for all yum-utils --- yum-utils.spec | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yum-utils.spec b/yum-utils.spec index 42d8edf..af8dfea 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -495,6 +495,14 @@ fi %{_mandir}/man1/yum-groups-manager.1.* %{_mandir}/man8/yumdb.8.* %{_mandir}/man1/yumdownloader.1.* +%{_mandir}/man1/find-repos-of-install.1.* +%{_mandir}/man1/needs-restarting.1.* +%{_mandir}/man1/repo-graph.1.* +%{_mandir}/man1/repoclosure.1.* +%{_mandir}/man1/repomanage.1.* +%{_mandir}/man1/repotrack.1.* +%{_mandir}/man1/verifytree.1.* +%{_mandir}/man1/yum-config-manager.1.* %files -n yum-updateonboot %defattr(-, root, root) From c10248ee6ab125d1a979b10cdedb184bc715d59c Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Wed, 7 Aug 2013 14:43:03 +0200 Subject: [PATCH 14/55] Update to latest HEAD - Use new findRepos() API for yum-config-manager. BZ 971599 - repoquery: add --installroot option. BZ 988429 - repoquery: obey conf.exit_on_lock - reposync: fix a copy-paste error. BZ 994514 --- yum-utils-HEAD.patch | 189 +++++++++++++++++++++++++++++++++---------- yum-utils.spec | 9 ++- 2 files changed, 156 insertions(+), 42 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 2015378..227e270 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -601,7 +601,7 @@ index 0000000..4d336a5 +See the Authors file included with this program. +.fi diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..81601ac 100644 +index f5a8c5d..30fda8a 100644 --- a/docs/repoquery.1 +++ b/docs/repoquery.1 @@ -1,11 +1,11 @@ @@ -636,7 +636,21 @@ index f5a8c5d..81601ac 100644 .IP "\fB\-\-plugins\fP" Enable YUM plugin support. .IP "\fB\-q, \-\-query\fP" -@@ -64,13 +64,13 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid +@@ -57,6 +57,13 @@ the releasever information from outside the installroot. + Note that with the default upstream cachedir, of /var/cache/yum, using this + option will corrupt your cache (and you can use $releasever in your cachedir + configuration to stop this). ++.IP "\fB\-\-installroot=root\fP" ++Specifies an alternative installroot, relative to which all packages will be ++installed. Think of this like doing "chroot yum" except using ++\-\-installroot allows yum to work before the chroot is created. ++Note: You may also want to use the option \-\-releasever=/ when creating the ++installroot as otherwise the $releasever value is taken from the rpmdb within ++the installroot (and thus. will be empty, before creation). + .IP "\fB\-\-setopt=option=value\fP" + Set any config option in yum config or repo files. For options in the global + config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid.option=value +@@ -64,13 +71,13 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid .PP .SH "PACKAGE QUERY OPTIONS" .IP "\fB\-i, \-\-info\fP" @@ -652,7 +666,7 @@ index f5a8c5d..81601ac 100644 .IP "\fB\-\-provides\fP" List capabilities package provides. .IP "\fB\-\-obsoletes\fP" -@@ -81,7 +81,7 @@ List capabilities conflicting with package. +@@ -81,7 +88,7 @@ List capabilities conflicting with package. List package changelog. .IP "\fB\-\-location\fP" Show a location where the package could be downloaded from. @@ -661,7 +675,7 @@ index f5a8c5d..81601ac 100644 .IP "\fB\-s, \-\-source\fP" Show package source RPM name. .IP "\fB\-\-srpm\fP" -@@ -95,16 +95,16 @@ Use name-epoch:version-release.architecture output format (default) +@@ -95,16 +102,16 @@ Use name-epoch:version-release.architecture output format (default) .IP "\fB\-\-envra\fP" Use epoch:name-version-release.architecture output format (easier to parse than nevra) @@ -681,7 +695,7 @@ index f5a8c5d..81601ac 100644 number of level to print on the tree. Default level is 'all'. .PP -@@ -112,6 +112,8 @@ number of level to print on the tree. Default level is 'all'. +@@ -112,6 +119,8 @@ number of level to print on the tree. Default level is 'all'. .IP "\fB\-a, \-\-all\fP" Query all available packages (for rpmquery compatibility / shorthand for repoquery '*') @@ -690,7 +704,7 @@ index f5a8c5d..81601ac 100644 .IP "\fB\-f, \-\-file FILE\fP" Query package owning FILE. .IP "\fB\-\-whatobsoletes CAPABILITY\fP" -@@ -123,14 +125,15 @@ Query all packages that provide CAPABILITY. +@@ -123,14 +132,15 @@ Query all packages that provide CAPABILITY. .IP "\fB\-\-whatrequires CAPABILITY\fP" Query all packages that require CAPABILITY. .IP "\fB\-\-alldeps\fP" @@ -710,7 +724,7 @@ index f5a8c5d..81601ac 100644 .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" Limit the query to packages of given architecture(s). Valid values are all architectures known to rpm/yum such as 'i386' and 'src' for -@@ -166,19 +169,19 @@ Query groups instead of packages. +@@ -166,19 +176,19 @@ Query groups instead of packages. .SH "EXAMPLES" .IP "List all packages whose name contains 'perl':" @@ -737,7 +751,7 @@ index f5a8c5d..81601ac 100644 NB: This command will only work if you have repositories enabled which include srpms. .\"TODO: Add more examples... -@@ -204,7 +207,7 @@ of the following: +@@ -204,7 +214,7 @@ of the following: .br \fBepoch:name-ver-rel.arch\fP .IP @@ -2307,9 +2321,18 @@ index 202c203..ce98583 100644 def _pkglist_to_dict(pl, priority, addArch = False): out = dict() diff --git a/plugins/tmprepo/tmprepo.py b/plugins/tmprepo/tmprepo.py -index e60dd4d..93e560a 100644 +index e60dd4d..ec51f5b 100644 --- a/plugins/tmprepo/tmprepo.py +++ b/plugins/tmprepo/tmprepo.py +@@ -91,7 +91,7 @@ def add_dir_repo(base, trepo, cleanup): + os.chmod(trepo_data, 0755) + trepo_name = os.path.basename(os.path.dirname(trepo_path)) + tmp_fname = "%s/tmp-%s.repo" % (trepo_data, trepo_name) +- repoid = "T-%4.4s-%x" % (trepo_name, int(time.time())) ++ repoid = "T-%0.4s-%x" % (trepo_name, int(time.time())) + tpc = 'true' + if not lpgpgcheck: + tpc = 'false' @@ -133,7 +133,7 @@ def add_repomd_repo(base, repomd): AutoCleanupDir(trepo_data) trepo_name = os.path.basename(os.path.dirname(os.path.dirname(repomd))) @@ -2753,7 +2776,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..1531583 100755 +index a3bb111..e85113c 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -3100,17 +3123,18 @@ index a3bb111..1531583 100755 def main(args): -@@ -1198,6 +1284,9 @@ def main(args): +@@ -1198,6 +1284,10 @@ def main(args): parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") ++ parser.add_option("--installroot", default="/", help="set install root") + parser.add_option("", "--setopt", dest="setopts", default=[], + action="append", + help="set arbitrary config and repo options") (opts, regexs) = parser.parse_args() -@@ -1261,9 +1350,10 @@ def main(args): +@@ -1261,9 +1351,10 @@ def main(args): if opts.srpm: needsource = 1 if opts.whatrequires: @@ -3122,7 +3146,7 @@ index a3bb111..1531583 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1280,7 +1370,6 @@ def main(args): +@@ -1280,7 +1371,6 @@ def main(args): needgroup = 1 if opts.installed: opts.pkgnarrow = 'installed' @@ -3130,7 +3154,7 @@ index a3bb111..1531583 100755 if opts.nevra: pkgops.append("nevra") -@@ -1303,6 +1392,13 @@ def main(args): +@@ -1303,6 +1393,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -3144,8 +3168,11 @@ index a3bb111..1531583 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1314,6 +1410,20 @@ def main(args): +@@ -1312,8 +1409,23 @@ def main(args): + repoq.preconf.fn = opts.conffile + repoq.preconf.debuglevel = initnoise repoq.preconf.init_plugins = opts.plugins ++ repoq.preconf.root = opts.installroot repoq.conf + for item in bad_setopt_tm: @@ -3165,7 +3192,7 @@ index a3bb111..1531583 100755 if opts.repofrompath: # setup the fake repos for repo in opts.repofrompath: -@@ -1327,8 +1437,13 @@ def main(args): +@@ -1327,8 +1439,13 @@ def main(args): else: baseurl = repopath @@ -3177,11 +3204,11 @@ index a3bb111..1531583 100755 + timestamp_check=False) + except yum.Errors.DuplicateRepoError, e: + repoq.logger.error(e) -+ continue ++ sys.exit(1) if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) -@@ -1359,6 +1474,13 @@ def main(args): +@@ -1359,6 +1476,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -3195,7 +3222,7 @@ index a3bb111..1531583 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1380,6 +1502,12 @@ def main(args): +@@ -1380,6 +1504,14 @@ def main(args): for repo in repoq.repos.findRepos(repo_match): repo.enable() @@ -3203,12 +3230,14 @@ index a3bb111..1531583 100755 + try: repoq.doLock(); break + except yum.Errors.LockError, e: pass + repoq.logger.error(e) ++ if repoq.conf.exit_on_lock: ++ sys.exit(50) + time.sleep(2) + try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) -@@ -1396,10 +1524,15 @@ def main(args): +@@ -1396,10 +1528,15 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -3225,7 +3254,7 @@ index a3bb111..1531583 100755 if __name__ == "__main__": misc.setup_locale() diff --git a/reposync.py b/reposync.py -index 7950854..a749973 100755 +index 7950854..b1ee285 100755 --- a/reposync.py +++ b/reposync.py @@ -11,8 +11,8 @@ @@ -3388,7 +3417,7 @@ index 7950854..a749973 100755 + exit_code = 1 + for key in probs: + for error in probs[key]: -+ self.logger.error('%s: %s', key, error) ++ my.logger.error('%s: %s', key, error) + + if opts.gpgcheck: + for pkg in download_list: @@ -3491,7 +3520,7 @@ index 737f97e..65aae11 100755 parser.add_option("-e", "--no-excludes", dest="excludes", action="store_false", default=True, diff --git a/test/yum-utils-pylintrc b/test/yum-utils-pylintrc -index 1a03789..6acaba4 100644 +index 1a03789..def5613 100644 --- a/test/yum-utils-pylintrc +++ b/test/yum-utils-pylintrc @@ -1,6 +1,6 @@ @@ -3502,7 +3531,13 @@ index 1a03789..6acaba4 100644 # generation. It is itself both a raw checker and an astng checker in order # to: # * handle message activation / deactivation at the module level -@@ -106,7 +106,7 @@ reports=yes +@@ -101,12 +101,12 @@ include-ids=yes + # written in a file name "pylint_global.[txt|html]". + files-output=no + +-# Tells wether to display a full report or only the messages ++# Tells whether to display a full report or only the messages + reports=yes # Python expression which should return a note less than 10 (10 is the highest # note).You have access to the variables errors warning, statement which @@ -3511,6 +3546,24 @@ index 1a03789..6acaba4 100644 # number of statements analyzed. This is used by the global evaluation report # (R0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) +@@ -187,7 +187,7 @@ bad-functions=input + # + [VARIABLES] + +-# Tells wether we should check for unused import in __init__ files. ++# Tells whether we should check for unused import in __init__ files. + init-import=no + + # A regular expression matching names used for dummy variables (i.e. not used). +@@ -202,7 +202,7 @@ additional-builtins= + # + [TYPECHECK] + +-# Tells wether missing members accessed in mixin class should be ignored. A ++# Tells whether missing members accessed in mixin class should be ignored. A + # mixin class is detected if its name ends with "mixin" (case insensitive). + ignore-mixin-members=yes + @@ -246,7 +246,7 @@ int-import-graph= # checks for : # * methods without self as first argument @@ -3715,7 +3768,7 @@ index c5074ab..3a9f305 100755 def clean_up_ts_files(self, timestamp, path, disable=False): diff --git a/yum-config-manager.py b/yum-config-manager.py -index 50f5123..aed64a2 100755 +index 50f5123..df90885 100755 --- a/yum-config-manager.py +++ b/yum-config-manager.py @@ -153,7 +153,7 @@ if (not args and not opts.addrepo) or 'main' in args: @@ -3727,6 +3780,16 @@ index 50f5123..aed64a2 100755 if opts.enable or opts.disable: opts.save = True +@@ -161,7 +161,8 @@ if opts.enable or opts.disable: + only = ['enabled'] + + if args: +- repos = yb.repos.findRepos(','.join(args)) ++ repos = yb.repos.findRepos(','.join(args), ++ name_match=True, ignore_case=True) + else: + repos = yb.repos.listEnabled() + diff --git a/yum-debug-dump.py b/yum-debug-dump.py index 4653f3c..67d943f 100755 --- a/yum-debug-dump.py @@ -3813,6 +3876,28 @@ index fd95741..1d827f4 100755 if __name__ == "__main__": main() +diff --git a/yum-groups-manager.py b/yum-groups-manager.py +index 2cf73c8..c536092 100755 +--- a/yum-groups-manager.py ++++ b/yum-groups-manager.py +@@ -204,7 +204,7 @@ def main(): + sys.exit(50) + + if not loaded_files and opts.remove: +- yb.logger.error("Can't remove package(s) when we havn't loaded any") ++ yb.logger.error("Can't remove package(s) when we haven't loaded any") + sys.exit(50) + + group = None +@@ -213,7 +213,7 @@ def main(): + if group is None and opts.name: + group = comps.return_group(opts.name) + if group is None and opts.remove: +- yb.logger.error("Can't remove package(s) from non-existant group") ++ yb.logger.error("Can't remove package(s) from non-existent group") + sys.exit(50) + + if group is None: diff --git a/yum-util-cli-template b/yum-util-cli-template index 8bfdbcd..250ebc9 100644 --- a/yum-util-cli-template @@ -4044,7 +4129,7 @@ index 1d37231..6578bb3 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..16b568e 100644 +index ce7fb64..e22d692 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -4059,7 +4144,17 @@ index ce7fb64..16b568e 100644 Summary: Utilities based around the yum package manager Name: yum-utils -@@ -105,18 +112,6 @@ Requires: yum >= 3.0 +@@ -10,7 +17,8 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz + URL: http://yum.baseurl.org/download/yum-utils/ + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + BuildArch: noarch +-Requires: yum >= 3.2.29 ++# For new findRepos() API. ++Requires: yum >= 3.4.3-96 + Requires: python-kitchen + BuildRequires: python-devel >= 2.4 + BuildRequires: gettext +@@ -105,18 +113,6 @@ Requires: yum >= 3.0 This plugin allows you to specify optional transaction flags on the yum command line @@ -4078,7 +4173,7 @@ index ce7fb64..16b568e 100644 %package -n yum-plugin-priorities Summary: plugin to give priorities to packages from different repos Group: System Environment/Base -@@ -130,6 +125,7 @@ This plugin allows repositories to have different priorities. +@@ -130,6 +126,7 @@ This plugin allows repositories to have different priorities. Packages in a repository with a lower priority can't be overridden by packages from a repository with a higher priority even if repo has a later version. @@ -4086,7 +4181,7 @@ index ce7fb64..16b568e 100644 %package -n yum-plugin-refresh-updatesd Summary: Tell yum-updatesd to check for updates when yum exits Group: System Environment/Base -@@ -143,6 +139,7 @@ Requires: yum-updatesd +@@ -143,6 +140,7 @@ Requires: yum-updatesd yum-refresh-updatesd tells yum-updatesd to check for updates when yum exits. This way, if you run 'yum update' and install all available updates, puplet will almost instantly update itself to reflect this. @@ -4094,7 +4189,7 @@ index ce7fb64..16b568e 100644 %package -n yum-plugin-merge-conf Summary: Yum plugin to merge configuration changes when installing packages -@@ -290,7 +287,7 @@ This plugin allows the user to run arbitrary actions immediately following a +@@ -290,7 +288,7 @@ This plugin allows the user to run arbitrary actions immediately following a transaction when specified packages are changed. %package -n yum-NetworkManager-dispatcher @@ -4103,7 +4198,7 @@ index ce7fb64..16b568e 100644 Group: System Environment/Base Requires: yum >= 3.2.17 -@@ -395,9 +392,7 @@ plugins="\ +@@ -395,9 +393,7 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -4113,7 +4208,7 @@ index ce7fb64..16b568e 100644 merge-conf \ security \ upgrade-helper \ -@@ -418,14 +413,20 @@ plugins="\ +@@ -418,14 +414,20 @@ plugins="\ puppetverify \ " @@ -4137,7 +4232,7 @@ index ce7fb64..16b568e 100644 done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ -@@ -469,8 +470,8 @@ fi +@@ -469,8 +471,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -4147,7 +4242,7 @@ index ce7fb64..16b568e 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,6 +488,7 @@ fi +@@ -487,10 +489,19 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -4155,7 +4250,19 @@ index ce7fb64..16b568e 100644 %{_mandir}/man8/yum-complete-transaction.8.* %{_mandir}/man1/yum-groups-manager.1.* %{_mandir}/man8/yumdb.8.* -@@ -502,7 +504,7 @@ fi + %{_mandir}/man1/yumdownloader.1.* ++%{_mandir}/man1/find-repos-of-install.1.* ++%{_mandir}/man1/needs-restarting.1.* ++%{_mandir}/man1/repo-graph.1.* ++%{_mandir}/man1/repoclosure.1.* ++%{_mandir}/man1/repomanage.1.* ++%{_mandir}/man1/repotrack.1.* ++%{_mandir}/man1/verifytree.1.* ++%{_mandir}/man1/yum-config-manager.1.* + + %files -n yum-updateonboot + %defattr(-, root, root) +@@ -502,7 +513,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING @@ -4164,7 +4271,7 @@ index ce7fb64..16b568e 100644 %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* -@@ -510,20 +512,20 @@ fi +@@ -510,20 +521,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf @@ -4188,7 +4295,7 @@ index ce7fb64..16b568e 100644 %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* -@@ -531,85 +533,81 @@ fi +@@ -531,85 +542,81 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf @@ -4288,7 +4395,7 @@ index ce7fb64..16b568e 100644 %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) -@@ -619,13 +617,13 @@ fi +@@ -619,13 +626,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING @@ -4304,7 +4411,7 @@ index ce7fb64..16b568e 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. -@@ -634,19 +632,19 @@ fi +@@ -634,19 +641,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING @@ -4327,7 +4434,7 @@ index ce7fb64..16b568e 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -@@ -654,13 +652,13 @@ fi +@@ -654,13 +661,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf @@ -4343,7 +4450,7 @@ index ce7fb64..16b568e 100644 %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* -@@ -668,13 +666,13 @@ fi +@@ -668,13 +675,13 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf diff --git a/yum-utils.spec b/yum-utils.spec index af8dfea..fb20029 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 16%{?dist} +Release: 17%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -685,6 +685,13 @@ fi %{pluginhome}/puppetverify.* %changelog +* Wed Aug 7 2013 Zdenek Pavlas - 1.1.31-17 +- Update to latest HEAD +- Use new findRepos() API for yum-config-manager. BZ 971599 +- repoquery: add --installroot option. BZ 988429 +- repoquery: obey conf.exit_on_lock +- reposync: fix a copy-paste error. BZ 994514 + * Thu Jul 25 2013 Zdenek Pavlas - 1.1.31-16 - Update to latest HEAD - Fix pacakge => package typos From 2a1e35494c25b0fd28321854368250cf4cd499c0 Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Fri, 27 Sep 2013 14:12:03 +0200 Subject: [PATCH 15/55] Update to latest HEAD - repoquery: handle Yum exceptions on .conf setup. BZ 996027 - repo-rss: non-ASCII fix, sorting - Add repoquery --installroot completion. - Add --nogroups and --noplugins options to verifytree. - yumdownloader: make --destdir less of a hack. BZ 1004089 - fs-snapshot: btrfsctl is obsolete, use btrfs. BZ 1010974 - yum-config-manager: fix --add-repo. BZ 984216 --- yum-utils-HEAD.patch | 270 ++++++++++++++++++++++++++++++++++--------- yum-utils.spec | 12 +- 2 files changed, 228 insertions(+), 54 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 227e270..79f2b2f 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -2093,7 +2093,7 @@ index 3a67c69..9ada717 100644 [lvm] enabled = 0 diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py -index 5094881..4f99b6a 100644 +index 5094881..786b0c1 100644 --- a/plugins/fs-snapshot/fs-snapshot.py +++ b/plugins/fs-snapshot/fs-snapshot.py @@ -21,7 +21,7 @@ This plugin creates a snapshot before any yum update or yum remove operation on @@ -2150,7 +2150,31 @@ index 5094881..4f99b6a 100644 conduit.error(1, "fs-snapshot: skipping volume: %s, " "kernel doesn't support snapshot-merge" % device) return 0 -@@ -216,6 +222,14 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): +@@ -192,9 +198,8 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): + """ + Runs the commands necessary for a snapshot. Basically its just + +- btrfsctl -c /dir/to/snapshot #this syncs the fs +- btrfsctl -s /dir/to/snapshot/${snapshot_tag} +- /dir/to/snapshot ++ btrfs filesystem sync /dir/to/snapshot #this syncs the fs ++ btrfs subvolume snapshot /dir/to/snapshot /dir/to/snapshot/${snapshot_tag} + + and then we're done. + """ +@@ -206,16 +211,24 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): + + snapname = mntpnt + snapshot_tag + conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname) +- p = Popen(["/sbin/btrfsctl", "-c", mntpnt], stdout=PIPE, stderr=PIPE) ++ p = Popen(["/sbin/btrfs", "filesystem", "sync", mntpnt], stdout=PIPE, stderr=PIPE) + err = p.wait() + if err: + return 1 +- p = Popen(["/sbin/btrfsctl", "-s", snapname, mntpnt], stdout=PIPE, stderr=PIPE) ++ p = Popen(["/sbin/btrfs", "subvolume", "snapshot", mntpnt, snapname], stdout=PIPE, stderr=PIPE) + err = p.wait() + if err: return 1 return 2 @@ -2165,7 +2189,7 @@ index 5094881..4f99b6a 100644 def _create_lvm_snapshot(conduit, snapshot_tag, volume): """ Create LVM snapshot LV and tag it with $snapshot_tag. -@@ -223,16 +237,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -223,16 +236,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): has enough free space to accommodate a snapshot LV. - Also assumes user has configured 'lvcreate_size_args'. """ @@ -2193,7 +2217,7 @@ index 5094881..4f99b6a 100644 device = volume["device"] if device.count('/') != 3: -@@ -259,7 +275,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -259,7 +274,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): (mntpnt, device, snap_lvname)) # Create snapshot LV lvcreate_cmd = ["/sbin/lvcreate", "-s", "-n", snap_lvname] @@ -2203,7 +2227,7 @@ index 5094881..4f99b6a 100644 lvcreate_cmd.append(device) p = Popen(lvcreate_cmd, stdout=PIPE, stderr=PIPE) err = p.wait() -@@ -270,16 +287,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -270,16 +286,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): # Add tag ($snapshot_tag) to snapshot LV # - should help facilitate merge of all snapshot LVs created # by a yum transaction, e.g.: lvconvert --merge @snapshot_tag @@ -2229,7 +2253,7 @@ index 5094881..4f99b6a 100644 """ This runs before the transaction starts. Try to snapshot anything and everything that is snapshottable, since we do not know what an RPM will -@@ -287,6 +306,10 @@ def pretrans_hook(conduit): +@@ -287,6 +305,10 @@ def pretrans_hook(conduit): """ # common snapshot tag format: yum_${year}${month}${day}${hour}${minute}${sec} snapshot_tag = "yum_" + time.strftime("%Y%m%d%H%M%S") @@ -2240,7 +2264,7 @@ index 5094881..4f99b6a 100644 volumes = get_volumes(conduit) for volume in volumes: -@@ -296,3 +319,13 @@ def pretrans_hook(conduit): +@@ -296,3 +318,13 @@ def pretrans_hook(conduit): elif rc == 2 and hasattr(conduit, 'registerPackageName'): # A snapshot was successfully created conduit.registerPackageName("yum-plugin-fs-snapshot") @@ -2465,7 +2489,7 @@ index bb901a8..bca41d0 100755 # generates graphviz .dot's from repomd data diff --git a/repo-rss.py b/repo-rss.py -index 4a2917c..f14ff2a 100755 +index 4a2917c..871e338 100755 --- a/repo-rss.py +++ b/repo-rss.py @@ -8,11 +8,11 @@ @@ -2483,6 +2507,24 @@ index 4a2917c..f14ff2a 100755 # seth vidal 2005 (c) etc etc import yum +@@ -144,7 +144,7 @@ class RepoRSS: + changelog += '%s - %s\n%s\n\n' % (date, author, desc) + description = '

%s - %s

\n\n' % (escape(pkg.name), + escape(pkg.returnSimple('summary'))) +- description += '

%s

\n\n

Change Log:

\n\n' % escape(pkg.returnSimple('description').encode('utf-8').replace("\n", "
\n")) ++ description += '

%s

\n\n

Change Log:

\n\n' % escape(to_unicode(pkg.returnSimple('description')).encode('utf-8').replace("\n", "
\n")) + description += escape('
%s
' % escape(to_unicode(changelog).encode('utf-8'))) + item.newChild(None, 'description', description) + +@@ -222,6 +222,8 @@ def main(options, args): + sys.exit(1) + + recent = my.getRecent(days=days) ++ recent.sort(key=lambda pkg: pkg.returnSimple('filetime')) ++ recent.reverse() + if options.groups: + comps = Comps() + for repo in my.repos.listEnabled(): diff --git a/repoclosure.py b/repoclosure.py index e710d8c..f895f84 100755 --- a/repoclosure.py @@ -2776,7 +2818,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..e85113c 100755 +index a3bb111..64976ec 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -3168,13 +3210,18 @@ index a3bb111..e85113c 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1312,8 +1409,23 @@ def main(args): +@@ -1312,7 +1409,26 @@ def main(args): repoq.preconf.fn = opts.conffile repoq.preconf.debuglevel = initnoise repoq.preconf.init_plugins = opts.plugins +- repoq.conf + repoq.preconf.root = opts.installroot - repoq.conf - ++ try: ++ repoq.conf ++ except YumBaseError, e: ++ repoq.logger.error(e) ++ sys.exit(1) ++ + for item in bad_setopt_tm: + msg = "Setopt argument has multiple values: %s" + repoq.logger.warning(msg % item) @@ -3188,11 +3235,10 @@ index a3bb111..e85113c 100755 + msg ="Main config did not have a %s attr. before setopt" + repoq.logger.warning(msg % opt) + setattr(repoq.conf, opt, getattr(repoq.main_setopts, opt)) -+ + if opts.repofrompath: # setup the fake repos - for repo in opts.repofrompath: -@@ -1327,8 +1439,13 @@ def main(args): +@@ -1327,8 +1443,13 @@ def main(args): else: baseurl = repopath @@ -3208,7 +3254,7 @@ index a3bb111..e85113c 100755 if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) -@@ -1359,6 +1476,13 @@ def main(args): +@@ -1359,6 +1480,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -3222,7 +3268,7 @@ index a3bb111..e85113c 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1380,6 +1504,14 @@ def main(args): +@@ -1380,6 +1508,14 @@ def main(args): for repo in repoq.repos.findRepos(repo_match): repo.enable() @@ -3237,7 +3283,7 @@ index a3bb111..e85113c 100755 try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) -@@ -1396,10 +1528,15 @@ def main(args): +@@ -1396,10 +1532,15 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -3574,7 +3620,7 @@ index 1a03789..def5613 100644 # * supported interfaces implementation # * unreachable code diff --git a/verifytree.py b/verifytree.py -index d1fe5e2..cb89285 100755 +index d1fe5e2..78e8264 100755 --- a/verifytree.py +++ b/verifytree.py @@ -7,11 +7,11 @@ @@ -3592,6 +3638,81 @@ index d1fe5e2..cb89285 100755 # copyright (c) 2008 Red Hat, Inc - written by Seth Vidal and Will Woods import yum +@@ -130,6 +130,11 @@ def main(): + + parser.add_option("-a","--checkall",action="store_true",default=False, + help="Check all packages in the repo") ++ parser.add_option("--nocomps", "--nogroups",action="store_true", ++ default=False, ++ help="Do not read and check comps") ++ parser.add_option("--noplugins",action="store_true",default=False, ++ help="Do not load any plugins") + parser.add_option("-t","--testopia",action="store",type="int", + help="Report results to the given testopia run number") + parser.add_option("-r","--treeinfo", action="store_true", default=False, +@@ -159,6 +164,8 @@ def main(): + basedir = url.replace('file://', '') # for a normal path thing + + my = yum.YumBase() ++ if opts.noplugins: ++ my.preconf.init_plugins = False + my.conf.cachedir = getCacheDir() + my.repos.disableRepo('*') + newrepo = yum.yumRepo.YumRepository(repoid) +@@ -211,25 +218,26 @@ def main(): + else: + report('REPODATA','PASSED') + +- print "Checking groups (comps.xml):" +- try: +- print " verifying comps.xml with yum" +- b = my.comps.compscount +- except Errors.GroupsError, e: +- print ' comps file missing or unparseable' +- report('COMPS','FAILED') +- retval = retval | BAD_COMPS +- +- if not (retval & BAD_COMPS): +- print " verifying comps.xml grammar with xmllint" +- comps = newrepo.getGroups() +- r = os.system("xmllint --noout --nowarning --relaxng %s %s" % +- (SCHEMA,comps)) +- if r != 0: +- retval = retval | BAD_COMPS ++ if not opts.nocomps: ++ print "Checking groups (comps.xml):" ++ try: ++ print " verifying comps.xml with yum" ++ b = my.comps.compscount ++ except Errors.GroupsError, e: ++ print ' comps file missing or unparseable' + report('COMPS','FAILED') +- else: +- report('COMPS','PASSED') ++ retval = retval | BAD_COMPS ++ ++ if not (retval & BAD_COMPS): ++ print " verifying comps.xml grammar with xmllint" ++ comps = newrepo.getGroups() ++ r = os.system("xmllint --noout --nowarning --relaxng %s %s" % ++ (SCHEMA,comps)) ++ if r != 0: ++ retval = retval | BAD_COMPS ++ report('COMPS','FAILED') ++ else: ++ report('COMPS','PASSED') + + # if we've got a .treeinfo file and we are told to check it, then do so + tr_path = basedir + '/.treeinfo' +@@ -243,7 +251,7 @@ def main(): + if opts.checkall: + print "Checking all packages" + sack = my.pkgSack +- elif not (retval & BAD_COMPS): ++ elif not (retval & BAD_COMPS or opts.nocomps): + print "Checking mandatory @core packages" + group = my.comps.return_group('core') + for pname in group.mandatory_packages: diff --git a/yum-builddep.py b/yum-builddep.py index d7a37c3..b9e682a 100755 --- a/yum-builddep.py @@ -3768,10 +3889,19 @@ index c5074ab..3a9f305 100755 def clean_up_ts_files(self, timestamp, path, disable=False): diff --git a/yum-config-manager.py b/yum-config-manager.py -index 50f5123..df90885 100755 +index 50f5123..08c17db 100755 --- a/yum-config-manager.py +++ b/yum-config-manager.py -@@ -153,7 +153,7 @@ if (not args and not opts.addrepo) or 'main' in args: +@@ -9,6 +9,8 @@ from utils import YumUtilBase + import logging + + from iniparse import INIConfig ++import yum.config ++import yum.yumRepo + + from yum.parser import varReplace + +@@ -153,7 +155,7 @@ if (not args and not opts.addrepo) or 'main' in args: ybc = yb.conf writeRawConfigFile(fn, 'main', ybc.yumvar, ybc.cfg.options, ybc.iteritems, ybc.optionobj, @@ -3780,7 +3910,7 @@ index 50f5123..df90885 100755 if opts.enable or opts.disable: opts.save = True -@@ -161,7 +161,8 @@ if opts.enable or opts.disable: +@@ -161,7 +163,8 @@ if opts.enable or opts.disable: only = ['enabled'] if args: @@ -3790,6 +3920,28 @@ index 50f5123..df90885 100755 else: repos = yb.repos.listEnabled() +@@ -196,13 +199,16 @@ if opts.addrepo: + if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it + destname = os.path.basename(url) + destname = myrepodir + '/' + destname +- # this sucks - but take the first repo we come to that's enabled +- # and steal it's grabber object - it could be proxy-laden but that's the risk we take +- # grumbledy grumble +- grabber = yb.repos.listEnabled()[0].grabfunc ++ ++ # dummy grabfunc, using [main] options ++ repo = yum.yumRepo.YumRepository('dummy') ++ repo.baseurl = ['http://dummy'] ++ repo.populate(yum.config.ConfigParser(), None, yb.conf) ++ grabber = repo.grabfunc; del repo ++ + print 'grabbing file %s to %s' % (url, destname) + try: +- result = grabber.urlgrab(url, filename=destname, copy_local=True) ++ result = grabber.urlgrab(url, filename=destname, copy_local=True, reget=None) + except (IOError, OSError, yum.Errors.YumBaseError), e: + logger.error('Could not fetch/save url %s to file %s: %s' % (url, destname, e)) + continue diff --git a/yum-debug-dump.py b/yum-debug-dump.py index 4653f3c..67d943f 100755 --- a/yum-debug-dump.py @@ -3912,7 +4064,7 @@ index 8bfdbcd..250ebc9 100644 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software diff --git a/yum-utils.bash b/yum-utils.bash -index 1d37231..6578bb3 100644 +index 1d37231..65bff76 100644 --- a/yum-utils.bash +++ b/yum-utils.bash @@ -1,3 +1,6 @@ @@ -3992,7 +4144,7 @@ index 1d37231..6578bb3 100644 --grouppkgs) COMPREPLY=( $( compgen -W 'all default optional mandatory' \ -- "$cur" ) ) -@@ -219,38 +219,52 @@ _yu_repoquery() +@@ -219,38 +219,56 @@ _yu_repoquery() return 0 ;; --repoid) @@ -4025,6 +4177,10 @@ index 1d37231..6578bb3 100644 + --search-fields) + COMPREPLY=( $( compgen -W 'name summary description' -- "$cur" ) ) + return 0 ++ ;; ++ --installroot) ++ COMPREPLY=( $( compgen -d -- "$cur" ) ) ++ return 0 + ;; esac @@ -4048,7 +4204,7 @@ index 1d37231..6578bb3 100644 + --archlist --pkgnarrow --installed --show-duplicates --repoid + --enablerepo --disablerepo --repofrompath --plugins --quiet + --verbose --cache --tempcache --querytags --config --level --output -+ --search --search-fields --setopt' -- "$cur" ) ) ++ --search --search-fields --setopt --installroot' -- "$cur" ) ) + return 0 + fi + @@ -4057,7 +4213,7 @@ index 1d37231..6578bb3 100644 } && complete -F _yu_repoquery -o filenames repoquery repoquery.py -@@ -278,8 +292,8 @@ _yu_yumdb() +@@ -278,8 +296,8 @@ _yu_yumdb() if [ $COMP_CWORD -le 1 ] ; then COMPREPLY=( $( compgen -W 'get set del rename rename-force copy search @@ -4068,7 +4224,7 @@ index 1d37231..6578bb3 100644 fi } && complete -F _yu_yumdb -o filenames yumdb yumdb.py -@@ -299,7 +313,7 @@ _yu_repodiff() +@@ -299,7 +317,7 @@ _yu_repodiff() $split && return 0 COMPREPLY=( $( compgen -W '--version --help --new --old --quiet --archlist @@ -4077,7 +4233,7 @@ index 1d37231..6578bb3 100644 } && complete -F _yu_repodiff repodiff repodiff.py -@@ -311,6 +325,13 @@ _yu_builddep() +@@ -311,6 +329,13 @@ _yu_builddep() _yum_complete_baseopts "$cur" "$prev" && return 0 @@ -4091,7 +4247,7 @@ index 1d37231..6578bb3 100644 $split && return 0 if [[ $cur == -* ]] ; then -@@ -363,6 +384,36 @@ _yu_debug_dump() +@@ -363,6 +388,36 @@ _yu_debug_dump() } && complete -F _yu_debug_dump -o filenames yum-debug-dump yum-debug-dump.py @@ -4129,7 +4285,7 @@ index 1d37231..6578bb3 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..e22d692 100644 +index ce7fb64..6d6d699 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -4198,7 +4354,15 @@ index ce7fb64..e22d692 100644 Group: System Environment/Base Requires: yum >= 3.2.17 -@@ -395,9 +393,7 @@ plugins="\ +@@ -352,6 +350,7 @@ repo. removes it (and can thus. be reinstalled/downgraded/etc.). + Summary: Yum plugin to automatically snapshot your filesystems during updates + Group: System Environment/Base + Requires: yum >= 3.2.22 ++Requires: btrfs-progs + + %description -n yum-plugin-fs-snapshot + When this plugin is installed it will automatically snapshot any +@@ -395,9 +394,7 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -4208,7 +4372,7 @@ index ce7fb64..e22d692 100644 merge-conf \ security \ upgrade-helper \ -@@ -418,14 +414,20 @@ plugins="\ +@@ -418,14 +415,20 @@ plugins="\ puppetverify \ " @@ -4232,7 +4396,7 @@ index ce7fb64..e22d692 100644 done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ -@@ -469,8 +471,8 @@ fi +@@ -469,8 +472,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -4242,7 +4406,7 @@ index ce7fb64..e22d692 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,10 +489,19 @@ fi +@@ -487,10 +490,19 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -4262,7 +4426,7 @@ index ce7fb64..e22d692 100644 %files -n yum-updateonboot %defattr(-, root, root) -@@ -502,7 +513,7 @@ fi +@@ -502,7 +514,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING @@ -4271,7 +4435,7 @@ index ce7fb64..e22d692 100644 %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* -@@ -510,20 +521,20 @@ fi +@@ -510,20 +522,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf @@ -4295,7 +4459,7 @@ index ce7fb64..e22d692 100644 %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* -@@ -531,85 +542,81 @@ fi +@@ -531,85 +543,81 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf @@ -4395,7 +4559,7 @@ index ce7fb64..e22d692 100644 %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) -@@ -619,13 +626,13 @@ fi +@@ -619,13 +627,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING @@ -4411,7 +4575,7 @@ index ce7fb64..e22d692 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. -@@ -634,19 +641,19 @@ fi +@@ -634,19 +642,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING @@ -4434,7 +4598,7 @@ index ce7fb64..e22d692 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -@@ -654,13 +661,13 @@ fi +@@ -654,13 +662,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf @@ -4450,7 +4614,7 @@ index ce7fb64..e22d692 100644 %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* -@@ -668,13 +675,13 @@ fi +@@ -668,13 +676,13 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf @@ -4544,7 +4708,7 @@ index 8a4888e..c50159e 100755 args.pop(0) if args: diff --git a/yumdownloader.py b/yumdownloader.py -index e6107d4..4c5eefb 100755 +index e6107d4..b491c7f 100755 --- a/yumdownloader.py +++ b/yumdownloader.py @@ -7,11 +7,11 @@ @@ -4601,7 +4765,13 @@ index e6107d4..4c5eefb 100755 sys.exit(50) # Check if there is anything to do. -@@ -92,53 +99,27 @@ class YumDownloader(YumUtilBase): +@@ -89,56 +96,33 @@ class YumDownloader(YumUtilBase): + if not self.setCacheDir(): + self.logger.error("Error: Could not make cachedir, exiting") + sys.exit(50) ++ ++ # override all pkgdirs ++ self.conf.downloaddir = opts.destdir # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup(opts) @@ -4666,7 +4836,7 @@ index e6107d4..4c5eefb 100755 def downloadPackages(self,opts): -@@ -177,7 +158,7 @@ class YumDownloader(YumUtilBase): +@@ -177,7 +161,7 @@ class YumDownloader(YumUtilBase): installable = self.returnPackagesByDep(pkg) installable = yum.misc.unique(installable) except yum.Errors.YumBaseError, msg: @@ -4675,7 +4845,7 @@ index e6107d4..4c5eefb 100755 continue if not installable: # doing one at a time, apart from groups -@@ -211,57 +192,35 @@ class YumDownloader(YumUtilBase): +@@ -211,57 +195,29 @@ class YumDownloader(YumUtilBase): self.resolveDeps() # Add newly added packages to the toDownload list for pkg in self.tsInfo.getMembers(): @@ -4692,10 +4862,6 @@ index e6107d4..4c5eefb 100755 + return 0 - exit_code = 0 -+ # create dest dir -+ if not os.path.exists(opts.destdir): -+ os.makedirs(opts.destdir) -+ + # set localpaths for pkg in toDownload: - n,a,e,v,r = pkg.pkgtup @@ -4741,8 +4907,6 @@ index e6107d4..4c5eefb 100755 - size=os.stat(path).st_size) - shutil.copy2(path, local) - progress.end(progress.size) -+ rpmfn = os.path.basename(pkg.remote_path) -+ pkg.localpath = os.path.join(opts.destdir, rpmfn) + pkg.repo.copy_local = True + pkg.repo.cache = 0 + @@ -4757,7 +4921,7 @@ index e6107d4..4c5eefb 100755 return exit_code def _groupPackages(self,pkglist): -@@ -279,6 +238,9 @@ class YumDownloader(YumUtilBase): +@@ -279,6 +235,9 @@ class YumDownloader(YumUtilBase): """do a default setup for all the normal/necessary yum components, really just a shorthand for testing""" try: @@ -4767,7 +4931,7 @@ index e6107d4..4c5eefb 100755 self._getRepos(doSetup = True) # if '--source' is used the add src to the archlist if opts.source: -@@ -291,18 +253,11 @@ class YumDownloader(YumUtilBase): +@@ -291,18 +250,11 @@ class YumDownloader(YumUtilBase): archlist = rpmUtils.arch.getArchList() self._getSacks(archlist=archlist) except yum.Errors.YumBaseError, msg: diff --git a/yum-utils.spec b/yum-utils.spec index fb20029..ffa44e6 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 17%{?dist} +Release: 18%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -685,6 +685,16 @@ fi %{pluginhome}/puppetverify.* %changelog +* Fri Sep 27 2013 Zdenek Pavlas - 1.1.31-18 +- Update to latest HEAD +- repoquery: handle Yum exceptions on .conf setup. BZ 996027 +- repo-rss: non-ASCII fix, sorting +- Add repoquery --installroot completion. +- Add --nogroups and --noplugins options to verifytree. +- yumdownloader: make --destdir less of a hack. BZ 1004089 +- fs-snapshot: btrfsctl is obsolete, use btrfs. BZ 1010974 +- yum-config-manager: fix --add-repo. BZ 984216 + * Wed Aug 7 2013 Zdenek Pavlas - 1.1.31-17 - Update to latest HEAD - Use new findRepos() API for yum-config-manager. BZ 971599 From d1b6ea59a7ccb1c8673c286dbc800c2b87315a7f Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Fri, 13 Dec 2013 12:06:13 +0100 Subject: [PATCH 16/55] Update to latest HEAD - Don't remove pkgs which are already removals (Eg. via. updates). BZ 1013475. - remove yum-plugin-security. BZ 1002491 - repoquery: handle MiscError. BZ 808500 - repoquery: handle Yum exceptions on .conf setup. BZ 996027, 982043 - needs-restarting: don't trigger abrt on repo errors. BZ 1017600 - repoquery --whatrequires/--whatprovides: handle MiscError. BZ 1024783 - fastestmirror: Less verbose mirror filtering. BZ 1036121 - Remove -v from repoquery man page. - repoquery -i: Add License. BZ 1040478 --- yum-utils-HEAD.patch | 1437 +++++++++++++++++++++++++++++++++++++----- yum-utils.spec | 36 +- 2 files changed, 1275 insertions(+), 198 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 79f2b2f..879f5a4 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -194,10 +194,10 @@ index 177c6c3..0f026f1 100755 # but I'm not sure of a better way of doing it if not self.no_debuginfo_plugin and self.tsInfo: diff --git a/docs/Makefile b/docs/Makefile -index d01c1e4..acb8559 100644 +index d01c1e4..481f0f3 100644 --- a/docs/Makefile +++ b/docs/Makefile -@@ -1,7 +1,9 @@ +@@ -1,9 +1,11 @@ DOCS = repoquery package-cleanup repo-rss yumdownloader yum-builddep yum-changelog reposync \ yum-list-data yum-filter-data yum-verify yum-utils yum-aliases yum-debug-dump yum-versionlock \ yum-groups-manager debuginfo-install repodiff yum-fs-snapshot \ @@ -206,8 +206,11 @@ index d01c1e4..acb8559 100644 + find-repos-of-install needs-restarting repo-graph repoclosure \ + repomanage repotrack verifytree yum-config-manager DOCS5 = yum-changelog.conf yum-versionlock.conf yum-fs-snapshot.conf - DOCS8 = yum-security yum-complete-transaction yumdb +-DOCS8 = yum-security yum-complete-transaction yumdb ++DOCS8 = yum-complete-transaction yumdb + all: + echo "Nothing to do" diff --git a/docs/debuginfo-install.1 b/docs/debuginfo-install.1 index a47e28a..a829869 100644 --- a/docs/debuginfo-install.1 @@ -601,7 +604,7 @@ index 0000000..4d336a5 +See the Authors file included with this program. +.fi diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..30fda8a 100644 +index f5a8c5d..85b0047 100644 --- a/docs/repoquery.1 +++ b/docs/repoquery.1 @@ -1,11 +1,11 @@ @@ -618,7 +621,12 @@ index f5a8c5d..30fda8a 100644 .SH "DESCRIPTION" .PP \fBrepoquery\fP is a program for querying information from YUM repositories -@@ -18,7 +18,7 @@ List valid queryformat tags and exit.. +@@ -14,11 +14,11 @@ similarly to rpm queries. + .SH "GENERAL OPTIONS" + .IP "\fB\-\-querytags\fP" + List valid queryformat tags and exit.. +-.IP "\fB\-v, \-\-version\fP" ++.IP "\fB\-\-version\fP" Report program version and exit. .IP "\fB\-\-repoid=\fP" Specify which repository to query. Using this option disables all repositories @@ -1457,118 +1465,201 @@ index d855104..a5477d6 100644 To list ranges of the sizes of packages installed or available, use: .IP diff --git a/docs/yum-security.8 b/docs/yum-security.8 -index 7e260b0..c7d9c8b 100644 +deleted file mode 100644 +index 7e260b0..0000000 --- a/docs/yum-security.8 -+++ b/docs/yum-security.8 -@@ -6,13 +6,13 @@ yum security plugin - \fByum\fP [options] [command] [package ...] - .SH "DESCRIPTION" - .PP ++++ /dev/null +@@ -1,190 +0,0 @@ +-.\" yum security plugin +-.TH "yum-security" "8" "12 April 2007" "James Antill" "" +-.SH "NAME" +-yum security plugin +-.SH "SYNOPSIS" +-\fByum\fP [options] [command] [package ...] +-.SH "DESCRIPTION" +-.PP -This plugin extends \fByum\fP to allow lists and updates to be limited using security relevant criteria -+This plugin extends \fByum\fP to allow lists and updates to be limited using security relevant criteria. - .PP +-.PP -added yum \fIcommand\fPs are: -+Added yum \fIcommand\fPs are: - .br - .I \fR yum update-minimal - .PP +-.br +-.I \fR yum update-minimal +-.PP -This works like the update command, but if you have the the package foo-1 -+This works like the update command, but if you have the package foo-1 - installed and have foo-2 and foo-3 available with updateinfo.xml then - update-minimal will update you to foo-3. - .br -@@ -22,7 +22,7 @@ update-minimal will update you to foo-3. - .br - .I \fR yum updateinfo summary - .PP +-installed and have foo-2 and foo-3 available with updateinfo.xml then +-update-minimal will update you to foo-3. +-.br +-.I \fR yum updateinfo info +-.br +-.I \fR yum updateinfo list +-.br +-.I \fR yum updateinfo summary +-.PP -all of the last three take these \fIsub-command\fPs: -+All of the last three take these \fIsub-command\fPs: - .br - .I \fR yum updateinfo * all - .br -@@ -108,40 +108,40 @@ distribution. - .SH "GENERAL OPTIONS" - There are four options added to yum that are available in the "list updates", "info updates", "check-update" and "update" commands. They are: - .PP +-.br +-.I \fR yum updateinfo * all +-.br +-.I \fR yum updateinfo * available +-.br +-.I \fR yum updateinfo * installed +-.br +-.I \fR yum updateinfo * updates +-.PP +-and then: +-.br +-.I \fR * [advisory...] +-.br +-.I \fR * +-.br +-.I \fR * bugzillas +-.br +-.I \fR * cves +-.br +-.I \fR * enhancement +-.br +-.I \fR * security +-.br +-.I \fR * new-packages +-.br +-.br +-.PP +-.IP "\fBall\fP" +-Is used to display information about both install and available advisories. +-.PP +-.IP "\fBavailable\fP" +-Is used to display information about just available advisories. This is the +-default. +-.PP +-.IP "\fBinstalled\fP" +-Is used to display information about just install advisories. +-.PP +-.IP "\fBupdates\fP" +-This is mostly the same as "available" but it only shows advisory information +-for packages that can be updated to. +-.PP +-.IP "\fB [advisory...]\fP" +-Is used to display information about one or more advisories. +-.PP +-.IP "\fB [package...]\fP" +-Is used to display information about one or more packages. +-.PP +-.IP "\fBlist\fP" +-Is used to list all of the relevant errata notice information, from the +-updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and +-new. +-.PP +-.IP "\fBinfo\fP" +-Is used to show all the errata notice information, from the +-updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and +-new. +-.PP +-.IP "\fBlist\fP" +-Is used to list all of the relevant errata notice information, from the +-updateinfo.xml data in yum. This includes bugzillas, CVEs, security updates and +-new. +-.IP +-.IP "\fBbugzillas / bzs\fP" +-Is the subset of the updateinfo information, pertaining to the bugzillas. +-.IP +-.IP "\fBcves\fP" +-Is the subset of the updateinfo information, pertaining to the CVEs. +-.IP +-.IP "\fBsecurity / sec\fP" +-Is the subset of the updateinfo information, pertaining to security. +-.IP "\fBbugfix\fP" +-Is the subset of the updateinfo information, pertaining to bugfixes. +-.IP "\fBenhancement\fP" +-Is the subset of the updateinfo information, pertaining to enhancements. +-.IP "\fBrecommended\fP" +-Is the subset of the updateinfo information, pertaining to recommended updates. +-.IP "\fBnew-packages\fP" +-Is the subset of the updateinfo information, pertaining to new packages. These +-are packages which weren't available at the initial release of your +-distribution. +-.IP +-.PP +-.SH "GENERAL OPTIONS" +-There are four options added to yum that are available in the "list updates", "info updates", "check-update" and "update" commands. They are: +-.PP -.IP "\fB\--advisory\fP" -This option includes packages coresponding to the advisory ID, Eg. FEDORA-2201-123. -.IP "\fB\--bz\fP" -+.IP "\fB\-\-advisory\fP" -+This option includes packages corresponding to the advisory ID, Eg. FEDORA-2201-123. -+.IP "\fB\-\-bz\fP" - This option includes packages that say they fix a Bugzilla ID, Eg. 123. +-This option includes packages that say they fix a Bugzilla ID, Eg. 123. -.IP "\fB\--cve\fP" -+.IP "\fB\-\-cve\fP" - This option includes packages that say they fix a CVE - Common Vulnerabilities and Exposures ID (http://cve.mitre.org/about/), Eg. CVE-2201-0123. +-This option includes packages that say they fix a CVE - Common Vulnerabilities and Exposures ID (http://cve.mitre.org/about/), Eg. CVE-2201-0123. -.IP "\fB\--bugfixes\fP" -+.IP "\fB\-\-bugfixes\fP" - This option includes packages that say they fix a bugfix issue. +-This option includes packages that say they fix a bugfix issue. -.IP "\fB\--security\fP" -+.IP "\fB\-\-security\fP" - This option includes packages that say they fix a security issue. - .PP - .PP - - .SH "EXAMPLES" - .PP +-This option includes packages that say they fix a security issue. +-.PP +-.PP +- +-.SH "EXAMPLES" +-.PP -To list all updates that are security relevant, and get a reutrn code on whether there are security updates use: -+To list all updates that are security relevant, and get a return code on whether there are security updates use: - .IP +-.IP -yum --security check-update -+yum \-\-security check-update - .PP - To upgrade packages that have security errata (upgrades to the latest - available package) use: - .IP +-.PP +-To upgrade packages that have security errata (upgrades to the latest +-available package) use: +-.IP -yum --security update -+yum \-\-security update - .PP - To upgrade packages that have security errata (upgrades to the last - security errata package) use: - .IP +-.PP +-To upgrade packages that have security errata (upgrades to the last +-security errata package) use: +-.IP -yum --security update-minimal -+yum \-\-security update-minimal - .PP - To get a list of all BZs that are fixed for packages you have installed use: - .IP - yum updateinfo list bugzillas - .PP +-.PP +-To get a list of all BZs that are fixed for packages you have installed use: +-.IP +-yum updateinfo list bugzillas +-.PP -To get a list of all security advisoryies, including the ones you have already -+To get a list of all security advisories, including the ones you have already - installed use: - .IP - yum updateinfo list all security -@@ -152,15 +152,15 @@ yum updateinfo info FEDORA-2707-4567 - .PP - To update packages to the latest version which contain fixes for Bugzillas 123, 456 and 789; and all security updates use: - .IP +-installed use: +-.IP +-yum updateinfo list all security +-.PP +-To get the information on advisory FEDORA-2707-4567 use: +-.IP +-yum updateinfo info FEDORA-2707-4567 +-.PP +-To update packages to the latest version which contain fixes for Bugzillas 123, 456 and 789; and all security updates use: +-.IP -yum --bz 123 --bz 456 --bz 789 --security update -+yum \-\-bz 123 \-\-bz 456 \-\-bz 789 \-\-security update - .PP - To update to the packages which just update Bugzillas 123, 456 and 789; and all security updates use: - .IP +-.PP +-To update to the packages which just update Bugzillas 123, 456 and 789; and all security updates use: +-.IP -yum --bz 123 --bz 456 --bz 789 --security update-minimal -+yum \-\-bz 123 \-\-bz 456 \-\-bz 789 \-\-security update-minimal - .PP - To get an info list of the latest packages which contain fixes for Bugzilla 123; CVEs CVE-2207-0123 and CVE-2207-3210; and Fedora advisories FEDORA-2707-4567 and FEDORA-2707-7654 use: - .IP +-.PP +-To get an info list of the latest packages which contain fixes for Bugzilla 123; CVEs CVE-2207-0123 and CVE-2207-3210; and Fedora advisories FEDORA-2707-4567 and FEDORA-2707-7654 use: +-.IP -yum --bz 123 --cve CVE-2207-0123 --cve CVE-2207-3210 --advisory FEDORA-2707-4567 --advisory FEDORA-2707-7654 info updates -+yum \-\-bz 123 \-\-cve CVE-2207-0123 \-\-cve CVE-2207-3210 \-\-advisory FEDORA-2707-4567 \-\-advisory FEDORA-2707-7654 info updates - .PP - To get a list of packages which are "new". - .IP -@@ -183,8 +183,8 @@ James Antill . - .fi - - .SH "BUGS" +-.PP +-To get a list of packages which are "new". +-.IP +-yum updateinfo list new +-.PP +-To get a summary of advisories you haven't installed yet use: +-.IP +-yum updateinfo summary +- +- +-.SH "SEE ALSO" +-.nf +-.I yum (8) +-.I yum.conf (5) +-.fi +- +-.SH "AUTHORS" +-.nf +-James Antill . +-.fi +- +-.SH "BUGS" -The update-minimal command ignores the --obsoletes flag. -+The update-minimal command ignores the \-\-obsoletes flag. - +- -The update-minimal command can only directly affect things atm., so if you update pkgA minimally but that requires an update to pkgB then pkgB will be updated to the newest version by the depsolver. Also the above will happen even if you've also minimally updated pkgB, if either the direct (minimal) update for pkgB happens after or if the minimal update for pkgB doesn't satisy the requirements of pkgA. -+The update-minimal command can only directly affect things atm., so if you update pkgA minimally but that requires an update to pkgB then pkgB will be updated to the newest version by the depsolver. Also the above will happen even if you've also minimally updated pkgB, if either the direct (minimal) update for pkgB happens after or if the minimal update for pkgB doesn't satisfy the requirements of pkgA. - +- -The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "--bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. -+The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "\-\-bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. diff --git a/docs/yum-utils.1 b/docs/yum-utils.1 index fa830b6..3f858a8 100644 --- a/docs/yum-utils.1 @@ -1745,7 +1836,7 @@ index 0578295..aac29ea 100644 import sys diff --git a/needs-restarting.py b/needs-restarting.py -index 6bc883f..a6946b0 100755 +index 6bc883f..d92cd46 100755 --- a/needs-restarting.py +++ b/needs-restarting.py @@ -8,11 +8,11 @@ @@ -1763,7 +1854,7 @@ index 6bc883f..a6946b0 100755 # Copyright 2009 Red Hat Inc # written by Seth Vidal -@@ -40,6 +40,7 @@ +@@ -40,9 +40,11 @@ import sys import os import yum @@ -1771,14 +1862,19 @@ index 6bc883f..a6946b0 100755 import glob import stat from optparse import OptionParser -@@ -76,18 +77,18 @@ def get_open_files(pid): ++from yum.Errors import RepoError + + def parseargs(args): + usage = """ +@@ -76,18 +78,18 @@ def get_open_files(pid): files = [] smaps = '/proc/%s/smaps' % pid try: - maps = open(smaps, 'r') + maps = open(smaps, 'r').readlines() except (IOError, OSError), e: - print "Could not open %s" % smaps +- print "Could not open %s" % smaps ++ print >>sys.stderr, "Could not open %s" % smaps return files - for line in maps.readlines(): @@ -1795,7 +1891,7 @@ index 6bc883f..a6946b0 100755 filename = filename.strip() if filename not in files: files.append(filename) -@@ -106,7 +107,7 @@ def main(args): +@@ -106,7 +108,7 @@ def main(args): if opts.useronly: myuid = os.getuid() @@ -1804,7 +1900,7 @@ index 6bc883f..a6946b0 100755 for pid in return_running_pids(uid=myuid): try: -@@ -117,12 +118,43 @@ def main(args): +@@ -117,17 +119,48 @@ def main(args): for fn in get_open_files(pid): if found_match: break @@ -1851,6 +1947,22 @@ index 6bc883f..a6946b0 100755 for pid in needing_restart: try: cmdline = open('/proc/' +pid+ '/cmdline', 'r').read() + except OSError, e: +- print "Couldn't access process information for %s: %s" % (pid, str(e)) ++ print >>sys.stderr, "Couldn't access process information for %s: %s" % (pid, str(e)) + continue + # proc cmdline is null-delimited so clean that up + cmdline = cmdline.replace('\000', ' ') +@@ -136,4 +169,8 @@ def main(args): + return 0 + + if __name__ == "__main__": +- sys.exit(main(sys.argv)) ++ try: ++ sys.exit(main(sys.argv)) ++ except RepoError, e: ++ print >>sys.stderr, e ++ sys.exit(1) diff --git a/package-cleanup.py b/package-cleanup.py index 4794369..acad9f2 100755 --- a/package-cleanup.py @@ -2068,6 +2180,28 @@ index 8486bb0..0000000 - # Don't die on errors, or we'll never see them. - if not conduit.getErrors() and opts.dlonly: - raise PluginYumExit('exiting because --downloadonly specified ') +diff --git a/plugins/fastestmirror/fastestmirror.py b/plugins/fastestmirror/fastestmirror.py +index 364b90d..fe79629 100644 +--- a/plugins/fastestmirror/fastestmirror.py ++++ b/plugins/fastestmirror/fastestmirror.py +@@ -216,7 +216,7 @@ def postreposetup_hook(conduit): + def includeCheck(mirror): + if filter(lambda exp: re.search(exp, host(mirror)), + include_only.replace(',', ' ').split()): +- conduit.info(2, "Including mirror: %s" % host(mirror)) ++ conduit.info(3, "Including mirror: %s" % host(mirror)) + return True + return False + repomirrors[str(repo)] = filter(includeCheck,repomirrors[str(repo)]) +@@ -225,7 +225,7 @@ def postreposetup_hook(conduit): + def excludeCheck(mirror): + if filter(lambda exp: re.search(exp, host(mirror)), + exclude.replace(',', ' ').split()): +- conduit.info(2, "Excluding mirror: %s" % host(mirror)) ++ conduit.info(3, "Excluding mirror: %s" % host(mirror)) + return False + return True + repomirrors[str(repo)] = filter(excludeCheck,repomirrors[str(repo)]) diff --git a/plugins/fedorakmod/fedorakmod.py b/plugins/fedorakmod/fedorakmod.py index b3aed61..82a43d5 100644 --- a/plugins/fedorakmod/fedorakmod.py @@ -2344,6 +2478,912 @@ index 202c203..ce98583 100644 def _pkglist_to_dict(pl, priority, addArch = False): out = dict() +diff --git a/plugins/security/security.conf b/plugins/security/security.conf +deleted file mode 100644 +index 8e4d76c..0000000 +--- a/plugins/security/security.conf ++++ /dev/null +@@ -1,2 +0,0 @@ +-[main] +-enabled=1 +diff --git a/plugins/security/security.py b/plugins/security/security.py +deleted file mode 100755 +index a60cf9b..0000000 +--- a/plugins/security/security.py ++++ /dev/null +@@ -1,892 +0,0 @@ +-#! /usr/bin/python -tt +-# This program is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# 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 Library General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with this program; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +-# +-# +-# Copyright Red Hat Inc. 2007, 2008 +-# +-# Author: James Antill +-# +-# Examples: +-# +-# yum --security info updates +-# yum --security list updates +-# yum --security check-update +-# yum --security update +-# +-# yum --cve CVE-2007-1667 +-# yum --bz 235374 --bz 234688 +-# yum --advisory FEDORA-2007-420 --advisory FEDORA-2007-346 +-# +-# yum list-updateinfo +-# yum list-updateinfo bugzillas / bzs +-# yum list-updateinfo cves +-# yum list-updateinfo security / sec +-# yum list-updateinfo new +-# +-# yum summary-updateinfo +-# +-# yum update-minimal --security +- +-import yum +-import fnmatch +-from yum.plugins import TYPE_INTERACTIVE +-from yum.update_md import UpdateMetadata +-import logging # for commands +- +-from yum.constants import * +- +-import rpmUtils.miscutils +- +-requires_api_version = '2.5' +-plugin_type = (TYPE_INTERACTIVE,) +-__package_name__ = "yum-plugin-security" +- +-# newpackages is weird, in that we'll never display that because we filter to +-# things relevant to installed pkgs... +-__update_info_types__ = ("security", "bugfix", "enhancement", +- "recommended", "newpackage") +- +-def _rpm_tup_vercmp(tup1, tup2): +- """ Compare two "std." tuples, (n, a, e, v, r). """ +- return rpmUtils.miscutils.compareEVR((tup1[2], tup1[3], tup1[4]), +- (tup2[2], tup2[3], tup2[4])) +- +-class CliError(yum.Errors.YumBaseError): +- +- """ +- Command line interface related Exception. +- """ +- +- def __init__(self, args=''): +- yum.Errors.YumBaseError.__init__(self) +- self.args = args +- +-def ysp_gen_metadata(repos): +- """ Generate the info. from the updateinfo.xml files. """ +- md_info = UpdateMetadata() +- for repo in repos: +- if not repo.enabled: +- continue +- +- try: # attempt to grab the updateinfo.xml.gz from the repodata +- md_info.add(repo) +- except yum.Errors.RepoMDError: +- continue # No metadata found for this repo +- return md_info +- +-def ysp__safe_refs(refs): +- """ Sometimes refs == None, if so return the empty list here. +- So we don't have to check everywhere. """ +- if refs == None: +- return [] +- return refs +- +-def _match_sec_cmd(sec_cmds, pkgname, notice): +- for i in sec_cmds: +- if fnmatch.fnmatch(pkgname, i): +- return i +- if notice['update_id'] == i: +- return i +- return None +- +-def _has_id(used_map, refs, ref_type, ref_ids): +- ''' Check if the given ID is a match. ''' +- for ref in ysp__safe_refs(refs): +- if ref['type'] != ref_type: +- continue +- if ref['id'] not in ref_ids: +- continue +- used_map[ref_type][ref['id']] = True +- return ref +- return None +- +-def ysp_should_filter_pkg(opts, pkgname, notice, used_map): +- """ Do the package filtering for should_show and should_keep. """ +- +- rcmd = _match_sec_cmd(opts.sec_cmds, pkgname, notice) +- if rcmd: +- used_map['cmd'][rcmd] = True +- return True +- elif opts.advisory and notice['update_id'] in opts.advisory: +- used_map['id'][notice['update_id']] = True +- return True +- elif (opts.severity and notice['type'] == 'security' and +- notice['severity'] in opts.severity): +- used_map['sev'][notice['severity']] = True +- return True +- elif opts.cve and _has_id(used_map, notice['references'], "cve", opts.cve): +- return True +- elif opts.bz and _has_id(used_map, notice['references'],"bugzilla",opts.bz): +- return True +- # FIXME: Add opts for enhancement/etc.? -- __update_info_types__ +- elif (opts.security and notice['type'] == 'security' and +- (not opts.severity or 'severity' not in notice or +- not notice['severity'])): +- return True +- elif opts.bugfixes and notice['type'] == 'bugfix': +- return True +- elif not (opts.advisory or opts.cve or opts.bz or +- opts.security or opts.bugfixes or opts.sec_cmds or opts.severity): +- return True # This is only possible from should_show_pkg +- return False +- +-def ysp_has_info_md(rname, md): +- if rname in __update_info_types__: +- if md['type'] == rname: +- return md +- for ref in ysp__safe_refs(md['references']): +- if ref['type'] != rname: +- continue +- return md +- +-def ysp_gen_used_map(opts): +- used_map = {'bugzilla' : {}, 'cve' : {}, 'id' : {}, 'cmd' : {}, 'sev' : {}} +- for i in opts.sec_cmds: +- used_map['cmd'][i] = False +- for i in opts.advisory: +- used_map['id'][i] = False +- for i in opts.bz: +- used_map['bugzilla'][i] = False +- for i in opts.cve: +- used_map['cve'][i] = False +- for i in opts.severity: +- used_map['sev'][i] = False +- return used_map +- +-def ysp_chk_used_map(used_map, msg): +- for i in used_map['cmd']: +- if not used_map['cmd'][i]: +- msg('No update information found for \"%s\"' % i) +- for i in used_map['id']: +- if not used_map['id'][i]: +- msg('Advisory \"%s\" not found applicable for this system' % i) +- for i in used_map['bugzilla']: +- if not used_map['bugzilla'][i]: +- msg('BZ \"%s\" not found applicable for this system' % i) +- for i in used_map['cve']: +- if not used_map['cve'][i]: +- msg('CVE \"%s\" not found applicable for this system' % i) +- for i in used_map['sev']: +- if not used_map['sev'][i]: +- msg('Severity \"%s\" not found applicable for this system' % i) +- +-class UpdateinfoCommand: +- # Old command names... +- direct_cmds = {'list-updateinfo' : 'list', +- 'list-security' : 'list', +- 'list-sec' : 'list', +- 'info-updateinfo' : 'info', +- 'info-security' : 'info', +- 'info-sec' : 'info', +- 'summary-updateinfo' : 'summary'} +- +- # Note that this code (instead of using inheritance and multiple +- # cmd classes) means that "yum help" only displays the updateinfo command. +- # Which is what we want, because the other commands are just backwards +- # compatible gunk we don't want the user using). +- def getNames(self): +- return ['updateinfo'] + sorted(self.direct_cmds.keys()) +- +- def getUsage(self): +- return "[info|list|...] [security|...] [installed|available|all] [pkgs|id]" +- +- def getSummary(self): +- return "Acts on repository update information" +- +- def doCheck(self, base, basecmd, extcmds): +- pass +- +- def list_show_pkgs(self, base, md_info, list_type, show_type, +- iname2tup, data, msg): +- n_maxsize = 0 +- r_maxsize = 0 +- t_maxsize = 0 +- for (notice, pkgtup, pkg) in data: +- n_maxsize = max(len(notice['update_id']), n_maxsize) +- tn = notice['type'] +- if tn == 'security' and notice['severity']: +- tn = notice['severity'] + '/Sec.' +- t_maxsize = max(len(tn), t_maxsize) +- if show_type: +- for ref in ysp__safe_refs(notice['references']): +- if ref['type'] != show_type: +- continue +- r_maxsize = max(len(str(ref['id'])), r_maxsize) +- +- for (notice, pkgtup, pkg) in data: +- mark = '' +- if list_type == 'all': +- mark = ' ' +- if _rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: +- mark = 'i ' +- tn = notice['type'] +- if tn == 'security' and notice['severity']: +- tn = notice['severity'] + '/Sec.' +- +- if show_type and ysp_has_info_md(show_type, notice): +- for ref in ysp__safe_refs(notice['references']): +- if ref['type'] != show_type: +- continue +- msg("%s %-*s %-*s %s" % (mark, r_maxsize, str(ref['id']), +- t_maxsize, tn, pkg)) +- elif hasattr(pkg, 'name'): +- print base.fmtKeyValFill("%s: " % pkg.name, +- base._enc(pkg.summary)) +- else: +- msg("%s%-*s %-*s %s" % (mark, n_maxsize, notice['update_id'], +- t_maxsize, tn, pkg)) +- +- def info_show_pkgs(self, base, md_info, list_type, show_type, +- iname2tup, data, msg): +- show_pkg_info_done = {} +- for (notice, pkgtup, pkg) in data: +- if notice['update_id'] in show_pkg_info_done: +- continue +- show_pkg_info_done[notice['update_id']] = notice +- +- if hasattr(notice, 'text'): +- debug_log_lvl = yum.logginglevels.DEBUG_3 +- vlog = logging.getLogger("yum.verbose.main") +- if vlog.isEnabledFor(debug_log_lvl): +- obj = notice.text(skip_data=[]) +- else: +- obj = notice.text() +- else: +- # Python-2.4.* doesn't understand str(x) returning unicode +- obj = notice.__str__() +- +- if list_type == 'all': +- if _rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: +- obj = obj + "\n Installed : true" +- else: +- obj = obj + "\n Installed : false" +- msg(obj) +- +- def summary_show_pkgs(self, base, md_info, list_type, show_type, +- iname2tup, data, msg): +- def _msg(x): +- print x +- counts = {} +- sev_counts = {} +- show_pkg_info_done = {} +- for (notice, pkgtup, pkg) in data: +- if notice['update_id'] in show_pkg_info_done: +- continue +- show_pkg_info_done[notice['update_id']] = notice +- counts[notice['type']] = counts.get(notice['type'], 0) + 1 +- if notice['type'] == 'security': +- sev = notice['severity'] +- if sev is None: +- sev = '' +- sev_counts[sev] = sev_counts.get(sev, 0) + 1 +- +- maxsize = 0 +- for T in ('newpackage', 'security', 'bugfix', 'enhancement'): +- if T not in counts: +- continue +- size = len(str(counts[T])) +- if maxsize < size: +- maxsize = size +- if not maxsize: +- _check_running_kernel(base, md_info, _msg) +- return +- +- outT = {'newpackage' : 'New Package', +- 'security' : 'Security', +- 'bugfix' : 'Bugfix', +- 'enhancement' : 'Enhancement'} +- print "Updates Information Summary:", list_type +- for T in ('newpackage', 'security', 'bugfix', 'enhancement'): +- if T not in counts: +- continue +- n = outT[T] +- if T == 'security' and len(sev_counts) == 1: +- sn = sev_counts.keys()[0] +- if sn != '': +- n = sn + " " + n +- print " %*u %s notice(s)" % (maxsize, counts[T], n) +- if T == 'security' and len(sev_counts) != 1: +- def _sev_sort_key(key): +- # We want these in order, from "highest" to "lowest". +- # Anything unknown is "higher". meh. +- return {'Critical' : "zz1", +- 'Important': "zz2", +- 'Moderate' : "zz3", +- 'Low' : "zz4", +- }.get(key, key) +- +- for sn in sorted(sev_counts, key=_sev_sort_key): +- args = (maxsize, sev_counts[sn],sn or '?', outT['security']) +- print " %*u %s %s notice(s)" % args +- _check_running_kernel(base, md_info, _msg) +- self.show_pkg_info_done = {} +- +- def _get_new_pkgs(self, md_info): +- for notice in md_info.notices: +- if notice['type'] != "newpackage": +- continue +- for upkg in notice['pkglist']: +- for pkg in upkg['packages']: +- pkgtup = (pkg['name'], pkg['arch'], pkg['epoch'] or '0', +- pkg['version'], pkg['release']) +- yield (notice, pkgtup) +- +- _cmd2filt = {"bugzillas" : "bugzilla", +- "bugzilla" : "bugzilla", +- "bzs" : "bugzilla", +- "bz" : "bugzilla", +- +- "sec" : "security", +- +- "cves" : "cve", +- "cve" : "cve", +- +- "newpackages" : "newpackage", +- "new-packages" : "newpackage", +- "newpackage" : "newpackage", +- "new-package" : "newpackage", +- "new" : "newpackage"} +- for filt_type in __update_info_types__: +- _cmd2filt[filt_type] = filt_type +- +- def doCommand(self, base, basecmd, extcmds): +- if basecmd in self.direct_cmds: +- subcommand = self.direct_cmds[basecmd] +- elif extcmds and extcmds[0] in ('list', 'info', 'summary'): +- subcommand = extcmds[0] +- extcmds = extcmds[1:] +- elif extcmds and extcmds[0] in self._cmd2filt: +- subcommand = 'list' +- elif extcmds: +- subcommand = 'info' +- else: +- subcommand = 'summary' +- +- if subcommand == 'list': +- return self.doCommand_li(base, 'updateinfo list', extcmds, +- self.list_show_pkgs) +- if subcommand == 'info': +- return self.doCommand_li(base, 'updateinfo info', extcmds, +- self.info_show_pkgs) +- +- if subcommand == 'summary': +- return self.doCommand_li(base, 'updateinfo summary', extcmds, +- self.summary_show_pkgs) +- +- def doCommand_li_new(self, base, list_type, extcmds, md_info, msg, +- show_pkgs): +- done_pkgs = set() +- data = [] +- for (notice, pkgtup) in sorted(self._get_new_pkgs(md_info), +- key=lambda x: x[1][0]): +- if extcmds and not _match_sec_cmd(extcmds, pkgtup[0], notice): +- continue +- n = pkgtup[0] +- if n in done_pkgs: +- continue +- ipkgs = list(reversed(sorted(base.rpmdb.searchNames([n])))) +- if list_type in ('installed', 'updates') and not ipkgs: +- done_pkgs.add(n) +- continue +- if list_type == 'available' and ipkgs: +- done_pkgs.add(n) +- continue +- +- pkgs = base.pkgSack.searchPkgTuple(pkgtup) +- if not pkgs: +- continue +- if list_type == "updates" and pkgs[0].verLE(ipkgs[0]): +- done_pkgs.add(n) +- continue +- done_pkgs.add(n) +- data.append((notice, pkgtup, pkgs[0])) +- show_pkgs(base, md_info, list_type, None, {}, data, msg) +- +- def _parse_extcmds(self, extcmds): +- filt_type = None +- show_type = None +- if len(extcmds) >= 1: +- filt_type = None +- +- if extcmds[0] in self._cmd2filt: +- filt_type = self._cmd2filt[extcmds.pop(0)] +- show_type = filt_type +- if filt_type and filt_type in __update_info_types__: +- show_type = None +- return extcmds, show_type, filt_type +- +- def doCommand_li(self, base, basecmd, extcmds, show_pkgs): +- self.repos = base.repos +- md_info = ysp_gen_metadata(self.repos.listEnabled()) +- def msg(x): +- # Don't use: logger.log(logginglevels.INFO_2, x) +- # or -q deletes everything. +- print x +- +- opts, cmdline = base.plugins.cmdline +- extcmds, show_type, filt_type = self._parse_extcmds(extcmds) +- +- list_type = "available" +- if extcmds and extcmds[0] in ("updates","available","installed", "all"): +- list_type = extcmds.pop(0) +- +- if filt_type == "newpackage": +- # No filtering here, as we want what isn't installed... +- self.doCommand_li_new(base, list_type, extcmds, md_info, msg, +- show_pkgs) +- return 0, [basecmd + ' new done'] +- +- opts.sec_cmds = extcmds +- used_map = ysp_gen_used_map(opts) +- iname2tup = {} +- if False: pass +- elif list_type in ('installed', 'all'): +- name2tup = _get_name2allpkgtup(base) +- iname2tup = _get_name2instpkgtup(base) +- elif list_type == 'updates': +- name2tup = _get_name2oldpkgtup(base) +- elif list_type == 'available': +- name2tup = _get_name2instpkgtup(base) +- +- def _show_pkgtup(pkgtup): +- name = pkgtup[0] +- notices = reversed(md_info.get_applicable_notices(pkgtup)) +- for (pkgtup, notice) in notices: +- if filt_type and not ysp_has_info_md(filt_type, notice): +- continue +- +- if list_type == 'installed': +- # Remove any that are newer than what we have installed +- if _rpm_tup_vercmp(iname2tup[name], pkgtup) < 0: +- continue +- +- if ysp_should_filter_pkg(opts, name, notice, used_map): +- yield (pkgtup, notice) +- +- data = [] +- for pkgname in sorted(name2tup): +- for (pkgtup, notice) in _show_pkgtup(name2tup[pkgname]): +- d = {} +- (d['n'], d['a'], d['e'], d['v'], d['r']) = pkgtup +- if d['e'] == '0': +- d['epoch'] = '' +- else: +- d['epoch'] = "%s:" % d['e'] +- data.append((notice, pkgtup, +- "%(n)s-%(epoch)s%(v)s-%(r)s.%(a)s" % d)) +- show_pkgs(base, md_info, list_type, show_type, iname2tup, data, msg) +- +- ysp_chk_used_map(used_map, msg) +- +- return 0, [basecmd + ' done'] +- +- +-# "Borrowed" from yumcommands.py +-def yumcommands_checkRootUID(base): +- """ +- Verify that the program is being run by the root user. +- +- @param base: a YumBase object. +- """ +- if base.conf.uid != 0: +- base.logger.critical('You need to be root to perform this command.') +- raise CliError +-def yumcommands_checkGPGKey(base): +- if not base.gpgKeyCheck(): +- for repo in base.repos.listEnabled(): +- if repo.gpgcheck != 'false' and repo.gpgkey == '': +- msg = """ +-You have enabled checking of packages via GPG keys. This is a good thing. +-However, you do not have any GPG public keys installed. You need to download +-the keys for packages you wish to install and install them. +-You can do that by running the command: +- rpm --import public.gpg.key +- +- +-Alternatively you can specify the url to the key you would like to use +-for a repository in the 'gpgkey' option in a repository section and yum +-will install it for you. +- +-For more information contact your distribution or package provider. +-""" +- base.logger.critical(msg) +- raise CliError +- +-def _get_name2pkgtup(base, pkgtups): +- name2tup = {} +- for pkgtup in pkgtups: +- # Get the latest "old" pkgtups +- if (pkgtup[0] in name2tup and +- _rpm_tup_vercmp(name2tup[pkgtup[0]], pkgtup) > 0): +- continue +- name2tup[pkgtup[0]] = pkgtup +- return name2tup +-def _get_name2oldpkgtup(base): +- """ Get the pkgtups for all installed pkgs. which have an update. """ +- oupdates = map(lambda x: x[1], base.up.getUpdatesTuples()) +- return _get_name2pkgtup(base, oupdates) +-def _get_name2instpkgtup(base): +- """ Get the pkgtups for all installed pkgs. """ +- return _get_name2pkgtup(base, base.rpmdb.simplePkgList()) +-def _get_name2allpkgtup(base): +- """ Get the pkgtups for all installed pkgs. and munge that to be the +- first possible pkgtup. """ +- ofirst = [(pt[0], pt[1], '0','0','0') for pt in base.rpmdb.simplePkgList()] +- return _get_name2pkgtup(base, ofirst) +- +- +- +-class SecurityUpdateCommand: +- def getNames(self): +- return ['update-minimal'] +- +- def getUsage(self): +- return "[PACKAGE-wildcard]" +- +- def getSummary(self): +- return "Works like update, but goes to the 'newest' package match which fixes a problem that affects your system" +- +- def doCheck(self, base, basecmd, extcmds): +- yumcommands_checkRootUID(base) +- yumcommands_checkGPGKey(base) +- +- def doCommand(self, base, basecmd, extcmds): +- if hasattr(base, 'run_with_package_names'): +- base.run_with_package_names.add(__package_name__) +- md_info = ysp_gen_metadata(base.repos.listEnabled()) +- opts = base.plugins.cmdline[0] +- opts.sec_cmds = [] +- used_map = ysp_gen_used_map(opts) +- +- ndata = not (opts.security or opts.bugfixes or +- opts.advisory or opts.bz or opts.cve or opts.severity) +- +- # NOTE: Not doing obsoletes processing atm. ... maybe we should? -- +- # Also worth pointing out we don't go backwards for obsoletes in the: +- # update --security case etc. +- +- # obsoletes = base.up.getObsoletesTuples(newest=False) +- # for (obsoleting, installed) in sorted(obsoletes, key=lambda x: x[0]): +- # pass +- +- # Tuples == (n, a, e, v, r) +- oupdates = map(lambda x: x[1], base.up.getUpdatesTuples()) +- for oldpkgtup in sorted(oupdates): +- data = md_info.get_applicable_notices(oldpkgtup) +- if ndata: # No options means pick the oldest update +- data.reverse() +- +- for (pkgtup, notice) in data: +- name = pkgtup[0] +- if extcmds and not _match_sec_cmd(extcmds, name, notice): +- continue +- if (not ndata and +- not ysp_should_filter_pkg(opts, name, notice, used_map)): +- continue +- base.update(name=pkgtup[0], arch=pkgtup[1], epoch=pkgtup[2], +- version=pkgtup[3], release=pkgtup[4]) +- break +- +- if len(base.tsInfo) > 0: +- msg = '%d packages marked for minimal Update' % len(base.tsInfo) +- return 2, [msg] +- else: +- return 0, ['No Packages marked for minimal Update'] +- +-def config_hook(conduit): +- ''' +- Yum Plugin Config Hook: +- Setup the option parser with the '--advisory', '--bz', '--cve', +- '--security' and '--severity' command line options. Also the 'updateinfo' +- and 'update-minimal' commands. +- ''' +- +- parser = conduit.getOptParser() +- if not parser: +- return +- +- if hasattr(parser, 'plugin_option_group'): +- parser = parser.plugin_option_group +- +- conduit.registerCommand(UpdateinfoCommand()) +- conduit.registerCommand(SecurityUpdateCommand()) +- def osec(opt, key, val, parser): +- # CVE is a subset of --security on RHEL, but not on Fedora +- parser.values.security = True +- def obug(opt, key, val, parser): +- parser.values.bugfixes = True +- def ocve(opt, key, val, parser): +- parser.values.cve.extend(val.split(',')) +- def obz(opt, key, val, parser): +- parser.values.bz.append(str(val)) +- def oadv(opt, key, val, parser): +- parser.values.advisory.extend(val.split(',')) +- def osev(opt, key, val, parser): +- parser.values.severity.extend(val.split(',')) +- +- parser.add_option('--security', action="callback", +- callback=osec, dest='security', default=False, +- help='Include security relevant packages') +- parser.add_option('--bugfixes', action="callback", +- callback=obug, dest='bugfixes', default=False, +- help='Include bugfix relevant packages') +- parser.add_option('--cve', action="callback", type="string", +- callback=ocve, dest='cve', default=[], +- help='Include packages needed to fix the given CVE') +- parser.add_option('--bz', action="callback", +- callback=obz, dest='bz', default=[], type="int", +- help='Include packages needed to fix the given BZ') +- parser.add_option('--sec-severity', action="callback", +- callback=osev, dest='severity', default=[], type="string", +- help='Include security relevant packages, of this severity') +- parser.add_option('--advisory', action="callback", +- callback=oadv, dest='advisory', default=[], type="string", +- help='Include packages needed to fix the given advisory') +- +-# You might think we'd just use the exclude_hook, and call delPackage +-# and indeed that works for list updates etc. +-# +-# __but__ that doesn't work for dependancies on real updates +-# +-# So to fix deps. we need to do it at the preresolve stage and take the +-# "transaction package list" and then remove packages from that. +-# +-# __but__ that doesn't work for lists ... so we do it two ways +-# +-def ysp_should_keep_pkg(opts, pkgtup, md_info, used_map): +- """ Do we want to keep this package to satisfy the security limits. """ +- name = pkgtup[0] +- for (pkgtup, notice) in md_info.get_applicable_notices(pkgtup): +- if ysp_should_filter_pkg(opts, name, notice, used_map): +- return True +- return False +- +-def ysp_check_func_enter(conduit): +- """ Stuff we need to do in both list and update modes. """ +- +- opts, args = conduit.getCmdLine() +- +- ndata = not (opts.security or opts.bugfixes or +- opts.advisory or opts.bz or opts.cve or opts.severity) +- +- ret = None +- if len(args) >= 2: +- if ((args[0] == "list") and (args[1] in ("obsoletes", "updates"))): +- ret = {"skip": ndata, "list_cmd": True} +- if ((args[0] == "info") and (args[1] in ("obsoletes", "updates"))): +- ret = {"skip": ndata, "list_cmd": True} +- if len(args): +- +- # All the args. stuff is done in our command: +- if (args[0] == "update-minimal"): +- return (opts, {"skip": True, "list_cmd": False, "msg": True}) +- +- if (args[0] == "check-update"): +- ret = {"skip": ndata, "list_cmd": True} +- if (args[0] in ["update", "upgrade"]): +- ret = {"skip": ndata, "list_cmd": False} +- if args[0] == 'updateinfo': +- return (opts, {"skip": True, "list_cmd": True}) +- if (args[0] in UpdateinfoCommand.direct_cmds): +- return (opts, {"skip": True, "list_cmd": True}) +- +- if ret: +- return (opts, ret) +- +- if not ndata: +- conduit.error(2, 'Skipping security plugin, other command') +- return (opts, {"skip": True, "list_cmd": False, "msg": True}) +- +-def exclude_hook(conduit): +- ''' +- Yum Plugin Exclude Hook: +- Check and remove packages that don\'t align with the security config. +- ''' +- +- opts, info = ysp_check_func_enter(conduit) +- if info["skip"]: +- return +- +- if not info["list_cmd"]: +- return +- +- if hasattr(conduit, 'registerPackageName'): +- conduit.registerPackageName(__package_name__) +- conduit.info(2, 'Limiting package lists to security relevant ones') +- +- md_info = ysp_gen_metadata(conduit.getRepos().listEnabled()) +- +- def ysp_del_pkg(pkg): +- """ Deletes a package from all trees that yum knows about """ +- conduit.info(3," --> %s from %s excluded (non-security)" % +- (pkg,pkg.repoid)) +- conduit.delPackage(pkg) +- +- opts.sec_cmds = [] +- used_map = ysp_gen_used_map(opts) +- +- # The official API is: +- # +- # pkgs = conduit.getPackages() +- # +- # ...however that is _extremely_ slow, deleting all packages. So we ask +- # for the list of update packages, which is all we care about. +- upds = conduit._base.doPackageLists(pkgnarrow='updates') +- pkgs = upds.updates +- # In theory we don't need to do this in some cases, but meh. +- upds = conduit._base.doPackageLists(pkgnarrow='obsoletes') +- pkgs += upds.obsoletes +- +- name2tup = _get_name2oldpkgtup(conduit._base) +- +- tot = 0 +- cnt = 0 +- for pkg in pkgs: +- tot += 1 +- name = pkg.name +- if (name not in name2tup or +- not ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)): +- ysp_del_pkg(pkg) +- continue +- cnt += 1 +- +- ysp_chk_used_map(used_map, lambda x: conduit.error(2, x)) +- if cnt: +- conduit.info(2, '%d package(s) needed for security, out of %d available' % (cnt, tot)) +- else: +- conduit.info(2, 'No packages needed for security; %d packages available' % tot) +- +- _check_running_kernel(conduit._base, md_info, lambda x: conduit.info(2, x)) +- +-def _check_running_kernel(yb, md_info, msg): +- if not hasattr(yum.misc, 'get_running_kernel_pkgtup'): +- return # Back compat. +- +- kern_pkgtup = yum.misc.get_running_kernel_pkgtup(yb.ts) +- if kern_pkgtup[0] is None: +- return +- +- found_sec = False +- for (pkgtup, notice) in md_info.get_applicable_notices(kern_pkgtup): +- if found_sec or notice['type'] != 'security': +- continue +- found_sec = True +- ipkg = yb.rpmdb.searchPkgTuple(pkgtup) +- if not ipkg: +- continue # Not installed +- ipkg = ipkg[0] +- +- e = '' +- if kern_pkgtup[2] != '0': +- e = '%s:' % kern_pkgtup[2] +- rpkg = '%s-%s%s-%s.%s' % (kern_pkgtup[0], e, +- kern_pkgtup[3], kern_pkgtup[4], +- kern_pkgtup[1]) +- +- msg('Security: %s is an installed security update' % ipkg) +- msg('Security: %s is the currently running version' % rpkg) +- break +- +- +-def preresolve_hook(conduit): +- ''' +- Yum Plugin PreResolve Hook: +- Check and remove packages that don\'t align with the security config. +- ''' +- +- opts, info = ysp_check_func_enter(conduit) +- if info["skip"]: +- return +- +- if info["list_cmd"]: +- return +- +- if hasattr(conduit, 'registerPackageName'): +- conduit.registerPackageName(__package_name__) +- conduit.info(2, 'Limiting packages to security relevant ones') +- +- md_info = ysp_gen_metadata(conduit.getRepos().listEnabled()) +- +- def ysp_del_pkg(tspkg): +- """ Deletes a package within a transaction. """ +- conduit.info(3," --> %s from %s excluded (non-security)" % +- (tspkg.po,tspkg.po.repoid)) +- tsinfo.remove(tspkg.pkgtup) +- +- tot = 0 +- cnt = 0 +- opts.sec_cmds = [] +- used_map = ysp_gen_used_map(opts) +- tsinfo = conduit.getTsInfo() +- tspkgs = tsinfo.getMembers() +- # Ok, here we keep any pkgs that pass "ysp" tests, then we keep all +- # related pkgs ... Ie. "installed" version marked for removal. +- keep_pkgs = set() +- +- count_states = set(TS_INSTALL_STATES + [TS_ERASE]) +- count_pkgs = set() +- for tspkg in tspkgs: +- if tspkg.output_state in count_states: +- count_pkgs.add(tspkg.po) +- +- name2tup = _get_name2oldpkgtup(conduit._base) +- for tspkg in tspkgs: +- if tspkg.output_state in count_states: +- tot += 1 +- name = tspkg.po.name +- if (name not in name2tup or +- not ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)): +- continue +- if tspkg.output_state in count_states: +- cnt += 1 +- keep_pkgs.add(tspkg.po) +- +- scnt = cnt +- mini_depsolve_again = True +- while mini_depsolve_again: +- mini_depsolve_again = False +- +- for tspkg in tspkgs: +- if tspkg.po in keep_pkgs: +- # Find any related pkgs, and add them: +- for (rpkg, reason) in tspkg.relatedto: +- if rpkg not in keep_pkgs: +- if rpkg in count_pkgs: +- cnt += 1 +- keep_pkgs.add(rpkg) +- mini_depsolve_again = True +- else: +- # If related to any keep pkgs, add us +- for (rpkg, reason) in tspkg.relatedto: +- if rpkg in keep_pkgs: +- if rpkg in count_pkgs: +- cnt += 1 +- keep_pkgs.add(tspkg.po) +- mini_depsolve_again = True +- break +- +- for tspkg in tspkgs: +- if tspkg.po not in keep_pkgs: +- ysp_del_pkg(tspkg) +- +- ysp_chk_used_map(used_map, lambda x: conduit.error(2, x)) +- +- if cnt: +- conduit.info(2, '%d package(s) needed (+%d related) for security, out of %d available' % (scnt, cnt - scnt, tot)) +- else: +- conduit.info(2, 'No packages needed for security; %d packages available' % tot) +- +-if __name__ == '__main__': +- print "This is a plugin that is supposed to run from inside YUM" diff --git a/plugins/tmprepo/tmprepo.py b/plugins/tmprepo/tmprepo.py index e60dd4d..ec51f5b 100644 --- a/plugins/tmprepo/tmprepo.py @@ -2432,10 +3472,10 @@ index 40756b2..dfe4dd3 100644 return 0, ['versionlock deleted: ' + str(count)] diff --git a/po/POTFILES.in b/po/POTFILES.in -index 581da0a..d85030c 100644 +index 581da0a..2f12118 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in -@@ -28,7 +28,6 @@ plugins/ps/ps.py +@@ -28,14 +28,12 @@ plugins/ps/ps.py plugins/auto-update-debuginfo/auto-update-debuginfo.py plugins/show-leaves/show-leaves.py plugins/list-data/list-data.py @@ -2443,6 +3483,13 @@ index 581da0a..d85030c 100644 plugins/allowdowngrade/allowdowngrade.py plugins/tsflags/tsflags.py plugins/merge-conf/merge-conf.py + plugins/aliases/aliases.py + plugins/protectbase/protectbase.py + plugins/versionlock/versionlock.py +-plugins/security/security.py + plugins/nofsync/nofsync.py + plugins/tmprepo/tmprepo.py + plugins/priorities/priorities.py diff --git a/repo-check.py b/repo-check.py index 7c4ae77..2aa8bde 100755 --- a/repo-check.py @@ -2818,7 +3865,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..64976ec 100755 +index a3bb111..2390e79 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -2844,7 +3891,15 @@ index a3bb111..64976ec 100755 import urlparse from optparse import OptionParser -@@ -74,6 +73,15 @@ querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', +@@ -62,6 +61,7 @@ Size : %{installedsize} + Packager : %{packager} + Group : %{group} + URL : %{url} ++License : %{license} + Repository : %{repoid} + Summary : %{summary} + Source : %{sourcerpm} +@@ -74,6 +74,15 @@ querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', 'installedsize', 'archivesize', 'packagesize', 'repoid', 'requires', 'provides', 'conflicts', 'obsoletes', 'relativepath', 'hdrstart', 'hdrend', 'id', @@ -2860,7 +3915,7 @@ index a3bb111..64976ec 100755 ] def sec2isodate(timestr): -@@ -114,7 +122,7 @@ convertmap = { 'date': sec2date, +@@ -114,7 +123,7 @@ convertmap = { 'date': sec2date, 'h': size2h, } @@ -2869,7 +3924,7 @@ index a3bb111..64976ec 100755 def __init__(self, value=None): Exception.__init__(self) self.value = value -@@ -316,12 +324,13 @@ class pkgQuery: +@@ -316,12 +325,13 @@ class pkgQuery: print "%s%s [%s]" % (indent, str(req), str(val)) # These are common helpers for the --tree-* options... @@ -2886,7 +3941,7 @@ index a3bb111..64976ec 100755 def _tree_pkg2uniq(self, pkg): """ Turn a pkg into a "unique" req.""" if self.yb and self.yb.conf.showdupesfromrepos: -@@ -365,6 +374,7 @@ class pkgQuery: +@@ -365,6 +375,7 @@ class pkgQuery: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -2894,7 +3949,7 @@ index a3bb111..64976ec 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -375,6 +385,15 @@ class pkgQuery: +@@ -375,6 +386,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -2910,7 +3965,7 @@ index a3bb111..64976ec 100755 __req2pkgs = {} def req2pkgs(ignore, req): req = str(req) -@@ -406,6 +425,8 @@ class pkgQuery: +@@ -406,6 +426,8 @@ class pkgQuery: providers = matches.keys() @@ -2919,7 +3974,7 @@ index a3bb111..64976ec 100755 except yum.Errors.YumBaseError, err: print >>sys.stderr, "No package provides %s" % req return [] -@@ -413,14 +434,9 @@ class pkgQuery: +@@ -413,14 +435,9 @@ class pkgQuery: __req2pkgs[req] = providers return providers @@ -2935,7 +3990,7 @@ index a3bb111..64976ec 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -449,6 +465,7 @@ class pkgQuery: +@@ -449,6 +466,7 @@ class pkgQuery: def fmt_tree_obsoletes(self, **kw): pkg = kw.get('pkg', self.pkg) @@ -2943,7 +3998,7 @@ index a3bb111..64976ec 100755 level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) -@@ -457,6 +474,7 @@ class pkgQuery: +@@ -457,6 +475,7 @@ class pkgQuery: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -2951,7 +4006,7 @@ index a3bb111..64976ec 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -467,6 +485,15 @@ class pkgQuery: +@@ -467,6 +486,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -2967,7 +4022,7 @@ index a3bb111..64976ec 100755 def obs2pkgs(): if self.yb is None: return [] -@@ -496,10 +523,7 @@ class pkgQuery: +@@ -496,10 +524,7 @@ class pkgQuery: else: reason = 'cmd line' rpkgs = obs2pkgs() @@ -2979,7 +4034,7 @@ index a3bb111..64976ec 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 all_reqs[pkg] = None -@@ -514,6 +538,7 @@ class pkgQuery: +@@ -514,6 +539,7 @@ class pkgQuery: self._tree_print_req(rpkg, '', nlevel) continue self.fmt_tree_obsoletes(pkg=rpkg, level=nlevel, all_reqs=all_reqs, @@ -2987,7 +4042,7 @@ index a3bb111..64976ec 100755 tree_level = kw['tree_level'], output = kw['output'], dot = dot) -@@ -527,6 +552,7 @@ class pkgQuery: +@@ -527,6 +553,7 @@ class pkgQuery: if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() @@ -2995,7 +4050,7 @@ index a3bb111..64976ec 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -537,6 +563,15 @@ class pkgQuery: +@@ -537,6 +564,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -3011,7 +4066,7 @@ index a3bb111..64976ec 100755 __prov2pkgs = {} def prov2pkgs(prov, ignore): if str(prov) in __prov2pkgs: -@@ -562,6 +597,8 @@ class pkgQuery: +@@ -562,6 +598,8 @@ class pkgQuery: arequirers = [pkg for pkg in areqs if pkg.pkgtup not in skip] @@ -3020,7 +4075,7 @@ index a3bb111..64976ec 100755 except yum.Errors.YumBaseError, err: print >>sys.stderr, "No package provides %s" % str(prov) return [] -@@ -575,12 +612,8 @@ class pkgQuery: +@@ -575,12 +613,8 @@ class pkgQuery: tups = pkg.provides + filetupes rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, prov2pkgs) @@ -3034,7 +4089,7 @@ index a3bb111..64976ec 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -719,13 +752,13 @@ class groupQuery: +@@ -719,13 +753,13 @@ class groupQuery: raise queryError("Invalid group query: %s" % method) # XXX temporary hack to make --group -a query work @@ -3051,7 +4106,7 @@ index a3bb111..64976ec 100755 pkgs = [] for t in self.grouppkgs.split(','): if t == "mandatory": -@@ -741,10 +774,10 @@ class groupQuery: +@@ -741,10 +775,10 @@ class groupQuery: return pkgs @@ -3064,16 +4119,7 @@ index a3bb111..64976ec 100755 return ["%s:\n\n%s\n" % (self.name, self.group.description)] -@@ -826,6 +859,8 @@ class YumBaseQuery(yum.YumBase): - pkgs = self.pkgSack.returnNewestByNameArch(**kwargs) - except yum.Errors.PackageSackError: - pkgs = [] -+ except yum.Errors.RepoError, e: -+ raise queryError(e) - else: - what = self.options.pkgnarrow - ygh = self.doPackageLists(what, **kwargs) -@@ -848,6 +883,8 @@ class YumBaseQuery(yum.YumBase): +@@ -848,6 +882,8 @@ class YumBaseQuery(yum.YumBase): matches = yum.YumBase.searchPackageProvides(self, [str(depstring)]) provider = matches.keys() # provider.extend(yum.YumBase.returnPackagesByDep(self, depstring)) @@ -3082,7 +4128,7 @@ index a3bb111..64976ec 100755 except yum.Errors.YumBaseError, err: self.logger.error("No package provides %s" % depstring) return self.queryPkgFactory(provider) -@@ -1008,12 +1045,12 @@ class YumBaseQuery(yum.YumBase): +@@ -1008,12 +1044,12 @@ class YumBaseQuery(yum.YumBase): def fmt_whatrequires(self, name, **kw): pkgs = {} @@ -3097,7 +4143,7 @@ index a3bb111..64976ec 100755 provs = [name] -@@ -1054,10 +1091,21 @@ class YumBaseQuery(yum.YumBase): +@@ -1054,10 +1090,21 @@ class YumBaseQuery(yum.YumBase): def fmt_requires(self, name, **kw): pkgs = {} @@ -3120,7 +4166,7 @@ index a3bb111..64976ec 100755 return pkgs.values() def fmt_location(self, name): -@@ -1070,6 +1118,44 @@ class YumBaseQuery(yum.YumBase): +@@ -1070,6 +1117,44 @@ class YumBaseQuery(yum.YumBase): loc.append("%s/%s" % (repo.urls[0], pkg['relativepath'])) return loc @@ -3165,7 +4211,7 @@ index a3bb111..64976ec 100755 def main(args): -@@ -1198,6 +1284,10 @@ def main(args): +@@ -1198,6 +1283,10 @@ def main(args): parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") @@ -3176,7 +4222,7 @@ index a3bb111..64976ec 100755 (opts, regexs) = parser.parse_args() -@@ -1261,9 +1351,10 @@ def main(args): +@@ -1261,9 +1350,10 @@ def main(args): if opts.srpm: needsource = 1 if opts.whatrequires: @@ -3188,7 +4234,7 @@ index a3bb111..64976ec 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1280,7 +1371,6 @@ def main(args): +@@ -1280,7 +1370,6 @@ def main(args): needgroup = 1 if opts.installed: opts.pkgnarrow = 'installed' @@ -3196,7 +4242,7 @@ index a3bb111..64976ec 100755 if opts.nevra: pkgops.append("nevra") -@@ -1303,6 +1393,13 @@ def main(args): +@@ -1303,6 +1392,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -3210,7 +4256,7 @@ index a3bb111..64976ec 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1312,7 +1409,26 @@ def main(args): +@@ -1312,7 +1408,26 @@ def main(args): repoq.preconf.fn = opts.conffile repoq.preconf.debuglevel = initnoise repoq.preconf.init_plugins = opts.plugins @@ -3218,7 +4264,7 @@ index a3bb111..64976ec 100755 + repoq.preconf.root = opts.installroot + try: + repoq.conf -+ except YumBaseError, e: ++ except yum.Errors.YumBaseError, e: + repoq.logger.error(e) + sys.exit(1) + @@ -3238,7 +4284,7 @@ index a3bb111..64976ec 100755 if opts.repofrompath: # setup the fake repos -@@ -1327,8 +1443,13 @@ def main(args): +@@ -1327,8 +1442,13 @@ def main(args): else: baseurl = repopath @@ -3254,7 +4300,7 @@ index a3bb111..64976ec 100755 if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) -@@ -1359,6 +1480,13 @@ def main(args): +@@ -1359,6 +1479,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -3268,7 +4314,7 @@ index a3bb111..64976ec 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1380,6 +1508,14 @@ def main(args): +@@ -1380,6 +1507,14 @@ def main(args): for repo in repoq.repos.findRepos(repo_match): repo.enable() @@ -3283,17 +4329,15 @@ index a3bb111..64976ec 100755 try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) -@@ -1396,10 +1532,15 @@ def main(args): +@@ -1396,10 +1531,12 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) + try: repoq.runQuery(regexs) -+ except yum.Errors.RepoError, e: -+ repoq.logger.error(e) -+ sys.exit(1) - except queryError, e: +- except queryError, e: ++ except (yum.Errors.RepoError, yum.Errors.MiscError, queryError), e: repoq.logger.error(e) + sys.exit(1) @@ -3851,7 +4895,7 @@ index d7a37c3..b9e682a 100755 for d in rpm.ds(spec.sourceHeader, 'requires'): buildreqs.append(d.DNEVR()[2:]) diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py -index c5074ab..3a9f305 100755 +index c5074ab..6b01e4e 100755 --- a/yum-complete-transaction.py +++ b/yum-complete-transaction.py @@ -8,11 +8,11 @@ @@ -3869,7 +4913,15 @@ index c5074ab..3a9f305 100755 import sys sys.path.insert(0,'/usr/share/yum-cli') -@@ -93,7 +93,7 @@ except ImportError: +@@ -21,6 +21,7 @@ import yum + from yum.misc import setup_locale + + from utils import YumUtilBase ++from yum.constants import TS_REMOVE_STATES + + import logging + import os +@@ -93,7 +94,7 @@ except ImportError: return to_complete_items class YumCompleteTransaction(YumUtilBase): @@ -3878,7 +4930,7 @@ index c5074ab..3a9f305 100755 VERSION = '1.0' USAGE = """ yum-complete-transaction: completes unfinished yum transactions which occur due to error, failure -@@ -115,7 +115,8 @@ class YumCompleteTransaction(YumUtilBase): +@@ -115,7 +116,8 @@ class YumCompleteTransaction(YumUtilBase): else: self.optparser_grp = self.optparser self.addCmdOptions() @@ -3888,6 +4940,19 @@ index c5074ab..3a9f305 100755 def clean_up_ts_files(self, timestamp, path, disable=False): +@@ -203,6 +205,12 @@ class YumCompleteTransaction(YumUtilBase): + if action == 'erase': + (e, m, u) = self.rpmdb.matchPackageNames([pkgspec]) + for pkg in e: ++ pkgtuple = (pkg.name, pkg.arch, pkg.epoch, pkg.ver, pkg.rel) ++ # Skip processing if already marked as the one to be removed. ++ # This will elimate issue with tx_member removal when package ++ # marked as: 'ud' out of of "install" journal's entry ++ if self.tsInfo.getMembersWithState(pkgtuple, TS_REMOVE_STATES): ++ continue + self.remove(po=pkg) + + diff --git a/yum-config-manager.py b/yum-config-manager.py index 50f5123..08c17db 100755 --- a/yum-config-manager.py @@ -4285,7 +5350,7 @@ index 1d37231..65bff76 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..6d6d699 100644 +index ce7fb64..de6fbfd 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -4345,7 +5410,28 @@ index ce7fb64..6d6d699 100644 %package -n yum-plugin-merge-conf Summary: Yum plugin to merge configuration changes when installing packages -@@ -290,7 +288,7 @@ This plugin allows the user to run arbitrary actions immediately following a +@@ -157,20 +155,6 @@ This yum plugin adds the "--merge-conf" command line option. With this option, + Yum will ask you what to do with config files which have changed on updating a + package. + +-%package -n yum-plugin-security +-Summary: Yum plugin to enable security filters +-Group: System Environment/Base +-Provides: yum-security = %{version}-%{release} +-Obsoletes: yum-security < 1.1.20-0 +-Conflicts: yum-security < 1.1.20-0 +-Requires: yum >= 3.2.18 +- +-%description -n yum-plugin-security +-This plugin adds the options --security, --cve, --bz and --advisory flags +-to yum and the list-security and info-security commands. +-The options make it possible to limit list/upgrade of packages to specific +-security relevant ones. The commands give you the security information. +- + %package -n yum-plugin-upgrade-helper + Summary: Yum plugin to help upgrades to the next distribution version + Group: System Environment/Base +@@ -290,7 +274,7 @@ This plugin allows the user to run arbitrary actions immediately following a transaction when specified packages are changed. %package -n yum-NetworkManager-dispatcher @@ -4354,7 +5440,7 @@ index ce7fb64..6d6d699 100644 Group: System Environment/Base Requires: yum >= 3.2.17 -@@ -352,6 +350,7 @@ repo. removes it (and can thus. be reinstalled/downgraded/etc.). +@@ -352,6 +336,7 @@ repo. removes it (and can thus. be reinstalled/downgraded/etc.). Summary: Yum plugin to automatically snapshot your filesystems during updates Group: System Environment/Base Requires: yum >= 3.2.22 @@ -4362,7 +5448,7 @@ index ce7fb64..6d6d699 100644 %description -n yum-plugin-fs-snapshot When this plugin is installed it will automatically snapshot any -@@ -395,9 +394,7 @@ plugins="\ +@@ -395,11 +380,8 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -4370,9 +5456,11 @@ index ce7fb64..6d6d699 100644 priorities \ - refresh-updatesd \ merge-conf \ - security \ +- security \ upgrade-helper \ -@@ -418,14 +415,20 @@ plugins="\ + aliases \ + list-data \ +@@ -418,14 +400,20 @@ plugins="\ puppetverify \ " @@ -4396,7 +5484,7 @@ index ce7fb64..6d6d699 100644 done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ -@@ -469,8 +472,8 @@ fi +@@ -469,8 +457,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -4406,7 +5494,7 @@ index ce7fb64..6d6d699 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,10 +490,19 @@ fi +@@ -487,10 +475,19 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -4426,7 +5514,7 @@ index ce7fb64..6d6d699 100644 %files -n yum-updateonboot %defattr(-, root, root) -@@ -502,7 +514,7 @@ fi +@@ -502,7 +499,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING @@ -4435,7 +5523,7 @@ index ce7fb64..6d6d699 100644 %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* -@@ -510,20 +522,20 @@ fi +@@ -510,20 +507,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf @@ -4459,7 +5547,7 @@ index ce7fb64..6d6d699 100644 %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* -@@ -531,85 +543,81 @@ fi +@@ -531,85 +528,74 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf @@ -4493,15 +5581,14 @@ index ce7fb64..6d6d699 100644 %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf -/usr/lib/yum-plugins/merge-conf.* -+%{pluginhome}/merge-conf.* - - %files -n yum-plugin-security - %defattr(-, root, root) - %doc COPYING - %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/security.conf +- +-%files -n yum-plugin-security +-%defattr(-, root, root) +-%doc COPYING +-%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/security.conf -/usr/lib/yum-plugins/security.* -+%{pluginhome}/security.* - %{_mandir}/man8/yum-security.8.* +-%{_mandir}/man8/yum-security.8.* ++%{pluginhome}/merge-conf.* %files -n yum-plugin-upgrade-helper %defattr(-, root, root) @@ -4559,7 +5646,7 @@ index ce7fb64..6d6d699 100644 %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) -@@ -619,13 +627,13 @@ fi +@@ -619,13 +605,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING @@ -4575,7 +5662,7 @@ index ce7fb64..6d6d699 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. -@@ -634,19 +642,19 @@ fi +@@ -634,19 +620,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING @@ -4598,7 +5685,7 @@ index ce7fb64..6d6d699 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -@@ -654,13 +662,13 @@ fi +@@ -654,13 +640,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf @@ -4614,7 +5701,7 @@ index ce7fb64..6d6d699 100644 %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* -@@ -668,13 +676,13 @@ fi +@@ -668,13 +654,13 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf diff --git a/yum-utils.spec b/yum-utils.spec index ffa44e6..0bfb765 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 18%{?dist} +Release: 19%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -155,20 +155,6 @@ This yum plugin adds the "--merge-conf" command line option. With this option, Yum will ask you what to do with config files which have changed on updating a package. -%package -n yum-plugin-security -Summary: Yum plugin to enable security filters -Group: System Environment/Base -Provides: yum-security = %{version}-%{release} -Obsoletes: yum-security < 1.1.20-0 -Conflicts: yum-security < 1.1.20-0 -Requires: yum >= 3.2.18 - -%description -n yum-plugin-security -This plugin adds the options --security, --cve, --bz and --advisory flags -to yum and the list-security and info-security commands. -The options make it possible to limit list/upgrade of packages to specific -security relevant ones. The commands give you the security information. - %package -n yum-plugin-upgrade-helper Summary: Yum plugin to help upgrades to the next distribution version Group: System Environment/Base @@ -396,7 +382,6 @@ plugins="\ tsflags \ priorities \ merge-conf \ - security \ upgrade-helper \ aliases \ list-data \ @@ -565,13 +550,6 @@ fi %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf %{pluginhome}/merge-conf.* -%files -n yum-plugin-security -%defattr(-, root, root) -%doc COPYING -%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/security.conf -%{pluginhome}/security.* -%{_mandir}/man8/yum-security.8.* - %files -n yum-plugin-upgrade-helper %defattr(-, root, root) %doc COPYING @@ -685,6 +663,18 @@ fi %{pluginhome}/puppetverify.* %changelog +* Fri Dec 13 2013 Zdenek Pavlas - 1.1.31-19 +- Update to latest HEAD +- Don't remove pkgs which are already removals (Eg. via. updates). BZ 1013475. +- remove yum-plugin-security. BZ 1002491 +- repoquery: handle MiscError. BZ 808500 +- repoquery: handle Yum exceptions on .conf setup. BZ 996027, 982043 +- needs-restarting: don't trigger abrt on repo errors. BZ 1017600 +- repoquery --whatrequires/--whatprovides: handle MiscError. BZ 1024783 +- fastestmirror: Less verbose mirror filtering. BZ 1036121 +- Remove -v from repoquery man page. +- repoquery -i: Add License. BZ 1040478 + * Fri Sep 27 2013 Zdenek Pavlas - 1.1.31-18 - Update to latest HEAD - repoquery: handle Yum exceptions on .conf setup. BZ 996027 From dc7481d0bd002b3dbec9c4f2a9a374d06577167b Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Fri, 10 Jan 2014 11:39:33 +0100 Subject: [PATCH 17/55] Update to latest HEAD - post-transaction-actions: no rpmdb lookup of removed pkgs. BZ 1045494 - yum-config-manager: Fail grecefully with garbage in *.repo files. BZ 1046161 - repodiff: Use "C" locale for timestamps. BZ 1050885 --- yum-utils-HEAD.patch | 65 +++++++++++++++++++++++++++++++++++++------- yum-utils.spec | 8 +++++- 2 files changed, 62 insertions(+), 11 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 879f5a4..d4c6984 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -2454,6 +2454,23 @@ index c45a1ce..cab69c5 100644 return conf_fname = '/etc/yum.repos.d/_local.repo' +diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py +index b4da1ce..a9759ff 100644 +--- a/plugins/post-transaction-actions/post-transaction-actions.py ++++ b/plugins/post-transaction-actions/post-transaction-actions.py +@@ -129,9 +129,10 @@ def posttrans_hook(conduit): + + for txmbr in pkgset: + matched = False +- #print '%s - %s' % txmbr.name, txmbr.ts_state +- if txmbr.po.state in TS_INSTALL_STATES: ++ if txmbr.output_state in TS_INSTALL_STATES: + thispo = _get_installed_po(rpmdb, txmbr.pkgtup) ++ else: ++ continue + + if not yum.misc.re_glob(a_k): + if a_k in thispo.filelist + thispo.dirlist + thispo.ghostlist: diff --git a/plugins/priorities/priorities.py b/plugins/priorities/priorities.py index 202c203..ce98583 100644 --- a/plugins/priorities/priorities.py @@ -3617,7 +3634,7 @@ index e710d8c..f895f84 100755 - + sys.exit(2) diff --git a/repodiff.py b/repodiff.py -index 67c162e..21be5af 100755 +index 67c162e..5ae1d8f 100755 --- a/repodiff.py +++ b/repodiff.py @@ -10,8 +10,8 @@ @@ -3749,7 +3766,9 @@ index 67c162e..21be5af 100755 - if opts.simple: - if opts.compare_arch: - msg = "%s: %s -> %s" % (pkg.name, oldpkg, pkg) -- else: ++ if opts.downgrade: ++ up_sizechange += sizechange + else: - msg = "%s: %s-%s-%s -> %s-%s-%s" % (pkg.name, oldpkg.name, - oldpkg.ver, oldpkg.rel, - pkg.name, pkg.ver, @@ -3757,9 +3776,7 @@ index 67c162e..21be5af 100755 - else: - if opts.compare_arch: - msg = "%s" % pkg -+ if opts.downgrade: -+ up_sizechange += sizechange - else: +- else: - msg = "%s-%s-%s" % (pkg.name, pkg.ver, pkg.rel) - dashes = "-" * len(msg) - msg += "\n%s\n" % dashes @@ -3806,7 +3823,7 @@ index 67c162e..21be5af 100755 if (not ygh.add and not ygh.remove and not ygh.modified and not my.pkgSack.searchNevra(arch='src')): -@@ -294,11 +339,34 @@ def main(args): +@@ -294,28 +339,36 @@ def main(args): print '\nSummary:' print 'Added Packages: %s' % len(ygh.add) print 'Removed Packages: %s' % len(ygh.remove) @@ -3845,6 +3862,24 @@ index 67c162e..21be5af 100755 if __name__ == "__main__": +- # This test needs to be before locale.getpreferredencoding() as that +- # does setlocale(LC_CTYPE, "") +- try: +- locale.setlocale(locale.LC_ALL, '') +- except locale.Error, e: +- # default to C locale if we get a failure. +- print >> sys.stderr, 'Failed to set locale, defaulting to C' +- os.environ['LC_ALL'] = 'C' +- locale.setlocale(locale.LC_ALL, 'C') +- +- if True: # not sys.stdout.isatty(): +- import codecs +- sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) +- sys.stdout.errors = 'replace' +- ++ yum.misc.setup_locale(override_time=True) + main(sys.argv[1:]) +- diff --git a/repomanage.py b/repomanage.py index ff77e0d..bef3b03 100755 --- a/repomanage.py @@ -4954,7 +4989,7 @@ index c5074ab..6b01e4e 100755 diff --git a/yum-config-manager.py b/yum-config-manager.py -index 50f5123..08c17db 100755 +index 50f5123..bc96b55 100755 --- a/yum-config-manager.py +++ b/yum-config-manager.py @@ -9,6 +9,8 @@ from utils import YumUtilBase @@ -4966,7 +5001,17 @@ index 50f5123..08c17db 100755 from yum.parser import varReplace -@@ -153,7 +155,7 @@ if (not args and not opts.addrepo) or 'main' in args: +@@ -122,7 +124,8 @@ group.add_option("--add-repo", default=[], dest='addrepo', action='append', + help='add (and enable) the repo from the specified file or url') + try: + opts = yb.doUtilConfigSetup() +-except yum.Errors.RepoError, e: ++ yb.repos ++except yum.Errors.YumBaseError, e: + logger.error(str(e)) + sys.exit(50) + +@@ -153,7 +156,7 @@ if (not args and not opts.addrepo) or 'main' in args: ybc = yb.conf writeRawConfigFile(fn, 'main', ybc.yumvar, ybc.cfg.options, ybc.iteritems, ybc.optionobj, @@ -4975,7 +5020,7 @@ index 50f5123..08c17db 100755 if opts.enable or opts.disable: opts.save = True -@@ -161,7 +163,8 @@ if opts.enable or opts.disable: +@@ -161,7 +164,8 @@ if opts.enable or opts.disable: only = ['enabled'] if args: @@ -4985,7 +5030,7 @@ index 50f5123..08c17db 100755 else: repos = yb.repos.listEnabled() -@@ -196,13 +199,16 @@ if opts.addrepo: +@@ -196,13 +200,16 @@ if opts.addrepo: if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it destname = os.path.basename(url) destname = myrepodir + '/' + destname diff --git a/yum-utils.spec b/yum-utils.spec index 0bfb765..b8214e2 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 19%{?dist} +Release: 20%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -663,6 +663,12 @@ fi %{pluginhome}/puppetverify.* %changelog +* Fri Jan 10 2014 Zdenek Pavlas - 1.1.31-20 +- Update to latest HEAD +- post-transaction-actions: no rpmdb lookup of removed pkgs. BZ 1045494 +- yum-config-manager: Fail grecefully with garbage in *.repo files. BZ 1046161 +- repodiff: Use "C" locale for timestamps. BZ 1050885 + * Fri Dec 13 2013 Zdenek Pavlas - 1.1.31-19 - Update to latest HEAD - Don't remove pkgs which are already removals (Eg. via. updates). BZ 1013475. From aa640e6f17bb4f6fa098a4d600055a2e8c98406d Mon Sep 17 00:00:00 2001 From: Zdenek Pavlas Date: Thu, 16 Jan 2014 10:54:04 +0100 Subject: [PATCH 18/55] Update to latest HEAD - completion: Fix file/dir completions for names containing spaces or tabs - post-transaction-actions: fix filename matching. BZ 1045494 - debuginfo-install: Adjust logic for debug repos in CDN. BZ 1052871 --- yum-utils-HEAD.patch | 118 ++++++++++++++++++++++++++++++++++++------- yum-utils.spec | 8 ++- 2 files changed, 106 insertions(+), 20 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index d4c6984..84ebf4f 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -140,7 +140,7 @@ index bc802f6..e9be2e4 100644 2008-08-04 James Antill diff --git a/debuginfo-install.py b/debuginfo-install.py -index 177c6c3..0f026f1 100755 +index 177c6c3..bb61a1d 100755 --- a/debuginfo-install.py +++ b/debuginfo-install.py @@ -7,11 +7,11 @@ @@ -172,7 +172,19 @@ index 177c6c3..0f026f1 100755 def doUtilConfigSetup(self, *args, **kwargs): """ We override this to get our extra option out. """ -@@ -117,6 +122,9 @@ class DebugInfoInstall(YumUtilBase): +@@ -81,7 +86,10 @@ class DebugInfoInstall(YumUtilBase): + for repo in self.repos.listEnabled(): + repos[repo.id] = repo + for repoid in repos: +- di = '%s-debuginfo' % repoid ++ if repoid.endswith('-rpms'): ++ di = repoid[:-5] + '-debug-rpms' ++ else: ++ di = '%s-debuginfo' % repoid + if di in repos: + continue + repo = repos[repoid] +@@ -117,6 +125,9 @@ class DebugInfoInstall(YumUtilBase): sys.exit(self.doUtilTransaction()) def di_try_install(self, po): @@ -182,7 +194,7 @@ index 177c6c3..0f026f1 100755 if po.name.endswith('-debuginfo'): # Wildcard matches produce this return di_name = '%s-debuginfo' % po.name -@@ -156,6 +164,10 @@ class DebugInfoInstall(YumUtilBase): +@@ -156,6 +167,10 @@ class DebugInfoInstall(YumUtilBase): self.di_try_install(deppo) except yum.Errors.InstallError, e: self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo) @@ -2455,22 +2467,22 @@ index c45a1ce..cab69c5 100644 conf_fname = '/etc/yum.repos.d/_local.repo' diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py -index b4da1ce..a9759ff 100644 +index b4da1ce..804af9c 100644 --- a/plugins/post-transaction-actions/post-transaction-actions.py +++ b/plugins/post-transaction-actions/post-transaction-actions.py -@@ -129,9 +129,10 @@ def posttrans_hook(conduit): +@@ -129,8 +129,10 @@ def posttrans_hook(conduit): for txmbr in pkgset: matched = False - #print '%s - %s' % txmbr.name, txmbr.ts_state - if txmbr.po.state in TS_INSTALL_STATES: ++ thispo = txmbr.po + if txmbr.output_state in TS_INSTALL_STATES: ++ # thispo is AvailablePackage; filelist access could trigger download ++ # of the filelist. Since it's installed now, use rpmdb data instead. thispo = _get_installed_po(rpmdb, txmbr.pkgtup) -+ else: -+ continue if not yum.misc.re_glob(a_k): - if a_k in thispo.filelist + thispo.dirlist + thispo.ghostlist: diff --git a/plugins/priorities/priorities.py b/plugins/priorities/priorities.py index 202c203..ce98583 100644 --- a/plugins/priorities/priorities.py @@ -5174,7 +5186,7 @@ index 8bfdbcd..250ebc9 100644 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software diff --git a/yum-utils.bash b/yum-utils.bash -index 1d37231..65bff76 100644 +index 1d37231..601e0d9 100644 --- a/yum-utils.bash +++ b/yum-utils.bash @@ -1,3 +1,6 @@ @@ -5184,7 +5196,23 @@ index 1d37231..65bff76 100644 # bash completion for yum-utils _yu_init_completion() -@@ -100,7 +103,7 @@ _yu_repo_graph() +@@ -34,6 +37,7 @@ _yu_repomanage() + return 0 + fi + ++ local IFS=$'\n' + COMPREPLY=( $( compgen -d -- "$cur" ) ) + } && + complete -F _yu_repomanage -o filenames repomanage repomanage.py +@@ -85,6 +89,7 @@ _yu_verifytree() + return 0 + fi + ++ local IFS=$'\n' + COMPREPLY=( $( compgen -d -- "$cur" ) ) + } && + complete -F _yu_verifytree -o filenames verifytree verifytree.py +@@ -100,10 +105,11 @@ _yu_repo_graph() return 0 ;; --repoid) @@ -5193,7 +5221,24 @@ index 1d37231..65bff76 100644 return 0 ;; -c) -@@ -136,7 +139,7 @@ _yu_repo_rss() ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) + return 0 + ;; +@@ -125,10 +131,12 @@ _yu_repo_rss() + return 0 + ;; + -f) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -X '!*.xml' -- "$cur" ) ) + return 0 + ;; + -c) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) + return 0 + ;; +@@ -136,7 +144,7 @@ _yu_repo_rss() COMPREPLY=( $( compgen -W '--help -f -l -t -d -r --tempcache -g -a -c' \ -- "$2" ) ) @@ -5202,7 +5247,12 @@ index 1d37231..65bff76 100644 } && complete -F _yu_repo_rss -o filenames repo-rss repo-rss.py -@@ -155,7 +158,7 @@ _yu_repoclosure() +@@ -151,11 +159,12 @@ _yu_repoclosure() + return 0 + ;; + -c|--config) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; -l|--lookaside|-r|--repoid) @@ -5211,7 +5261,7 @@ index 1d37231..65bff76 100644 return 0 ;; -p|--pkg) -@@ -163,7 +166,7 @@ _yu_repoclosure() +@@ -163,7 +172,7 @@ _yu_repoclosure() return 0 ;; -g|--group) @@ -5220,7 +5270,7 @@ index 1d37231..65bff76 100644 return 0 ;; esac -@@ -188,26 +191,23 @@ _yu_repoquery() +@@ -188,26 +197,24 @@ _yu_repoquery() done case $prev in @@ -5232,6 +5282,7 @@ index 1d37231..65bff76 100644 + return 0 + ;; + -f|--file) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -- "$cur" ) ) return 0 ;; @@ -5254,7 +5305,7 @@ index 1d37231..65bff76 100644 --grouppkgs) COMPREPLY=( $( compgen -W 'all default optional mandatory' \ -- "$cur" ) ) -@@ -219,38 +219,56 @@ _yu_repoquery() +@@ -219,38 +226,58 @@ _yu_repoquery() return 0 ;; --repoid) @@ -5273,6 +5324,7 @@ index 1d37231..65bff76 100644 return 0 ;; -c|--config) ++ local IFS=$'\n' COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) return 0 ;; @@ -5289,6 +5341,7 @@ index 1d37231..65bff76 100644 + return 0 + ;; + --installroot) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -d -- "$cur" ) ) + return 0 + ;; @@ -5323,7 +5376,20 @@ index 1d37231..65bff76 100644 } && complete -F _yu_repoquery -o filenames repoquery repoquery.py -@@ -278,8 +296,8 @@ _yu_yumdb() +@@ -265,10 +292,12 @@ _yu_yumdb() + return 0 + ;; + -c|--config) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -X '!*.conf' -- "$cur" ) ) + return 0 + ;; + shell) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -- "$cur" ) ) + return 0 + ;; +@@ -278,8 +307,8 @@ _yu_yumdb() if [ $COMP_CWORD -le 1 ] ; then COMPREPLY=( $( compgen -W 'get set del rename rename-force copy search @@ -5334,7 +5400,7 @@ index 1d37231..65bff76 100644 fi } && complete -F _yu_yumdb -o filenames yumdb yumdb.py -@@ -299,7 +317,7 @@ _yu_repodiff() +@@ -299,7 +328,7 @@ _yu_repodiff() $split && return 0 COMPREPLY=( $( compgen -W '--version --help --new --old --quiet --archlist @@ -5343,7 +5409,7 @@ index 1d37231..65bff76 100644 } && complete -F _yu_repodiff repodiff repodiff.py -@@ -311,6 +329,13 @@ _yu_builddep() +@@ -311,6 +340,13 @@ _yu_builddep() _yum_complete_baseopts "$cur" "$prev" && return 0 @@ -5357,7 +5423,20 @@ index 1d37231..65bff76 100644 $split && return 0 if [[ $cur == -* ]] ; then -@@ -363,6 +388,36 @@ _yu_debug_dump() +@@ -318,6 +354,7 @@ _yu_builddep() + return 0 + fi + ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -X "!*.spec" -- "$cur" ) ) + [[ $cur != */* && $cur != ~* ]] && _yum_list all "$cur" 2>/dev/null + } && +@@ -359,10 +396,42 @@ _yu_debug_dump() + return 0 + fi + ++ local IFS=$'\n' + COMPREPLY=( $( compgen -f -o plusdirs -- "$cur" ) ) } && complete -F _yu_debug_dump -o filenames yum-debug-dump yum-debug-dump.py @@ -5371,6 +5450,7 @@ index 1d37231..65bff76 100644 + + case $prev in + --destdir) ++ local IFS=$'\n' + COMPREPLY=( $( compgen -d -- "$cur" ) ) + return 0 + ;; diff --git a/yum-utils.spec b/yum-utils.spec index b8214e2..16c2634 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 20%{?dist} +Release: 21%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -663,6 +663,12 @@ fi %{pluginhome}/puppetverify.* %changelog +* Thu Jan 16 2014 Zdenek Pavlas - 1.1.31-21 +- Update to latest HEAD +- completion: Fix file/dir completions for names containing spaces or tabs +- post-transaction-actions: fix filename matching. BZ 1045494 +- debuginfo-install: Adjust logic for debug repos in CDN. BZ 1052871 + * Fri Jan 10 2014 Zdenek Pavlas - 1.1.31-20 - Update to latest HEAD - post-transaction-actions: no rpmdb lookup of removed pkgs. BZ 1045494 From 5cb07384fb977d6e9d8088cb083c1b6fa3da9b24 Mon Sep 17 00:00:00 2001 From: Valentina Mukhamedzhanova Date: Thu, 22 May 2014 15:56:18 +0200 Subject: [PATCH 19/55] Update to latest HEAD - yum-builddep: Use srpms in already enabled repos. BZ 1024070 - yumdownloader: use stock doUtilYumSetup(). - yum-builddep: Note spec support in man page. - yum-builddep: Complete on local source RPMs. BZ 884303 - Fix 'reposync -r nosuchrepo' behaviour. BZ 1060702 - Fix description of --archlist in the manpage and help. BZ 1045871 - Make using needs-restarting as non-root more clear. BZ 754169 - Remove 'yum-installed' from yum-utils man page. - Fix calculation of process start time in needs-restarting. - Fix reposync using old cache af non-root user. BZ 1079387. - Add i18n to reposync. - Fix --verify-configuration-files help string to make its usage clearer. - Print depsolving errors in yumdownloader instead of ignoring them. BZ 998892 - Fix filename parsing in get_open_files(). BZ 1078724 - Handle IOErrors in needs-restarting if the process is already over. - Fix --save when --setopt contains wildcards. BZ 1097297 --- yum-utils-HEAD.patch | 609 ++++++++++++++++++++++++++++++++++--------- yum-utils.spec | 23 +- 2 files changed, 509 insertions(+), 123 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 84ebf4f..e33cea4 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -1042,7 +1042,7 @@ index c0f148d..62fae3e 100644 diff --git a/docs/yum-builddep.1 b/docs/yum-builddep.1 -index 4e6c1d7..ac7601e 100644 +index 4e6c1d7..6cad8a6 100644 --- a/docs/yum-builddep.1 +++ b/docs/yum-builddep.1 @@ -1,7 +1,7 @@ @@ -1054,6 +1054,15 @@ index 4e6c1d7..ac7601e 100644 .SH "SYNOPSIS" \fByum-builddep\fP package .SH "DESCRIPTION" +@@ -9,7 +9,7 @@ yum-builddep + \fByum-builddep\fP is a program which installs the RPMs needed to build + the specified package. The source RPM for the specified package must + be available in a Yum repository (which will be automatically enabled, if it is +-disabled) or it can be a local source RPM file. ++disabled) or it can be a local source RPM or a spec file. + .PP + .SH "EXAMPLES" + .IP "Download and install all the RPMs needed to build the kernel RPM:" diff --git a/docs/yum-changelog.1 b/docs/yum-changelog.1 index 64910dc..c7b5486 100644 --- a/docs/yum-changelog.1 @@ -1673,10 +1682,10 @@ index 7e260b0..0000000 - -The main "problem" is that if the data is not correct the plugin cannot work correctly. For instance "--bz 123" will not fix BZ 123 if a package is updated to fix that BZ without referencing that it does so in the updateinfo.xml. diff --git a/docs/yum-utils.1 b/docs/yum-utils.1 -index fa830b6..3f858a8 100644 +index fa830b6..b4fadb2 100644 --- a/docs/yum-utils.1 +++ b/docs/yum-utils.1 -@@ -15,8 +15,9 @@ yum\-utils \- tools for manipulating repositories and extended package managemen +@@ -15,15 +15,15 @@ yum\-utils \- tools for manipulating repositories and extended package managemen \fBrepoquery\fR \- query yum repositories and get additional information on the them \fBreposync\fR \- synchronize a remote yum repository to a local directory using yum to retrieve packages \fBrepotrack\fR \- track packages and its dependencies and downloads them @@ -1687,7 +1696,14 @@ index fa830b6..3f858a8 100644 \fByum\-builddep\fR \- installs missing dependencies to build a specified package \fByum\-complete\-transaction\fR \- finds incomplete or aborted yum transactions and attempts to complete them \fByum\-config\-manager\fR \- toggle yum repositories, add new repositories and set main yum configuration options -@@ -32,6 +33,6 @@ is a collection of tools and programs for managing yum repositories, installing + \fByum\-debug\-dump\fR \- creates gzipped file containing information for debugging problems + \fByum\-debug\-restore\fR \- replays any transactions captured in gzipped file in yum shell + \fByum\-groups\-manager\fR \- create and edit yum's group metadata +-\fByum\-installed\fR \- print a compact package list making use of comps groups + \fByumdb\fR \- query or alter the yum database + \fByumdownloader\fR \- downloads packages from yum repositories including source RPMs + .SH "DESCRIPTION" +@@ -32,6 +32,6 @@ is a collection of tools and programs for managing yum repositories, installing .SH "NOTES" See respective tools for additional help for commands without a manual page .SH "SEE ALSO" @@ -1804,7 +1820,7 @@ index 63a3c6b..600a3a9 100644 \fByumdb\fP [command] [packages ...] .SH "DESCRIPTION" diff --git a/docs/yumdownloader.1 b/docs/yumdownloader.1 -index a8a3b16..e290268 100644 +index a8a3b16..d2cb276 100644 --- a/docs/yumdownloader.1 +++ b/docs/yumdownloader.1 @@ -1,7 +1,7 @@ @@ -1816,6 +1832,15 @@ index a8a3b16..e290268 100644 .SH "SYNOPSIS" \fByumdownloader\fP [options] package1 [package2...] .SH "DESCRIPTION" +@@ -20,7 +20,7 @@ When downloading RPMs, resolve dependencies and also download the required packa + .IP "\fB\-\-source\fP" + Instead of downloading the binary RPMs, download the source RPMs. + .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" +-Limit the query to packages of given architecture(s). Valid values are all ++Limit the query to packages of given and compatible architectures. Valid values are all + architectures known to rpm/yum such as 'i386' and 'src' for + source RPMS. Note that repoquery will now change yum's "arch" to the first + value in the archlist. So "\-\-archlist=i386,i686" will change yum's canonical @@ -31,9 +31,9 @@ for more information .SH "EXAMPLES" @@ -1848,7 +1873,7 @@ index 0578295..aac29ea 100644 import sys diff --git a/needs-restarting.py b/needs-restarting.py -index 6bc883f..d92cd46 100755 +index 6bc883f..d26ac42 100755 --- a/needs-restarting.py +++ b/needs-restarting.py @@ -8,11 +8,11 @@ @@ -1866,7 +1891,7 @@ index 6bc883f..d92cd46 100755 # Copyright 2009 Red Hat Inc # written by Seth Vidal -@@ -40,9 +40,11 @@ +@@ -40,9 +40,13 @@ import sys import os import yum @@ -1875,15 +1900,14 @@ index 6bc883f..d92cd46 100755 import stat from optparse import OptionParser +from yum.Errors import RepoError ++sys.path.insert(0,'/usr/share/yum-cli') ++import utils def parseargs(args): usage = """ -@@ -76,18 +78,18 @@ def get_open_files(pid): - files = [] - smaps = '/proc/%s/smaps' % pid +@@ -78,56 +82,90 @@ def get_open_files(pid): try: -- maps = open(smaps, 'r') -+ maps = open(smaps, 'r').readlines() + maps = open(smaps, 'r') except (IOError, OSError), e: - print "Could not open %s" % smaps + print >>sys.stderr, "Could not open %s" % smaps @@ -1899,20 +1923,43 @@ index 6bc883f..d92cd46 100755 - slash = line.find('/') filename = line[slash:] - filename = filename.replace('(deleted)', '') #only mildly retarded -+ #filename = filename.replace('(deleted)', '') #only mildly retarded ++ filename = filename.split(';')[0] filename = filename.strip() if filename not in files: files.append(filename) -@@ -106,7 +108,7 @@ def main(args): - if opts.useronly: - myuid = os.getuid() ++ maps.close() + return files + + def main(args): + (opts, args) = parseargs(args) + ++ myuid = os.geteuid() ++ if myuid and not opts.useronly: ++ print >>sys.stderr, "Please run as root or with --useronly option" ++ sys.exit(1) ++ + my = yum.YumBase() + my.preconf.init_plugins=False + if hasattr(my, 'setCacheDir'): + my.setCacheDir() + my.conf.cache = True +- myuid = None +- if opts.useronly: +- myuid = os.getuid() +- - needing_restart = [] + needing_restart = set() ++ boot_time = utils.get_boot_time() for pid in return_running_pids(uid=myuid): try: -@@ -117,17 +119,48 @@ def main(args): +- pid_start = os.stat('/proc/' + pid)[stat.ST_CTIME] +- except OSError, e: ++ pid_start = utils.get_process_time(int(pid), boot_time)['start_time'] ++ except (OSError, IOError), e: + continue + found_match = False for fn in get_open_files(pid): if found_match: break @@ -1965,7 +2012,7 @@ index 6bc883f..d92cd46 100755 continue # proc cmdline is null-delimited so clean that up cmdline = cmdline.replace('\000', ' ') -@@ -136,4 +169,8 @@ def main(args): +@@ -136,4 +174,8 @@ def main(args): return 0 if __name__ == "__main__": @@ -2239,7 +2286,7 @@ index 3a67c69..9ada717 100644 [lvm] enabled = 0 diff --git a/plugins/fs-snapshot/fs-snapshot.py b/plugins/fs-snapshot/fs-snapshot.py -index 5094881..786b0c1 100644 +index 5094881..5761e76 100644 --- a/plugins/fs-snapshot/fs-snapshot.py +++ b/plugins/fs-snapshot/fs-snapshot.py @@ -21,7 +21,7 @@ This plugin creates a snapshot before any yum update or yum remove operation on @@ -2261,25 +2308,16 @@ index 5094881..786b0c1 100644 def inspect_volume_lvm(conduit, volume): """ If volume is an LVM logical volume: -@@ -79,25 +82,28 @@ def inspect_volume_lvm(conduit, volume): - if device.startswith("/dev/mapper/"): +@@ -80,7 +83,7 @@ def inspect_volume_lvm(conduit, volume): # convert /dev/mapper name to /dev/vg/lv for use with LVM2 tools # - 'dmsetup splitname' will collapse any escaped characters -- p = Popen(["/sbin/dmsetup", "splitname", "--separator", "/", + p = Popen(["/sbin/dmsetup", "splitname", "--separator", "/", - "--noheadings", -- "-o", "vg_name,lv_name", device], stdout=PIPE, stderr=PIPE) -+ p = Popen(["/sbin/dmsetup", "splitname", "--separator", " ", + "--noheadings", "-c", -+ device], stdout=PIPE, stderr=PIPE) + "-o", "vg_name,lv_name", device], stdout=PIPE, stderr=PIPE) err = p.wait() if err: - return 0 - output = p.communicate()[0] -- device = output.strip().replace("/dev/mapper/", "/dev/") -+ device = "/".join(output.split()[:2]) -+ device = device.replace("/dev/mapper/", "/dev/") - volume["device"] = device - +@@ -92,12 +95,14 @@ def inspect_volume_lvm(conduit, volume): # Check if device is managed by lvm # - FIXME filter out snapshot (and other) LVs; for now just rely # on 'lvcreate' to prevent snapshots of unsupported LV types @@ -2296,7 +2334,7 @@ index 5094881..786b0c1 100644 conduit.error(1, "fs-snapshot: skipping volume: %s, " "kernel doesn't support snapshot-merge" % device) return 0 -@@ -192,9 +198,8 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): +@@ -192,9 +197,8 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): """ Runs the commands necessary for a snapshot. Basically its just @@ -2308,7 +2346,7 @@ index 5094881..786b0c1 100644 and then we're done. """ -@@ -206,16 +211,24 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): +@@ -206,16 +210,24 @@ def _create_btrfs_snapshot(conduit, snapshot_tag, volume): snapname = mntpnt + snapshot_tag conduit.info(1, "fs-snapshot: snapshotting " + mntpnt + ": " + snapname) @@ -2335,7 +2373,7 @@ index 5094881..786b0c1 100644 def _create_lvm_snapshot(conduit, snapshot_tag, volume): """ Create LVM snapshot LV and tag it with $snapshot_tag. -@@ -223,16 +236,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -223,16 +235,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): has enough free space to accommodate a snapshot LV. - Also assumes user has configured 'lvcreate_size_args'. """ @@ -2363,7 +2401,7 @@ index 5094881..786b0c1 100644 device = volume["device"] if device.count('/') != 3: -@@ -259,7 +274,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -259,7 +273,8 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): (mntpnt, device, snap_lvname)) # Create snapshot LV lvcreate_cmd = ["/sbin/lvcreate", "-s", "-n", snap_lvname] @@ -2373,7 +2411,7 @@ index 5094881..786b0c1 100644 lvcreate_cmd.append(device) p = Popen(lvcreate_cmd, stdout=PIPE, stderr=PIPE) err = p.wait() -@@ -270,16 +286,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): +@@ -270,16 +285,18 @@ def _create_lvm_snapshot(conduit, snapshot_tag, volume): # Add tag ($snapshot_tag) to snapshot LV # - should help facilitate merge of all snapshot LVs created # by a yum transaction, e.g.: lvconvert --merge @snapshot_tag @@ -2399,7 +2437,7 @@ index 5094881..786b0c1 100644 """ This runs before the transaction starts. Try to snapshot anything and everything that is snapshottable, since we do not know what an RPM will -@@ -287,6 +305,10 @@ def pretrans_hook(conduit): +@@ -287,6 +304,10 @@ def pretrans_hook(conduit): """ # common snapshot tag format: yum_${year}${month}${day}${hour}${minute}${sec} snapshot_tag = "yum_" + time.strftime("%Y%m%d%H%M%S") @@ -2410,7 +2448,7 @@ index 5094881..786b0c1 100644 volumes = get_volumes(conduit) for volume in volumes: -@@ -296,3 +318,13 @@ def pretrans_hook(conduit): +@@ -296,3 +317,13 @@ def pretrans_hook(conduit): elif rc == 2 and hasattr(conduit, 'registerPackageName'): # A snapshot was successfully created conduit.registerPackageName("yum-plugin-fs-snapshot") @@ -2507,6 +2545,19 @@ index 202c203..ce98583 100644 def _pkglist_to_dict(pl, priority, addArch = False): out = dict() +diff --git a/plugins/ps/ps.py b/plugins/ps/ps.py +index b89f04c..918a269 100644 +--- a/plugins/ps/ps.py ++++ b/plugins/ps/ps.py +@@ -61,7 +61,7 @@ class PSCommand: + return ['ps'] + + def getUsage(self): +- return "[all|updates|restart] [pkgs...]" ++ return "[all|updates|restarts] [pkgs...]" + + def getSummary(self): + return "List processes, which are packages" diff --git a/plugins/security/security.conf b/plugins/security/security.conf deleted file mode 100644 index 8e4d76c..0000000 @@ -3435,6 +3486,16 @@ index e60dd4d..ec51f5b 100644 pgpgcheck, rgpgcheck = rpgpgcheck, rrgpgcheck if repomd.startswith("file:"): pgpgcheck, rgpgcheck = lpgpgcheck, lrgpgcheck +diff --git a/plugins/verify/verify.py b/plugins/verify/verify.py +index 46a0368..108f96e 100644 +--- a/plugins/verify/verify.py ++++ b/plugins/verify/verify.py +@@ -451,4 +451,4 @@ def config_hook(conduit): + + parser.add_option('--verify-configuration-files', action="store", + type="string", +- help='Verify files tagged as configuration files') ++ help='Enable/disable verification of files tagged as configuration files') diff --git a/plugins/versionlock/versionlock.py b/plugins/versionlock/versionlock.py index 40756b2..dfe4dd3 100644 --- a/plugins/versionlock/versionlock.py @@ -4391,7 +4452,7 @@ index a3bb111..2390e79 100755 if __name__ == "__main__": misc.setup_locale() diff --git a/reposync.py b/reposync.py -index 7950854..b1ee285 100755 +index 7950854..6500db6 100755 --- a/reposync.py +++ b/reposync.py @@ -11,8 +11,8 @@ @@ -4405,7 +4466,16 @@ index 7950854..b1ee285 100755 # copyright 2006 Duke University # author seth vidal -@@ -47,7 +47,7 @@ from yum.constants import * +@@ -40,26 +40,16 @@ import stat + from optparse import OptionParser + from urlparse import urljoin + ++from yumutils.i18n import _ ++ + import yum + import yum.Errors +-from yum.misc import getCacheDir +-from yum.constants import * from yum.packageSack import ListPackageSack import rpmUtils.arch import logging @@ -4413,24 +4483,131 @@ index 7950854..b1ee285 100755 +from urlgrabber.progress import TextMeter, TextMultiFileMeter import urlgrabber - # for yum 2.4.X compat -@@ -96,7 +96,7 @@ def parseArgs(): +-# for yum 2.4.X compat +-def sortPkgObj(pkg1 ,pkg2): +- """sorts a list of yum package objects by name""" +- if pkg1.name > pkg2.name: +- return 1 +- elif pkg1.name == pkg2.name: +- return 0 +- else: +- return -1 +- + class RepoSync(yum.YumBase): + def __init__(self, opts): + yum.YumBase.__init__(self) +@@ -81,69 +71,69 @@ def localpkgs(directory): + for pkg in subcache.keys(): + cache[pkg] = subcache[pkg] + elif stat.S_ISREG(st.st_mode) and name.endswith(".rpm"): +- cache[name] = { 'path': fn, 'size': st.st_size, 'device': st.st_dev } ++ cache[name] = {'path': fn, 'size': st.st_size, 'device': st.st_dev} + return cache + + def parseArgs(): +- usage = """ ++ usage = _(""" + Reposync is used to synchronize a remote yum repository to a local + directory using yum to retrieve the packages. + + %s [options] +- """ % sys.argv[0] ++ """) % sys.argv[0] + + parser = OptionParser(usage=usage) parser.add_option("-c", "--config", default='/etc/yum.conf', - help='config file to use (defaults to /etc/yum.conf)') +- help='config file to use (defaults to /etc/yum.conf)') ++ help=_('config file to use (defaults to /etc/yum.conf)')) parser.add_option("-a", "--arch", default=None, - help='act as if running the specified arch (default: current arch, note: does not override $releasever)') -+ help='act as if running the specified arch (default: current arch, note: does not override $releasever. x86_64 is a superset for i*86.)') ++ help=_('act as if running the specified arch (default: current arch, note: does not override $releasever. x86_64 is a superset for i*86.)')) parser.add_option("--source", default=False, dest="source", action="store_true", - help='operate on source packages') +- help='operate on source packages') ++ help=_('operate on source packages')) parser.add_option("-r", "--repoid", default=[], action='append', -@@ -153,15 +153,27 @@ def main(): +- help="specify repo ids to query, can be specified multiple times (default is all enabled)") ++ help=_("specify repo ids to query, can be specified multiple times (default is all enabled)")) + parser.add_option("-e", "--cachedir", +- help="directory in which to store metadata") +- parser.add_option("-t", "--tempcache", default=False, action="store_true", +- help="Use a temp dir for storing/accessing yum-cache") ++ help=_("directory in which to store metadata")) ++ parser.add_option("-t", "--tempcache", default=False, action="store_true", ++ help=_("Use a temp dir for storing/accessing yum-cache")) + parser.add_option("-d", "--delete", default=False, action="store_true", +- help="delete local packages no longer present in repository") +- parser.add_option("-p", "--download_path", dest='destdir', +- default=os.getcwd(), help="Path to download packages to: defaults to current dir") ++ help=_("delete local packages no longer present in repository")) ++ parser.add_option("-p", "--download_path", dest='destdir', ++ default=os.getcwd(), help=_("Path to download packages to: defaults to current dir")) + parser.add_option("--norepopath", dest='norepopath', default=False, action="store_true", +- help="Don't add the reponame to the download path. Can only be used when syncing a single repository (default is to add the reponame)") ++ help=_("Don't add the reponame to the download path. Can only be used when syncing a single repository (default is to add the reponame)")) + parser.add_option("-g", "--gpgcheck", default=False, action="store_true", +- help="Remove packages that fail GPG signature checking after downloading") +- parser.add_option("-u", "--urls", default=False, action="store_true", +- help="Just list urls of what would be downloaded, don't download") +- parser.add_option("-n", "--newest-only", dest='newest', default=False, action="store_true", +- help="Download only newest packages per-repo") +- parser.add_option("-q", "--quiet", default=False, action="store_true", +- help="Output as little as possible") +- parser.add_option("-l", "--plugins", default=False, action="store_true", +- help="enable yum plugin support") ++ help=_("Remove packages that fail GPG signature checking after downloading")) ++ parser.add_option("-u", "--urls", default=False, action="store_true", ++ help=_("Just list urls of what would be downloaded, don't download")) ++ parser.add_option("-n", "--newest-only", dest='newest', default=False, action="store_true", ++ help=_("Download only newest packages per-repo")) ++ parser.add_option("-q", "--quiet", default=False, action="store_true", ++ help=_("Output as little as possible")) ++ parser.add_option("-l", "--plugins", default=False, action="store_true", ++ help=_("enable yum plugin support")) + parser.add_option("-m", "--downloadcomps", default=False, action="store_true", +- help="also download comps.xml") +- parser.add_option("","--download-metadata", dest="downloadmd", +- default=False, action="store_true", +- help="download all the non-default metadata") ++ help=_("also download comps.xml")) ++ parser.add_option("", "--download-metadata", dest="downloadmd", ++ default=False, action="store_true", ++ help=_("download all the non-default metadata")) + (opts, args) = parser.parse_args() + return (opts, args) + + + def main(): +- (opts, junk) = parseArgs() +- ++ (opts, dummy) = parseArgs() ++ + if not os.path.exists(opts.destdir) and not opts.urls: + try: + os.makedirs(opts.destdir) + except OSError, e: +- print >> sys.stderr, "Error: Cannot create destination dir %s" % opts.destdir ++ print >> sys.stderr, _("Error: Cannot create destination dir %s") % opts.destdir + sys.exit(1) +- ++ + if not os.access(opts.destdir, os.W_OK) and not opts.urls: +- print >> sys.stderr, "Error: Cannot write to destination dir %s" % opts.destdir ++ print >> sys.stderr, _("Error: Cannot write to destination dir %s") % opts.destdir + sys.exit(1) +- ++ + my = RepoSync(opts=opts) + my.doConfigSetup(fn=opts.config, init_plugins=opts.plugins) + +@@ -153,52 +143,66 @@ def main(): opts.tempcache = True if opts.tempcache: - cachedir = getCacheDir() - if cachedir is None: -+ if not my.setCacheDir(force=True): - print >> sys.stderr, "Error: Could not make cachedir, exiting" +- print >> sys.stderr, "Error: Could not make cachedir, exiting" ++ if not my.setCacheDir(force=True, reuse=False): ++ print >> sys.stderr, _("Error: Could not make cachedir, exiting") sys.exit(50) - - my.repos.setCacheDir(cachedir) @@ -4443,7 +4620,7 @@ index 7950854..b1ee285 100755 + try: + my.doLock() + except yum.Errors.LockError, e: -+ print >> sys.stderr, "Error: %s" % e ++ print >> sys.stderr, _("Error: %s") % e + sys.exit(50) + + # Use progress bar display when downloading repo metadata @@ -4454,9 +4631,35 @@ index 7950854..b1ee285 100755 + if len(opts.repoid) > 0: myrepos = [] - -@@ -182,13 +194,6 @@ def main(): - print >> sys.stderr, "Error: Can't use --norepopath with multiple repositories" +- ++ + # find the ones we want + for glob in opts.repoid: +- myrepos.extend(my.repos.findRepos(glob)) +- ++ add_repos = my.repos.findRepos(glob) ++ if not add_repos: ++ print >> sys.stderr, _("Warning: cannot find repository %s") % glob ++ continue ++ myrepos.extend(add_repos) ++ ++ if not myrepos: ++ print >> sys.stderr, _("No repositories found") ++ sys.exit(1) ++ + # disable them all + for repo in my.repos.repos.values(): + repo.disable() +- ++ + # enable the ones we like + for repo in myrepos: + repo.enable() + + # --norepopath can only be sensibly used with a single repository: + if len(my.repos.listEnabled()) > 1 and opts.norepopath: +- print >> sys.stderr, "Error: Can't use --norepopath with multiple repositories" ++ print >> sys.stderr, _("Error: Can't use --norepopath with multiple repositories") sys.exit(1) - # Use progress bar display when downloading repo metadata @@ -4469,30 +4672,65 @@ index 7950854..b1ee285 100755 try: arches = rpmUtils.arch.getArchList(opts.arch) if opts.source: -@@ -199,6 +204,7 @@ def main(): +- arches += ['src'] ++ arches += ['src'] + my.doSackSetup(arches) + except yum.Errors.RepoError, e: +- print >> sys.stderr, "Error setting up repositories: %s" % e ++ print >> sys.stderr, _("Error setting up repositories: %s") % e # maybe this shouldn't be entirely fatal sys.exit(1) - +- ++ + exit_code = 0 for repo in my.repos.listEnabled(): reposack = ListPackageSack(my.pkgSack.returnPackages(repoid=repo.id)) -@@ -277,73 +283,47 @@ def main(): +@@ -206,7 +210,7 @@ def main(): + download_list = reposack.returnNewestByNameArch() + else: + download_list = list(reposack) +- ++ + if opts.norepopath: + local_repo_path = opts.destdir + else: +@@ -241,7 +245,7 @@ def main(): + + if opts.downloadcomps: + wanted_types = ['group'] +- ++ + if opts.downloadmd: + wanted_types = repo.repoXML.fileTypes() + +@@ -254,16 +258,15 @@ def main(): + + try: + resultfile = repo.retrieveMD(ftype) +- basename = os.path.basename(resultfile) ++ basename = os.path.basename(resultfile) + if ftype == 'group' and opts.downloadcomps: # for compat with how --downloadcomps saved the comps file always as comps.xml + basename = 'comps.xml' + shutil.copyfile(resultfile, "%s/%s" % (local_repo_path, basename)) +- except yum.Errors.RepoMDError,e : ++ except yum.Errors.RepoMDError, e: + if not opts.quiet: + my.logger.error("Unable to fetch metadata: %s" % e) +- ++ + remote_size = 0 +- local_size = 0 + if not opts.urls: + for pkg in download_list: + remote = pkg.returnSimple('relativepath') +@@ -276,75 +279,48 @@ def main(): + if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size) - download_list.sort(sortPkgObj) +- download_list.sort(sortPkgObj) - n = 0 -+ if opts.urls: -+ for pkg in download_list: -+ print urljoin(pkg.repo.urls[0], pkg.relativepath) -+ return 0 -+ -+ # create dest dir -+ if not os.path.exists(local_repo_path): -+ os.makedirs(local_repo_path) -+ -+ # set localpaths - for pkg in download_list: +- for pkg in download_list: - n = n + 1 - repo = my.repos.getRepo(pkg.repoid) - remote = pkg.returnSimple('relativepath') @@ -4538,11 +4776,22 @@ index 7950854..b1ee285 100755 - my.logger.error("Could not retrieve package %s. Error was %s" % (pkg, str(e))) - local_size += sz - continue -- ++ download_list.sort(key=lambda pkg: pkg.name) ++ if opts.urls: ++ for pkg in download_list: ++ print urljoin(pkg.repo.urls[0], pkg.relativepath) ++ return 0 + - local_size += sz - if hasattr(urlgrabber.progress, 'text_meter_total_size'): - urlgrabber.progress.text_meter_total_size(remote_size, local_size) - if opts.gpgcheck: ++ # create dest dir ++ if not os.path.exists(local_repo_path): ++ os.makedirs(local_repo_path) ++ ++ # set localpaths ++ for pkg in download_list: + rpmfn = os.path.basename(pkg.remote_path) + pkg.localpath = os.path.join(local_repo_path, rpmfn) + pkg.repo.copy_local = True @@ -4583,8 +4832,9 @@ index 7950854..b1ee285 100755 if __name__ == "__main__": main() +- diff --git a/repotrack.py b/repotrack.py -index ed26b9f..6c6a18c 100755 +index ed26b9f..8dd8b9c 100755 --- a/repotrack.py +++ b/repotrack.py @@ -7,11 +7,11 @@ @@ -4602,6 +4852,32 @@ index ed26b9f..6c6a18c 100755 # (c) 2005 seth vidal skvidal at phy.duke.edu +@@ -38,16 +38,6 @@ from yum.constants import * + from yum.packages import parsePackages + from yum.packageSack import ListPackageSack + +-# for yum 2.4.X compat +-def sortPkgObj(pkg1 ,pkg2): +- """sorts a list of yum package objects by name""" +- if pkg1.name > pkg2.name: +- return 1 +- elif pkg1.name == pkg2.name: +- return 0 +- else: +- return -1 +- + class RepoTrack(yum.YumBase): + def __init__(self, opts): + yum.YumBase.__init__(self) +@@ -224,7 +214,7 @@ def main(): + this_sack.addList(download_list) + download_list = this_sack.returnNewestByNameArch() + +- download_list.sort(sortPkgObj) ++ download_list.sort(key=lambda pkg: pkg.name) + for pkg in download_list: + repo = my.repos.getRepo(pkg.repoid) + remote = pkg.returnSimple('relativepath') diff --git a/show-changed-rco.py b/show-changed-rco.py index 3489247..f314ef0 100755 --- a/show-changed-rco.py @@ -4805,7 +5081,7 @@ index d1fe5e2..78e8264 100755 group = my.comps.return_group('core') for pname in group.mandatory_packages: diff --git a/yum-builddep.py b/yum-builddep.py -index d7a37c3..b9e682a 100755 +index d7a37c3..216066e 100755 --- a/yum-builddep.py +++ b/yum-builddep.py @@ -8,17 +8,18 @@ @@ -4849,9 +5125,22 @@ index d7a37c3..b9e682a 100755 self.main() def main(self): -@@ -118,9 +124,16 @@ class YumBuildDep(YumUtilBase): +@@ -86,6 +92,10 @@ class YumBuildDep(YumUtilBase): + self.logger.error("Error: You must be root to install packages") + sys.exit(1) + ++ # Use source rpms ++ self.arch.archlist.append('src') ++ self.setupSourceRepos() ++ + # Setup yum (Ts, RPM db, Repo & Sack) + self.doUtilYumSetup() + # Do the real action +@@ -116,30 +126,26 @@ class YumBuildDep(YumUtilBase): + + def setupSourceRepos(self): # enable the -source repos for enabled primary repos - archlist = rpmUtils.arch.getArchList() + ['src'] +- archlist = rpmUtils.arch.getArchList() + ['src'] for repo in self.repos.listEnabled(): - if not repo.id.endswith('-source'): + issource_repo = repo.id.endswith('-source') @@ -4863,19 +5152,31 @@ index d7a37c3..b9e682a 100755 + elif not issource_repo: srcrepo = '%s-source' % repo.id else: -+ # Need to change the arch. - repo.close() - self.repos.disableRepo(repo.id) - srcrepo = repo.id -@@ -140,6 +153,7 @@ class YumBuildDep(YumUtilBase): - sys.exit(1) +- repo.close() +- self.repos.disableRepo(repo.id) +- srcrepo = repo.id ++ continue + + for r in self.repos.findRepos(srcrepo): + if r in self.repos.listEnabled(): + continue + self.logger.info('Enabling %s repository' % r.id) + r.enable() +- # Setup the repo, without a cache +- r.setup(0) +- # Setup pkgSack with 'src' in the archlist +- try: +- self._getSacks(archlist=archlist,thisrepo=r.id) +- except yum.Errors.RepoError, e: +- print "Could not setup repo %s: %s" % (r.id, e) +- sys.exit(1) def install_deps(self, deplist): + errors = set() for dep in deplist: self.logger.debug(' REQ: %s' % dep) if dep.startswith("rpmlib("): -@@ -152,10 +166,13 @@ class YumBuildDep(YumUtilBase): +@@ -152,10 +158,13 @@ class YumBuildDep(YumUtilBase): pkg = self.returnPackageByDep(dep) self.logger.info(' --> %s' % pkg) self.install(pkg) @@ -4892,7 +5193,7 @@ index d7a37c3..b9e682a 100755 # go through each of the pkgs, figure out what they are/where they are # if they are not a local package then run -@@ -170,10 +187,14 @@ class YumBuildDep(YumUtilBase): +@@ -170,10 +179,14 @@ class YumBuildDep(YumUtilBase): specnames = [] srpms = [] specworks = False @@ -4907,7 +5208,15 @@ index d7a37c3..b9e682a 100755 for arg in self.cmds: if arg.endswith('.src.rpm'): -@@ -206,22 +227,30 @@ class YumBuildDep(YumUtilBase): +@@ -192,7 +205,6 @@ class YumBuildDep(YumUtilBase): + + toActOn = [] + if srcnames: +- self.setupSourceRepos() + pkgs = self.pkgSack.returnPackages(patterns=srcnames) + exact, match, unmatch = yum.packages.parsePackages(pkgs, srcnames, casematch=1) + srpms += exact + match +@@ -206,22 +218,30 @@ class YumBuildDep(YumUtilBase): sys.exit(1) toActOn = [] @@ -5001,11 +5310,14 @@ index c5074ab..6b01e4e 100755 diff --git a/yum-config-manager.py b/yum-config-manager.py -index 50f5123..bc96b55 100755 +index 50f5123..46b71b7 100755 --- a/yum-config-manager.py +++ b/yum-config-manager.py -@@ -9,6 +9,8 @@ from utils import YumUtilBase +@@ -7,8 +7,11 @@ import yum + sys.path.insert(0,'/usr/share/yum-cli') + from utils import YumUtilBase import logging ++import fnmatch from iniparse import INIConfig +import yum.config @@ -5013,7 +5325,19 @@ index 50f5123..bc96b55 100755 from yum.parser import varReplace -@@ -122,7 +124,8 @@ group.add_option("--add-repo", default=[], dest='addrepo', action='append', +@@ -97,6 +100,11 @@ def writeRawConfigFile(filename, section_id, yumvar, + fp.write(str(ini)) + fp.close() + ++def match_repoid(repoid, repo_setopts): ++ for i in repo_setopts: ++ if fnmatch.fnmatch(repoid, i): ++ return True ++ + NAME = 'yum-config-manager' + VERSION = '1.0' + USAGE = '"yum-config-manager [options] [section]' +@@ -122,7 +130,8 @@ group.add_option("--add-repo", default=[], dest='addrepo', action='append', help='add (and enable) the repo from the specified file or url') try: opts = yb.doUtilConfigSetup() @@ -5023,7 +5347,7 @@ index 50f5123..bc96b55 100755 logger.error(str(e)) sys.exit(50) -@@ -153,7 +156,7 @@ if (not args and not opts.addrepo) or 'main' in args: +@@ -153,7 +162,7 @@ if (not args and not opts.addrepo) or 'main' in args: ybc = yb.conf writeRawConfigFile(fn, 'main', ybc.yumvar, ybc.cfg.options, ybc.iteritems, ybc.optionobj, @@ -5032,7 +5356,7 @@ index 50f5123..bc96b55 100755 if opts.enable or opts.disable: opts.save = True -@@ -161,7 +164,8 @@ if opts.enable or opts.disable: +@@ -161,7 +170,8 @@ if opts.enable or opts.disable: only = ['enabled'] if args: @@ -5042,7 +5366,16 @@ index 50f5123..bc96b55 100755 else: repos = yb.repos.listEnabled() -@@ -196,13 +200,16 @@ if opts.addrepo: +@@ -174,7 +184,7 @@ if not opts.addrepo: + repo.disable() + print repo.dump() + if (opts.save and +- (only or (hasattr(yb, 'repo_setopts') and repo.id in yb.repo_setopts))): ++ (only or (hasattr(yb, 'repo_setopts') and match_repoid(repo.id, yb.repo_setopts)))): + writeRawConfigFile(repo.repofile, repo.id, repo.yumvar, + repo.cfg.options, repo.iteritems, repo.optionobj, + only) +@@ -196,13 +206,16 @@ if opts.addrepo: if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it destname = os.path.basename(url) destname = myrepodir + '/' + destname @@ -5186,7 +5519,7 @@ index 8bfdbcd..250ebc9 100644 # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software diff --git a/yum-utils.bash b/yum-utils.bash -index 1d37231..601e0d9 100644 +index 1d37231..04b78a7 100644 --- a/yum-utils.bash +++ b/yum-utils.bash @@ -1,3 +1,6 @@ @@ -5423,15 +5756,18 @@ index 1d37231..601e0d9 100644 $split && return 0 if [[ $cur == -* ]] ; then -@@ -318,6 +354,7 @@ _yu_builddep() +@@ -318,7 +354,9 @@ _yu_builddep() return 0 fi +- COMPREPLY=( $( compgen -f -o plusdirs -X "!*.spec" -- "$cur" ) ) + local IFS=$'\n' - COMPREPLY=( $( compgen -f -o plusdirs -X "!*.spec" -- "$cur" ) ) ++ COMPREPLY=( $( compgen -f -o plusdirs -X "!*.sp@(ec|m)" -- "$cur" ) ) ++ COMPREPLY+=( $( compgen -f -o plusdirs -X "!*.?(no)src.rpm" -- "$cur" ) ) [[ $cur != */* && $cur != ~* ]] && _yum_list all "$cur" 2>/dev/null } && -@@ -359,10 +396,42 @@ _yu_debug_dump() + complete -F _yu_builddep -o filenames yum-builddep yum-builddep.py +@@ -359,10 +397,42 @@ _yu_debug_dump() return 0 fi @@ -5475,7 +5811,7 @@ index 1d37231..601e0d9 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..de6fbfd 100644 +index ce7fb64..dd206b3 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -5490,7 +5826,7 @@ index ce7fb64..de6fbfd 100644 Summary: Utilities based around the yum package manager Name: yum-utils -@@ -10,7 +17,8 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz +@@ -10,9 +17,10 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -5498,8 +5834,11 @@ index ce7fb64..de6fbfd 100644 +# For new findRepos() API. +Requires: yum >= 3.4.3-96 Requires: python-kitchen - BuildRequires: python-devel >= 2.4 +-BuildRequires: python-devel >= 2.4 ++BuildRequires: python-devel BuildRequires: gettext + BuildRequires: intltool + Provides: yum-utils-translations = %{version}-%{release} @@ -105,18 +113,6 @@ Requires: yum >= 3.0 This plugin allows you to specify optional transaction flags on the yum command line @@ -5920,7 +6259,7 @@ index 8a4888e..c50159e 100755 args.pop(0) if args: diff --git a/yumdownloader.py b/yumdownloader.py -index e6107d4..b491c7f 100755 +index e6107d4..1b95e8d 100755 --- a/yumdownloader.py +++ b/yumdownloader.py @@ -7,11 +7,11 @@ @@ -5977,7 +6316,7 @@ index e6107d4..b491c7f 100755 sys.exit(50) # Check if there is anything to do. -@@ -89,56 +96,33 @@ class YumDownloader(YumUtilBase): +@@ -89,56 +96,38 @@ class YumDownloader(YumUtilBase): if not self.setCacheDir(): self.logger.error("Error: Could not make cachedir, exiting") sys.exit(50) @@ -5985,11 +6324,16 @@ index e6107d4..b491c7f 100755 + # override all pkgdirs + self.conf.downloaddir = opts.destdir - # Setup yum (Ts, RPM db, Repo & Sack) - self.doUtilYumSetup(opts) +- # Setup yum (Ts, RPM db, Repo & Sack) +- self.doUtilYumSetup(opts) - # Setup source repos -- if opts.source: -- self.setupSourceRepos() + if opts.source: ++ # Setup source repos ++ self.arch.archlist.append('src') + self.setupSourceRepos() ++ ++ # Setup yum (Ts, RPM db, Repo & Sack) ++ self.doUtilYumSetup() # Do the real action self.exit_code = self.downloadPackages(opts) @@ -6048,7 +6392,7 @@ index e6107d4..b491c7f 100755 def downloadPackages(self,opts): -@@ -177,7 +161,7 @@ class YumDownloader(YumUtilBase): +@@ -177,7 +166,7 @@ class YumDownloader(YumUtilBase): installable = self.returnPackagesByDep(pkg) installable = yum.misc.unique(installable) except yum.Errors.YumBaseError, msg: @@ -6057,8 +6401,16 @@ index e6107d4..b491c7f 100755 continue if not installable: # doing one at a time, apart from groups -@@ -211,57 +195,29 @@ class YumDownloader(YumUtilBase): - self.resolveDeps() +@@ -208,60 +197,36 @@ class YumDownloader(YumUtilBase): + self.tsInfo.addInstall(po) + self.localPackages.append(po) + # Resolve dependencies +- self.resolveDeps() ++ result, resultmsgs = self.resolveDeps() ++ if result == 1: ++ for msg in resultmsgs: ++ self.logger.critical(msg) ++ self.logger.critical('Dependency resolution failed, some packages will not be downloaded.') # Add newly added packages to the toDownload list for pkg in self.tsInfo.getMembers(): - if not pkg in toDownload: @@ -6133,24 +6485,30 @@ index e6107d4..b491c7f 100755 return exit_code def _groupPackages(self,pkglist): -@@ -279,6 +235,9 @@ class YumDownloader(YumUtilBase): - """do a default setup for all the normal/necessary yum components, - really just a shorthand for testing""" - try: -+ # Setup source repos -+ if opts.source: -+ self.setupSourceRepos() - self._getRepos(doSetup = True) - # if '--source' is used the add src to the archlist - if opts.source: -@@ -291,18 +250,11 @@ class YumDownloader(YumUtilBase): - archlist = rpmUtils.arch.getArchList() - self._getSacks(archlist=archlist) - except yum.Errors.YumBaseError, msg: +@@ -274,35 +239,8 @@ class YumDownloader(YumUtilBase): + pkgGroups[na].append(po) + return pkgGroups + +- # sligly modified from the one in YumUtilBase +- def doUtilYumSetup(self,opts): +- """do a default setup for all the normal/necessary yum components, +- really just a shorthand for testing""" +- try: +- self._getRepos(doSetup = True) +- # if '--source' is used the add src to the archlist +- if opts.source: +- archlist = rpmUtils.arch.getArchList() + ['src'] +- elif opts.archlist: +- archlist = [] +- for a in opts.archlist.split(','): +- archlist.extend(rpmUtils.arch.getArchList(a)) +- else: +- archlist = rpmUtils.arch.getArchList() +- self._getSacks(archlist=archlist) +- except yum.Errors.YumBaseError, msg: - self.logger.critical(str(msg)) -+ self.logger.critical(exception2msg(msg)) - sys.exit(1) - +- sys.exit(1) +- - def _removeEnabledSourceRepos(self): - ''' Disable all enabled *-source repos.''' - for repo in self.repos.listEnabled(): @@ -6164,3 +6522,12 @@ index e6107d4..b491c7f 100755 if hasattr(self,'getOptionGroup'): # check if the group option API is available group = self.getOptionGroup() else: +@@ -316,7 +254,7 @@ class YumDownloader(YumUtilBase): + group.add_option("--source", default=False, dest="source", action="store_true", + help='operate on source packages') + group.add_option("--archlist", +- help="only download packages of certain architecture(s)") ++ help="only download packages of given and compatible architectures") + + if __name__ == '__main__': + setup_locale() diff --git a/yum-utils.spec b/yum-utils.spec index 16c2634..5362b81 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 21%{?dist} +Release: 22%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -18,7 +18,7 @@ Patch1: yum-utils-HEAD.patch URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -Requires: yum >= 3.2.29 +Requires: yum >= 3.4.3-148 Requires: python-kitchen BuildRequires: python-devel >= 2.4 BuildRequires: gettext @@ -663,6 +663,25 @@ fi %{pluginhome}/puppetverify.* %changelog +* Thu May 22 2014 Valentina Mukhamedzhanova - 1.1.31-22 +- Update to latest HEAD +- yum-builddep: Use srpms in already enabled repos. BZ 1024070 +- yumdownloader: use stock doUtilYumSetup(). +- yum-builddep: Note spec support in man page. +- yum-builddep: Complete on local source RPMs. BZ 884303 +- Fix 'reposync -r nosuchrepo' behaviour. BZ 1060702 +- Fix description of --archlist in the manpage and help. BZ 1045871 +- Make using needs-restarting as non-root more clear. BZ 754169 +- Remove 'yum-installed' from yum-utils man page. +- Fix calculation of process start time in needs-restarting. +- Fix reposync using old cache af non-root user. BZ 1079387. +- Add i18n to reposync. +- Fix --verify-configuration-files help string to make its usage clearer. +- Print depsolving errors in yumdownloader instead of ignoring them. BZ 998892 +- Fix filename parsing in get_open_files(). BZ 1078724 +- Handle IOErrors in needs-restarting if the process is already over. +- Fix --save when --setopt contains wildcards. BZ 1097297 + * Thu Jan 16 2014 Zdenek Pavlas - 1.1.31-21 - Update to latest HEAD - completion: Fix file/dir completions for names containing spaces or tabs From 16b53585f110ce5dd9122ef655889cc8b6621d5c Mon Sep 17 00:00:00 2001 From: Valentina Mukhamedzhanova Date: Fri, 23 May 2014 15:37:11 +0200 Subject: [PATCH 20/55] Update to latest HEAD - needs-restarting: fix IOError when cannot read file. --- yum-utils-HEAD.patch | 14 ++++++++------ yum-utils.spec | 6 +++++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index e33cea4..2f0f2d7 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -1873,7 +1873,7 @@ index 0578295..aac29ea 100644 import sys diff --git a/needs-restarting.py b/needs-restarting.py -index 6bc883f..d26ac42 100755 +index 6bc883f..8984f8f 100755 --- a/needs-restarting.py +++ b/needs-restarting.py @@ -8,11 +8,11 @@ @@ -1905,9 +1905,13 @@ index 6bc883f..d26ac42 100755 def parseargs(args): usage = """ -@@ -78,56 +82,90 @@ def get_open_files(pid): +@@ -76,18 +80,19 @@ def get_open_files(pid): + files = [] + smaps = '/proc/%s/smaps' % pid try: - maps = open(smaps, 'r') +- maps = open(smaps, 'r') ++ with open(smaps, 'r') as maps_f: ++ maps = maps_f.readlines() except (IOError, OSError), e: - print "Could not open %s" % smaps + print >>sys.stderr, "Could not open %s" % smaps @@ -1927,9 +1931,7 @@ index 6bc883f..d26ac42 100755 filename = filename.strip() if filename not in files: files.append(filename) -+ maps.close() - return files - +@@ -96,38 +101,71 @@ def get_open_files(pid): def main(args): (opts, args) = parseargs(args) diff --git a/yum-utils.spec b/yum-utils.spec index 5362b81..aa8f1fa 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 22%{?dist} +Release: 23%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -663,6 +663,10 @@ fi %{pluginhome}/puppetverify.* %changelog +* Fri May 23 2014 Valentina Mukhamedzhanova - 1.1.31-23 +- Update to latest HEAD +- needs-restarting: fix IOError when cannot read file. + * Thu May 22 2014 Valentina Mukhamedzhanova - 1.1.31-22 - Update to latest HEAD - yum-builddep: Use srpms in already enabled repos. BZ 1024070 From 5b21fd844cc4d403ba41100d7415d68ec6db1362 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 7 Jun 2014 12:56:43 -0500 Subject: [PATCH 21/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index aa8f1fa..4490880 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 23%{?dist} +Release: 24%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -663,6 +663,9 @@ fi %{pluginhome}/puppetverify.* %changelog +* Sat Jun 07 2014 Fedora Release Engineering - 1.1.31-24 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + * Fri May 23 2014 Valentina Mukhamedzhanova - 1.1.31-23 - Update to latest HEAD - needs-restarting: fix IOError when cannot read file. From 2f4d18055e4f0e83e1ef7fa443ad325878bb9658 Mon Sep 17 00:00:00 2001 From: James Antill Date: Tue, 23 Sep 2014 14:51:04 -0400 Subject: [PATCH 22/55] Update to latest HEAD - Initial port of DNF copr plugin to yum API. - reposync: check for existing packages when using -u option. BZ 1140864 - Add --nolock option to repoquery, so queries can be run in parallel. - reposync: preserve directory structure. BZ 1139032 - yum-builddep: don't setup source repos if a local srpm or spec file is specified. BZ 1113167 - yum-post-transaction-actions: allow colons in command part. BZ 1134989 - reposync: show urls for all repos when using -u option. BZ 1133125 - post-transaction-actions: preload filelists for packages to be removed. BZ 1127782. - needs-restarting: catch IOError. BZ 1127191 - yum-config-manager: make --setopt work without providing repo name twice. --- yum-utils-HEAD.patch | 762 ++++++++++++++++++++++++++++++++++++++----- yum-utils.spec | 33 +- 2 files changed, 706 insertions(+), 89 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 2f0f2d7..0b3f971 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -206,7 +206,7 @@ index 177c6c3..bb61a1d 100755 # but I'm not sure of a better way of doing it if not self.no_debuginfo_plugin and self.tsInfo: diff --git a/docs/Makefile b/docs/Makefile -index d01c1e4..481f0f3 100644 +index d01c1e4..79d8a1b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,9 +1,11 @@ @@ -219,7 +219,7 @@ index d01c1e4..481f0f3 100644 + repomanage repotrack verifytree yum-config-manager DOCS5 = yum-changelog.conf yum-versionlock.conf yum-fs-snapshot.conf -DOCS8 = yum-security yum-complete-transaction yumdb -+DOCS8 = yum-complete-transaction yumdb ++DOCS8 = yum-complete-transaction yumdb yum-copr all: echo "Nothing to do" @@ -616,7 +616,7 @@ index 0000000..4d336a5 +See the Authors file included with this program. +.fi diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..85b0047 100644 +index f5a8c5d..ead5a18 100644 --- a/docs/repoquery.1 +++ b/docs/repoquery.1 @@ -1,11 +1,11 @@ @@ -656,7 +656,18 @@ index f5a8c5d..85b0047 100644 .IP "\fB\-\-plugins\fP" Enable YUM plugin support. .IP "\fB\-q, \-\-query\fP" -@@ -57,6 +57,13 @@ the releasever information from outside the installroot. +@@ -45,6 +45,10 @@ Produce verbose output. + Tells repoquery to run entirely from YUM cache - does not download any metadata + or update the cache. Queries in this mode can fail or give partial/incorrect + results if the cache isn't fully populated beforehand with eg "yum makecache". ++.IP "\fB\-\-nolock\fP" ++Disable locking the yum cache. This is needed as any yum API caller can alter ++the repo. metadata cache, unless it is locked. This automatically enables the ++--cache and --tempcache options, to try to lower the riskiness. + .IP "\fB\-\-tempcache\fP" + Create and use a private cache instead of the main YUM cache. This is used + by default when run as non-root user. +@@ -57,6 +61,13 @@ the releasever information from outside the installroot. Note that with the default upstream cachedir, of /var/cache/yum, using this option will corrupt your cache (and you can use $releasever in your cachedir configuration to stop this). @@ -670,7 +681,7 @@ index f5a8c5d..85b0047 100644 .IP "\fB\-\-setopt=option=value\fP" Set any config option in yum config or repo files. For options in the global config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid.option=value -@@ -64,13 +71,13 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid +@@ -64,13 +75,13 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid .PP .SH "PACKAGE QUERY OPTIONS" .IP "\fB\-i, \-\-info\fP" @@ -686,7 +697,7 @@ index f5a8c5d..85b0047 100644 .IP "\fB\-\-provides\fP" List capabilities package provides. .IP "\fB\-\-obsoletes\fP" -@@ -81,7 +88,7 @@ List capabilities conflicting with package. +@@ -81,7 +92,7 @@ List capabilities conflicting with package. List package changelog. .IP "\fB\-\-location\fP" Show a location where the package could be downloaded from. @@ -695,7 +706,7 @@ index f5a8c5d..85b0047 100644 .IP "\fB\-s, \-\-source\fP" Show package source RPM name. .IP "\fB\-\-srpm\fP" -@@ -95,16 +102,16 @@ Use name-epoch:version-release.architecture output format (default) +@@ -95,16 +106,16 @@ Use name-epoch:version-release.architecture output format (default) .IP "\fB\-\-envra\fP" Use epoch:name-version-release.architecture output format (easier to parse than nevra) @@ -715,7 +726,7 @@ index f5a8c5d..85b0047 100644 number of level to print on the tree. Default level is 'all'. .PP -@@ -112,6 +119,8 @@ number of level to print on the tree. Default level is 'all'. +@@ -112,6 +123,8 @@ number of level to print on the tree. Default level is 'all'. .IP "\fB\-a, \-\-all\fP" Query all available packages (for rpmquery compatibility / shorthand for repoquery '*') @@ -724,7 +735,7 @@ index f5a8c5d..85b0047 100644 .IP "\fB\-f, \-\-file FILE\fP" Query package owning FILE. .IP "\fB\-\-whatobsoletes CAPABILITY\fP" -@@ -123,14 +132,15 @@ Query all packages that provide CAPABILITY. +@@ -123,14 +136,15 @@ Query all packages that provide CAPABILITY. .IP "\fB\-\-whatrequires CAPABILITY\fP" Query all packages that require CAPABILITY. .IP "\fB\-\-alldeps\fP" @@ -744,7 +755,7 @@ index f5a8c5d..85b0047 100644 .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" Limit the query to packages of given architecture(s). Valid values are all architectures known to rpm/yum such as 'i386' and 'src' for -@@ -166,19 +176,19 @@ Query groups instead of packages. +@@ -166,19 +180,19 @@ Query groups instead of packages. .SH "EXAMPLES" .IP "List all packages whose name contains 'perl':" @@ -771,7 +782,7 @@ index f5a8c5d..85b0047 100644 NB: This command will only work if you have repositories enabled which include srpms. .\"TODO: Add more examples... -@@ -204,7 +214,7 @@ of the following: +@@ -204,7 +218,7 @@ of the following: .br \fBepoch:name-ver-rel.arch\fP .IP @@ -781,7 +792,7 @@ index f5a8c5d..85b0047 100644 Additionally wildcards (shell-style globs) can be used. diff --git a/docs/reposync.1 b/docs/reposync.1 -index c1bc818..29043fb 100644 +index c1bc818..d6d245a 100644 --- a/docs/reposync.1 +++ b/docs/reposync.1 @@ -1,7 +1,7 @@ @@ -793,7 +804,7 @@ index c1bc818..29043fb 100644 .SH "SYNOPSIS" \fBreposync\fP [options] .SH "DESCRIPTION" -@@ -14,7 +14,7 @@ Display a help message, and then quit. +@@ -14,33 +14,48 @@ Display a help message, and then quit. Config file to use (defaults to /etc/yum.conf). .IP "\fB\-a ARCH, \-\-arch=ARCH\fP" Act as if running the specified arch (default: current arch, note: does @@ -802,8 +813,20 @@ index c1bc818..29043fb 100644 .IP "\fB\-\-source\fP" Also download .src.rpm files. .IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" -@@ -26,21 +26,26 @@ Use a temp dir for storing/accessing yum-cache. + Specify repo ids to query, can be specified multiple times (default is + all enabled). ++.IP "\fB\-e\ CACHEDIR, \-\-cachedir CACHEDIR\fP", ++Directory in which to store metadata. + .IP "\fB\-t, \-\-tempcache\fP" + Use a temp dir for storing/accessing yum-cache. ++.IP "\fB\-d, \-\-delete\fP" ++Delete local packages no longer present in repository. + .IP "\fB\-p DESTDIR, \-\-download_path=DESTDIR\fP" Path to download packages to: defaults to current directory. ++.IP "\fB\-\-norepopath\fP" ++Don't add the reponame to the download path. ++Can only be used when syncing a single repository (default is ++to add the reponame). .IP "\fB\-g, \-\-gpgcheck\fP" Remove packages that fail GPG signature checking after downloading. +exit status is '1' if at least one package was removed. @@ -812,6 +835,8 @@ index c1bc818..29043fb 100644 -.IP "\fB\-n, \-\-newest-only\fP" +.IP "\fB\-l, \-\-plugins\fP" +Enable yum plugin support. ++.IP "\fB\-m, \-\-downloadcomps\fP" ++Also download comps.xml. +.IP "\fB\-n, \-\-newest\-only\fP" Download only newest packages per-repo. .IP "\fB\-q, \-\-quiet\fP" @@ -1156,6 +1181,132 @@ index 0000000..81b895b +.nf +See the Authors file included with this program. +.fi +diff --git a/docs/yum-copr.8 b/docs/yum-copr.8 +new file mode 100644 +index 0000000..11afc83 +--- /dev/null ++++ b/docs/yum-copr.8 +@@ -0,0 +1,120 @@ ++.\" Man page generated from reStructuredText. ++. ++.TH "YUM-COPR" "8" "July 29, 2014" "0.1.1" "yum-plugin-copr" ++.SH NAME ++yum-plugin-copr \- YUM copr Plugin ++. ++.nr rst2man-indent-level 0 ++. ++.de1 rstReportMargin ++\\$1 \\n[an-margin] ++level \\n[rst2man-indent-level] ++level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] ++- ++\\n[rst2man-indent0] ++\\n[rst2man-indent1] ++\\n[rst2man-indent2] ++.. ++.de1 INDENT ++.\" .rstReportMargin pre: ++. RS \\$1 ++. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] ++. nr rst2man-indent-level +1 ++.\" .rstReportMargin post: ++.. ++.de UNINDENT ++. RE ++.\" indent \\n[an-margin] ++.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.nr rst2man-indent-level -1 ++.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.in \\n[rst2man-indent\\n[rst2man-indent-level]]u ++.. ++. ++.nr rst2man-indent-level 0 ++. ++.de1 rstReportMargin ++\\$1 \\n[an-margin] ++level \\n[rst2man-indent-level] ++level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] ++- ++\\n[rst2man-indent0] ++\\n[rst2man-indent1] ++\\n[rst2man-indent2] ++.. ++.de1 INDENT ++.\" .rstReportMargin pre: ++. RS \\$1 ++. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] ++. nr rst2man-indent-level +1 ++.\" .rstReportMargin post: ++.. ++.de UNINDENT ++. RE ++.\" indent \\n[an-margin] ++.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.nr rst2man-indent-level -1 ++.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.in \\n[rst2man-indent\\n[rst2man-indent-level]]u ++.. ++.sp ++Work with Copr & Playground repositories on the local system. ++.INDENT 0.0 ++.IP \(bu 2 ++The \fBcopr\fP command is used to add or remove Copr repositories to the local system ++.IP \(bu 2 ++The \fBplayground\fP is used to enable or disable the Playground repository ++.UNINDENT ++.SH SYNOPSIS ++.sp ++\fByum copr [enable|disable|list|search] \fP ++.sp ++\fByum playground [enable|disable|upgrade]\fP ++.SH ARGUMENTS (COPR) ++.INDENT 0.0 ++.TP ++.B \fBenable name/project [chroot]\fP ++Enable the \fBname/project\fP Copr repository with the optional \fBchroot\fP\&. ++.TP ++.B \fBdisable name/project\fP ++Disable the \fBname/project\fP Copr repository. ++.TP ++.B \fBlist name\fP ++List available Copr repositories for a given \fBname\fP\&. ++.TP ++.B \fBsearch project\fP ++Search for a given \fBproject\fP\&. ++.UNINDENT ++.SH ARGUMENTS (PLAYGROUND) ++.INDENT 0.0 ++.TP ++.B \fBenable\fP ++Enable the Playground repository. ++.TP ++.B \fBdisable\fP ++Disable the Playground repository. ++.TP ++.B \fBupgrade\fP ++Upgrade the Playground repository settings (same as \fBdisable\fP and then \fBenable\fP). ++.UNINDENT ++.SH EXAMPLES ++.INDENT 0.0 ++.TP ++.B \fBcopr enable rhscl/perl516 epel\-6\-x86_64\fP ++Enable the \fBrhscl/perl516\fP Copr repository, using the \fBepel\-6\-x86_64\fP chroot. ++.TP ++.B \fBcopr disable rhscl/perl516\fP ++Disable the \fBrhscl/perl516\fP Copr repository ++.TP ++.B \fBcopr list rita\fP ++List available Copr projects for user \fBrita\fP\&. ++.TP ++.B \fBcopr search tests\fP ++Search for Copr projects named \fBtests\fP\&. ++.UNINDENT ++.SH AUTHOR ++See AUTHORS in the Core DNF Plugins distribution ++.SH COPYRIGHT ++2014, Red Hat, Licensed under GPLv2+ ++.\" Generated by docutils manpage writer. ++. diff --git a/docs/yum-debug-dump.1 b/docs/yum-debug-dump.1 index 0e65a07..3f1e2e5 100644 --- a/docs/yum-debug-dump.1 @@ -1873,7 +2024,7 @@ index 0578295..aac29ea 100644 import sys diff --git a/needs-restarting.py b/needs-restarting.py -index 6bc883f..8984f8f 100755 +index 6bc883f..b0e540b 100755 --- a/needs-restarting.py +++ b/needs-restarting.py @@ -8,11 +8,11 @@ @@ -2008,8 +2159,9 @@ index 6bc883f..8984f8f 100755 for pid in needing_restart: try: cmdline = open('/proc/' +pid+ '/cmdline', 'r').read() - except OSError, e: +- except OSError, e: - print "Couldn't access process information for %s: %s" % (pid, str(e)) ++ except (OSError, IOError), e: + print >>sys.stderr, "Couldn't access process information for %s: %s" % (pid, str(e)) continue # proc cmdline is null-delimited so clean that up @@ -2179,6 +2331,347 @@ index 16144c6..d09281a 100644 ypl = base.returnPkgLists(extcmds) self.show_data(msg, ypl.installed, 'Installed Packages') self.show_data(msg, ypl.available, 'Available Packages') +diff --git a/plugins/copr/copr.conf b/plugins/copr/copr.conf +new file mode 100644 +index 0000000..8e4d76c +--- /dev/null ++++ b/plugins/copr/copr.conf +@@ -0,0 +1,2 @@ ++[main] ++enabled=1 +diff --git a/plugins/copr/copr.py b/plugins/copr/copr.py +new file mode 100644 +index 0000000..6d922ce +--- /dev/null ++++ b/plugins/copr/copr.py +@@ -0,0 +1,327 @@ ++# supplies the 'copr' command. ++# ++# Copyright (C) 2014 Red Hat, Inc. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions of ++# the GNU General Public License v.2, or (at your option) any later version. ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY expressed or implied, including the implied warranties of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. You should have received a copy of the ++# GNU General Public License along with this program; if not, write to the ++# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the ++# source code or documentation are not subject to the GNU General Public ++# License and may only be used or replicated with the express permission of ++# Red Hat, Inc. ++# ++ ++"""YUM plugin supplying the 'copr' command.""" ++ ++from urlgrabber import grabber ++ ++import yum ++import glob ++import json ++import os ++import platform ++import requests ++import urllib ++ ++from yum.i18n import _ ++from yum.plugins import TYPE_CORE ++ ++requires_api_version = '2.5' ++plugin_type = TYPE_CORE ++ ++yes = set([_('yes'), _('y')]) ++no = set([_('no'), _('n'), '']) ++ ++YError = yum.Errors.YumBaseError ++YCliError = yum.Errors.MiscError ++ ++def config_hook(conduit): ++ conduit.registerCommand(CoprCommand()) ++ conduit.registerCommand(PlaygroundCommand()) ++ ++class CoprCommand: ++ """ Copr plugin for DNF """ ++ ++ def getNames(self): ++ return [self.aliases[0]] ++ ++ def getUsage(self): ++ return self.usage ++ ++ def getSummary(self): ++ return self.summary[1:] ++ ++ def doCheck(self, base, basecmd, extcmds): ++ self.base = base ++ ++ copr_url = "https://copr.fedoraproject.org" ++ aliases = ("copr",) ++ summary = _("Interact with Copr repositories.") ++ usage = _(""" ++ enable name/project [chroot] ++ disable name/project ++ list name ++ search project ++ ++ Examples: ++ copr enable rhscl/perl516 epel-6-x86_64 ++ copr enable ignatenkobrain/ocltoys ++ copr disable rhscl/perl516 ++ copr list ignatenkobrain ++ copr search tests ++ """) ++ ++ def doCommand(self, base, basecmd, extcmds): ++ try: ++ subcommand = extcmds[0] ++ project_name = extcmds[1] ++ except (ValueError, IndexError): ++ base.logger.critical( ++ _('Error: ') + ++ _('exactly two additional parameters to ' ++ 'copr command are required')) ++ # FIXME ++ # dnf.cli.commands.err_mini_usage(self.cli, self.cli.base.basecmd) ++ raise YCliError( ++ _('exactly two additional parameters to ' ++ 'copr command are required')) ++ try: ++ chroot = extcmds[2] ++ except IndexError: ++ chroot = self._guess_chroot() ++ repo_filename = "/etc/yum.repos.d/_copr_{}.repo" \ ++ .format(project_name.replace("/", "-")) ++ if subcommand == "enable": ++ self._need_root() ++ self._ask_user(""" ++You are about to enable a Copr repository. Please note that this ++repository is not part of the main Fedora distribution, and quality ++may vary. ++ ++The Fedora Project does not exercise any power over the contents of ++this repository beyond the rules outlined in the Copr FAQ at ++, and ++packages are not held to any quality or securty level. ++ ++Please do not file bug reports about these packages in Fedora ++Bugzilla. In case of problems, contact the owner of this repository. ++ ++Do you want to continue? [y/N]: """) ++ self._download_repo(project_name, repo_filename, chroot) ++ base.logger.info(_("Repository successfully enabled.")) ++ elif subcommand == "disable": ++ self._need_root() ++ self._remove_repo(repo_filename) ++ base.logger.info(_("Repository successfully disabled.")) ++ elif subcommand == "list": ++ #http://copr.fedoraproject.org/api/coprs/ignatenkobrain/ ++ api_path = "/api/coprs/{}/".format(project_name) ++ ++ opener = urllib.FancyURLopener({}) ++ res = opener.open(self.copr_url + api_path) ++ try: ++ json_parse = json.loads(res.read()) ++ except ValueError: ++ raise YError( ++ _("Can't parse repositories for username '{}'.") ++ .format(project_name)) ++ section_text = _("List of {} coprs").format(project_name) ++ self._print_match_section(section_text) ++ i = 0 ++ while i < len(json_parse["repos"]): ++ msg = "{0}/{1} : ".format(project_name, ++ json_parse["repos"][i]["name"]) ++ desc = json_parse["repos"][i]["description"] ++ if not desc: ++ desc = _("No description given") ++ msg = self.base.fmtKeyValFill(unicode(msg), desc) ++ print(msg) ++ i += 1 ++ elif subcommand == "search": ++ #http://copr.fedoraproject.org/api/coprs/search/tests/ ++ api_path = "/api/coprs/search/{}/".format(project_name) ++ ++ opener = urllib.FancyURLopener({}) ++ res = opener.open(self.copr_url + api_path) ++ try: ++ json_parse = json.loads(res.read()) ++ except ValueError: ++ raise YError(_("Can't parse search for '{}'.").format(project_name)) ++ section_text = _("Matched: {}").format(project_name) ++ self._print_match_section(section_text) ++ i = 0 ++ while i < len(json_parse["repos"]): ++ msg = "{0}/{1} : ".format(json_parse["repos"][i]["username"], json_parse["repos"][i]["coprname"]) ++ desc = json_parse["repos"][i]["description"] ++ if not desc: ++ desc = _("No description given.") ++ msg = self.base.fmtKeyValFill(unicode(msg), desc) ++ print(msg) ++ i += 1 ++ else: ++ raise YError( ++ _('Unknown subcommand {}.').format(subcommand)) ++ ++ return 0, [basecmd + ' done'] ++ ++ def _print_match_section(self, text): ++ formatted = self.base.fmtSection(text) ++ print(formatted) ++ ++ def _ask_user(self, question): ++ if self.base.conf.assumeyes and not self.base.conf.assumeno: ++ return ++ elif self.base.conf.assumeno and not self.base.conf.assumeyes: ++ raise YError(_('Safe and good answer. Exiting.')) ++ ++ answer = raw_input(question).lower() ++ answer = _(answer) ++ while not ((answer in yes) or (answer in no)): ++ answer = raw_input(question).lower() ++ answer = _(answer) ++ if answer in yes: ++ return ++ else: ++ raise YError(_('Safe and good answer. Exiting.')) ++ ++ @classmethod ++ def _need_root(cls): ++ # FIXME this should do dnf itself (BZ#1062889) ++ if os.geteuid() != 0: ++ raise YError( ++ _('This command has to be run under the root user.')) ++ ++ @classmethod ++ def _guess_chroot(cls): ++ """ Guess which choot is equivalent to this machine """ ++ # FIXME Copr should generate non-specific arch repo ++ dist = platform.linux_distribution() ++ if "Fedora" in dist: ++ # x86_64 because repo-file is same for all arch ++ # ($basearch is used) ++ if "Rawhide" in dist: ++ chroot = ("fedora-rawhide-x86_64") ++ else: ++ chroot = ("fedora-{}-x86_64".format(dist[1])) ++ else: ++ chroot = ("epel-%s-x86_64" % dist[1].split(".", 1)[0]) ++ return chroot ++ ++ @classmethod ++ def _download_repo(cls, project_name, repo_filename, chroot=None): ++ if chroot is None: ++ chroot = cls._guess_chroot() ++ #http://copr.fedoraproject.org/coprs/larsks/rcm/repo/epel-7-x86_64/ ++ api_path = "/coprs/{0}/repo/{1}/".format(project_name, chroot) ++ ug = grabber.URLGrabber() ++ # FIXME when we are full on python2 urllib.parse ++ try: ++ ug.urlgrab(cls.copr_url + api_path, filename=repo_filename) ++ except grabber.URLGrabError as e: ++ cls._remove_repo(repo_filename) ++ raise YError(str(e)) ++ ++ @classmethod ++ def _remove_repo(cls, repo_filename): ++ # FIXME is it Copr repo ? ++ try: ++ os.remove(repo_filename) ++ except OSError as e: ++ raise YError(str(e)) ++ ++ @classmethod ++ def _get_data(cls, req): ++ """ Wrapper around response from server ++ ++ check data and print nice error in case of some error (and return None) ++ otherwise return json object. ++ """ ++ try: ++ output = json.loads(req.text) ++ except ValueError: ++ YCliError(_("Unknown response from server.")) ++ return ++ if req.status_code != 200: ++ YCliError(_( ++ "Something went wrong:\n {0}\n".format(output["error"]))) ++ return ++ return output ++ ++ ++class PlaygroundCommand(CoprCommand): ++ """ Playground plugin for DNF """ ++ ++ aliases = ("playground",) ++ summary = _("Interact with Playground repository.") ++ usage = " [enable|disable|upgrade]" ++ ++ def _cmd_enable(self, chroot): ++ self._need_root() ++ self._ask_user(""" ++You are about to enable a Playground repository. ++ ++Do you want to continue? [y/N]: """) ++ api_url = "{0}/api/playground/list/".format( ++ self.copr_url) ++ req = requests.get(api_url) ++ output = self._get_data(req) ++ if output["output"] != "ok": ++ raise YCliError(_("Unknown response from server.")) ++ for repo in output["repos"]: ++ project_name = "{0}/{1}".format(repo["username"], ++ repo["coprname"]) ++ repo_filename = "/etc/yum.repos.d/_playground_{}.repo" \ ++ .format(project_name.replace("/", "-")) ++ try: ++ # check if that repo exist? but that will result in twice ++ # up calls ++ api_url = "{0}/api/coprs/{1}/detail/{2}/".format( ++ self.copr_url, project_name, chroot) ++ req = requests.get(api_url) ++ output2 = self._get_data(req) ++ if output2 and ("output" in output2) and (output2["output"] == "ok"): ++ self._download_repo(project_name, repo_filename, chroot) ++ except YError: ++ # likely 404 and that repo does not exist ++ pass ++ ++ def _cmd_disable(self): ++ self._need_root() ++ for repo_filename in glob.glob('/etc/yum.repos.d/_playground_*.repo'): ++ self._remove_repo(repo_filename) ++ ++ def doCommand(self, base, basecmd, extcmds): ++ try: ++ subcommand = extcmds[0] ++ except (ValueError, IndexError): ++ base.logger.critical( ++ _('Error: ') + ++ _('exactly one parameter to ' ++ 'playground command are required')) ++ # FIXME: ++ # dnf.cli.commands.err_mini_usage(self.cli, self.cli.base.basecmd) ++ raise YCliError( ++ _('exactly one parameter to ' ++ 'playground command are required')) ++ chroot = self._guess_chroot() ++ if subcommand == "enable": ++ self._cmd_enable(chroot) ++ base.logger.info(_("Playground repositories successfully enabled.")) ++ elif subcommand == "disable": ++ self._cmd_disable() ++ base.logger.info(_("Playground repositories successfully disabled.")) ++ elif subcommand == "upgrade": ++ self._cmd_disable() ++ self._cmd_enable(chroot) ++ base.logger.info(_("Playground repositories successfully updated.")) ++ else: ++ raise YError( ++ _('Unknown subcommand {}.').format(subcommand)) ++ ++ return 0, [basecmd + ' done'] diff --git a/plugins/downloadonly/downloadonly.conf b/plugins/downloadonly/downloadonly.conf deleted file mode 100644 index 8e4d76c..0000000 @@ -2507,10 +3000,37 @@ index c45a1ce..cab69c5 100644 conf_fname = '/etc/yum.repos.d/_local.repo' diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py -index b4da1ce..804af9c 100644 +index b4da1ce..d59dc40 100644 --- a/plugins/post-transaction-actions/post-transaction-actions.py +++ b/plugins/post-transaction-actions/post-transaction-actions.py -@@ -129,8 +129,10 @@ def posttrans_hook(conduit): +@@ -51,7 +51,7 @@ def parse_actions(ddir, conduit): + line = line.strip() + if line and line[0] != "#": + try: +- (a_key, a_state, a_command) = line.split(':') ++ (a_key, a_state, a_command) = line.split(':', 2) + except ValueError,e: + conduit.error(2,'Bad Action Line: %s' % line) + continue +@@ -93,6 +93,17 @@ def _convert_vars(txmbr, command): + result = varReplace(command, vardict) + return result + ++ ++def pretrans_hook(conduit): ++ # Prefetch filelist for packages to be removed, ++ # otherwise for updated packages headers will not be available ++ ts = conduit.getTsInfo() ++ removes = ts.getMembersWithState(output_states=TS_REMOVE_STATES) ++ ++ for txmbr in removes: ++ txmbr.po.filelist ++ ++ + def posttrans_hook(conduit): + # we have provides/requires for everything + # we do not have filelists for erasures +@@ -129,8 +140,10 @@ def posttrans_hook(conduit): for txmbr in pkgset: matched = False @@ -3975,7 +4495,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..2390e79 100755 +index a3bb111..af70518 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -4321,7 +4841,16 @@ index a3bb111..2390e79 100755 def main(args): -@@ -1198,6 +1283,10 @@ def main(args): +@@ -1172,6 +1257,8 @@ def main(args): + help="run from cache only") + parser.add_option("--tempcache", action="store_true", + help="use private cache (default when used as non-root)") ++ parser.add_option("--nolock", action="store_true", ++ help="disable locking (can only be used when running from cached tempcache)") + parser.add_option("--querytags", action="store_true", + help="list available tags in queryformat queries") + parser.add_option("-c", "--config", dest="conffile", +@@ -1198,6 +1285,10 @@ def main(args): parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") @@ -4332,7 +4861,7 @@ index a3bb111..2390e79 100755 (opts, regexs) = parser.parse_args() -@@ -1261,9 +1350,10 @@ def main(args): +@@ -1261,9 +1352,10 @@ def main(args): if opts.srpm: needsource = 1 if opts.whatrequires: @@ -4344,7 +4873,7 @@ index a3bb111..2390e79 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1280,7 +1370,6 @@ def main(args): +@@ -1280,7 +1372,6 @@ def main(args): needgroup = 1 if opts.installed: opts.pkgnarrow = 'installed' @@ -4352,7 +4881,7 @@ index a3bb111..2390e79 100755 if opts.nevra: pkgops.append("nevra") -@@ -1303,6 +1392,13 @@ def main(args): +@@ -1303,6 +1394,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -4366,7 +4895,7 @@ index a3bb111..2390e79 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1312,7 +1408,26 @@ def main(args): +@@ -1312,7 +1410,26 @@ def main(args): repoq.preconf.fn = opts.conffile repoq.preconf.debuglevel = initnoise repoq.preconf.init_plugins = opts.plugins @@ -4394,7 +4923,7 @@ index a3bb111..2390e79 100755 if opts.repofrompath: # setup the fake repos -@@ -1327,8 +1442,13 @@ def main(args): +@@ -1327,8 +1444,13 @@ def main(args): else: baseurl = repopath @@ -4410,7 +4939,19 @@ index a3bb111..2390e79 100755 if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) -@@ -1359,6 +1479,13 @@ def main(args): +@@ -1345,6 +1467,11 @@ def main(args): + repoq.repos.setProgressBar(TextMeter(fo=sys.stdout)) + repoq.repos.callback = output.CacheProgressCallback() + repoq.repos.setFailureCallback(freport) ++ ++ if opts.nolock and not opts.tempcache: ++ opts.tempcache = True ++ if opts.nolock and not opts.cache: ++ opts.cache = True + + if not repoq.setCacheDir(opts.tempcache): + repoq.logger.error("Error: Could not make cachedir, exiting") +@@ -1359,6 +1486,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -4424,11 +4965,11 @@ index a3bb111..2390e79 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1380,6 +1507,14 @@ def main(args): +@@ -1380,6 +1514,14 @@ def main(args): for repo in repoq.repos.findRepos(repo_match): repo.enable() -+ while True: ++ while not opts.nolock: + try: repoq.doLock(); break + except yum.Errors.LockError, e: pass + repoq.logger.error(e) @@ -4439,7 +4980,7 @@ index a3bb111..2390e79 100755 try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) -@@ -1396,10 +1531,12 @@ def main(args): +@@ -1396,10 +1538,12 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -4454,7 +4995,7 @@ index a3bb111..2390e79 100755 if __name__ == "__main__": misc.setup_locale() diff --git a/reposync.py b/reposync.py -index 7950854..6500db6 100755 +index 7950854..541ab9d 100755 --- a/reposync.py +++ b/reposync.py @@ -11,8 +11,8 @@ @@ -4726,21 +5267,40 @@ index 7950854..6500db6 100755 if not opts.urls: for pkg in download_list: remote = pkg.returnSimple('relativepath') -@@ -276,75 +279,48 @@ def main(): +@@ -276,75 +279,54 @@ def main(): if hasattr(urlgrabber.progress, 'text_meter_total_size'): urlgrabber.progress.text_meter_total_size(remote_size) - download_list.sort(sortPkgObj) - n = 0 -- for pkg in download_list: ++ download_list.sort(key=lambda pkg: pkg.name) ++ if opts.urls: ++ for pkg in download_list: ++ remote = pkg.returnSimple('relativepath') ++ local = os.path.join(local_repo_path, remote) ++ if not (os.path.exists(local) and my.verifyPkg(local, pkg, False)): ++ print urljoin(pkg.repo.urls[0], pkg.relativepath) ++ continue ++ ++ # create dest dir ++ if not os.path.exists(local_repo_path): ++ os.makedirs(local_repo_path) ++ ++ # set localpaths + for pkg in download_list: - n = n + 1 - repo = my.repos.getRepo(pkg.repoid) - remote = pkg.returnSimple('relativepath') - local = local_repo_path + '/' + remote - localdir = os.path.dirname(local) -- if not os.path.exists(localdir): -- os.makedirs(localdir) -- ++ rpmfn = pkg.remote_path ++ pkg.localpath = os.path.join(local_repo_path, rpmfn) ++ pkg.repo.copy_local = True ++ pkg.repo.cache = 0 ++ localdir = os.path.dirname(pkg.localpath) + if not os.path.exists(localdir): + os.makedirs(localdir) + - sz = int(pkg.returnSimple('packagesize')) - if os.path.exists(local) and os.path.getsize(local) == sz: - @@ -4778,27 +5338,6 @@ index 7950854..6500db6 100755 - my.logger.error("Could not retrieve package %s. Error was %s" % (pkg, str(e))) - local_size += sz - continue -+ download_list.sort(key=lambda pkg: pkg.name) -+ if opts.urls: -+ for pkg in download_list: -+ print urljoin(pkg.repo.urls[0], pkg.relativepath) -+ return 0 - -- local_size += sz -- if hasattr(urlgrabber.progress, 'text_meter_total_size'): -- urlgrabber.progress.text_meter_total_size(remote_size, local_size) -- if opts.gpgcheck: -+ # create dest dir -+ if not os.path.exists(local_repo_path): -+ os.makedirs(local_repo_path) -+ -+ # set localpaths -+ for pkg in download_list: -+ rpmfn = os.path.basename(pkg.remote_path) -+ pkg.localpath = os.path.join(local_repo_path, rpmfn) -+ pkg.repo.copy_local = True -+ pkg.repo.cache = 0 -+ + # use downloader from YumBase + probs = my.downloadPkgs(download_list) + if probs: @@ -4806,7 +5345,11 @@ index 7950854..6500db6 100755 + for key in probs: + for error in probs[key]: + my.logger.error('%s: %s', key, error) -+ + +- local_size += sz +- if hasattr(urlgrabber.progress, 'text_meter_total_size'): +- urlgrabber.progress.text_meter_total_size(remote_size, local_size) +- if opts.gpgcheck: + if opts.gpgcheck: + for pkg in download_list: result, error = my.sigCheckPkg(pkg) @@ -5083,7 +5626,7 @@ index d1fe5e2..78e8264 100755 group = my.comps.return_group('core') for pname in group.mandatory_packages: diff --git a/yum-builddep.py b/yum-builddep.py -index d7a37c3..216066e 100755 +index d7a37c3..7c40713 100755 --- a/yum-builddep.py +++ b/yum-builddep.py @@ -8,17 +8,18 @@ @@ -5127,18 +5670,19 @@ index d7a37c3..216066e 100755 self.main() def main(self): -@@ -86,6 +92,10 @@ class YumBuildDep(YumUtilBase): +@@ -86,6 +92,11 @@ class YumBuildDep(YumUtilBase): self.logger.error("Error: You must be root to install packages") sys.exit(1) -+ # Use source rpms -+ self.arch.archlist.append('src') -+ self.setupSourceRepos() ++ if not all(cmd.endswith('.spec') or cmd.endswith('.src.rpm') for cmd in self.cmds): ++ # Use source rpms ++ self.arch.archlist.append('src') ++ self.setupSourceRepos() + # Setup yum (Ts, RPM db, Repo & Sack) self.doUtilYumSetup() # Do the real action -@@ -116,30 +126,26 @@ class YumBuildDep(YumUtilBase): +@@ -116,30 +127,26 @@ class YumBuildDep(YumUtilBase): def setupSourceRepos(self): # enable the -source repos for enabled primary repos @@ -5178,7 +5722,7 @@ index d7a37c3..216066e 100755 for dep in deplist: self.logger.debug(' REQ: %s' % dep) if dep.startswith("rpmlib("): -@@ -152,10 +158,13 @@ class YumBuildDep(YumUtilBase): +@@ -152,10 +159,13 @@ class YumBuildDep(YumUtilBase): pkg = self.returnPackageByDep(dep) self.logger.info(' --> %s' % pkg) self.install(pkg) @@ -5195,7 +5739,7 @@ index d7a37c3..216066e 100755 # go through each of the pkgs, figure out what they are/where they are # if they are not a local package then run -@@ -170,10 +179,14 @@ class YumBuildDep(YumUtilBase): +@@ -170,10 +180,14 @@ class YumBuildDep(YumUtilBase): specnames = [] srpms = [] specworks = False @@ -5210,7 +5754,7 @@ index d7a37c3..216066e 100755 for arg in self.cmds: if arg.endswith('.src.rpm'): -@@ -192,7 +205,6 @@ class YumBuildDep(YumUtilBase): +@@ -192,7 +206,6 @@ class YumBuildDep(YumUtilBase): toActOn = [] if srcnames: @@ -5218,7 +5762,7 @@ index d7a37c3..216066e 100755 pkgs = self.pkgSack.returnPackages(patterns=srcnames) exact, match, unmatch = yum.packages.parsePackages(pkgs, srcnames, casematch=1) srpms += exact + match -@@ -206,22 +218,30 @@ class YumBuildDep(YumUtilBase): +@@ -206,22 +219,30 @@ class YumBuildDep(YumUtilBase): sys.exit(1) toActOn = [] @@ -5312,7 +5856,7 @@ index c5074ab..6b01e4e 100755 diff --git a/yum-config-manager.py b/yum-config-manager.py -index 50f5123..46b71b7 100755 +index 50f5123..380a54f 100755 --- a/yum-config-manager.py +++ b/yum-config-manager.py @@ -7,8 +7,11 @@ import yum @@ -5358,17 +5902,22 @@ index 50f5123..46b71b7 100755 if opts.enable or opts.disable: opts.save = True -@@ -161,7 +170,8 @@ if opts.enable or opts.disable: +@@ -161,7 +170,13 @@ if opts.enable or opts.disable: only = ['enabled'] if args: - repos = yb.repos.findRepos(','.join(args)) + repos = yb.repos.findRepos(','.join(args), + name_match=True, ignore_case=True) ++elif hasattr(yb, 'repo_setopts') and yb.repo_setopts: ++ repos =yb.repos.findRepos(','.join(yb.repo_setopts.keys()), ++ name_match=True, ignore_case=True) ++ ++ else: repos = yb.repos.listEnabled() -@@ -174,7 +184,7 @@ if not opts.addrepo: +@@ -174,7 +189,7 @@ if not opts.addrepo: repo.disable() print repo.dump() if (opts.save and @@ -5377,7 +5926,7 @@ index 50f5123..46b71b7 100755 writeRawConfigFile(repo.repofile, repo.id, repo.yumvar, repo.cfg.options, repo.iteritems, repo.optionobj, only) -@@ -196,13 +206,16 @@ if opts.addrepo: +@@ -196,13 +211,16 @@ if opts.addrepo: if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it destname = os.path.basename(url) destname = myrepodir + '/' + destname @@ -5813,7 +6362,7 @@ index 1d37231..04b78a7 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..dd206b3 100644 +index ce7fb64..cac5cdf 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -5914,7 +6463,23 @@ index ce7fb64..dd206b3 100644 %description -n yum-plugin-fs-snapshot When this plugin is installed it will automatically snapshot any -@@ -395,11 +380,8 @@ plugins="\ +@@ -378,6 +363,15 @@ Requires: puppet + %description -n yum-plugin-puppetverify + Supplies checksums for files in packages from puppet's state file. + ++%package -n yum-plugin-copr ++Summary: Yum plugin to add copr command ++Group: System Environment/Base ++Provides: yum-copr = %{version}-%{release} ++Requires: yum >= 3.4.3 ++ ++%description -n yum-plugin-copr ++This plugin adds the command copr, for adding/listing/searching copr repos. ++ + %prep + %setup -q + +@@ -395,11 +389,8 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -5926,17 +6491,20 @@ index ce7fb64..dd206b3 100644 upgrade-helper \ aliases \ list-data \ -@@ -418,14 +400,20 @@ plugins="\ +@@ -416,16 +407,23 @@ plugins="\ + fs-snapshot \ + ps \ puppetverify \ - " - --mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ ++ copr \ ++" ++ +%if %{package_yum_updatesd} +plugins="$plugins \ + refresh-updatesd \ -+" + " +%endif -+ + +-mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/usr/lib/yum-plugins/ +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/%pluginhome mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/post-actions @@ -5950,7 +6518,18 @@ index ce7fb64..dd206b3 100644 done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ -@@ -469,8 +457,8 @@ fi +@@ -433,6 +431,10 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p + mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d + touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo + ++%check ++# To execute: ./test/test-all ++# Tests are not suitable for running at build time ++# because they require networking and a populated /var/cache/yum + + %clean + rm -rf $RPM_BUILD_ROOT +@@ -469,8 +471,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -5960,7 +6539,7 @@ index ce7fb64..dd206b3 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,10 +475,19 @@ fi +@@ -487,10 +489,19 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -5980,7 +6559,7 @@ index ce7fb64..dd206b3 100644 %files -n yum-updateonboot %defattr(-, root, root) -@@ -502,7 +499,7 @@ fi +@@ -502,7 +513,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING @@ -5989,7 +6568,7 @@ index ce7fb64..dd206b3 100644 %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* -@@ -510,20 +507,20 @@ fi +@@ -510,20 +521,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf @@ -6013,7 +6592,7 @@ index ce7fb64..dd206b3 100644 %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* -@@ -531,85 +528,74 @@ fi +@@ -531,85 +542,74 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf @@ -6112,7 +6691,7 @@ index ce7fb64..dd206b3 100644 %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) -@@ -619,13 +605,13 @@ fi +@@ -619,13 +619,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING @@ -6128,7 +6707,7 @@ index ce7fb64..dd206b3 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. -@@ -634,19 +620,19 @@ fi +@@ -634,19 +634,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING @@ -6151,7 +6730,7 @@ index ce7fb64..dd206b3 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -@@ -654,13 +640,13 @@ fi +@@ -654,13 +654,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf @@ -6167,7 +6746,7 @@ index ce7fb64..dd206b3 100644 %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* -@@ -668,13 +654,13 @@ fi +@@ -668,13 +668,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf @@ -6180,6 +6759,13 @@ index ce7fb64..dd206b3 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf -/usr/lib/yum-plugins/puppetverify.* +%{pluginhome}/puppetverify.* ++ ++%files -n yum-plugin-copr ++%defattr(-, root, root) ++%doc COPYING ++%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/copr.conf ++%{pluginhome}/copr.* ++%{_mandir}/man8/yum-copr.8.* %changelog * Thu Aug 10 2011 Tim Lauridsen diff --git a/yum-utils.spec b/yum-utils.spec index 4490880..9fbbcae 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 24%{?dist} +Release: 25%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -336,6 +336,7 @@ repo. removes it (and can thus. be reinstalled/downgraded/etc.). Summary: Yum plugin to automatically snapshot your filesystems during updates Group: System Environment/Base Requires: yum >= 3.2.22 +Requires: btrfs-progs %description -n yum-plugin-fs-snapshot When this plugin is installed it will automatically snapshot any @@ -362,6 +363,15 @@ Requires: puppet %description -n yum-plugin-puppetverify Supplies checksums for files in packages from puppet's state file. +%package -n yum-plugin-copr +Summary: Yum plugin to add copr command +Group: System Environment/Base +Provides: yum-copr = %{version}-%{release} +Requires: yum >= 3.4.3 + +%description -n yum-plugin-copr +This plugin adds the command copr, for adding/listing/searching copr repos. + %prep %setup -q %patch1 -p1 @@ -398,6 +408,7 @@ plugins="\ fs-snapshot \ ps \ puppetverify \ + copr \ " %if %{package_yum_updatesd} @@ -662,7 +673,27 @@ fi %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf %{pluginhome}/puppetverify.* +%files -n yum-plugin-copr +%defattr(-, root, root) +%doc COPYING +%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/copr.conf +%{pluginhome}/copr.* +%{_mandir}/man8/yum-copr.8.* + %changelog +* Tue Sep 23 2014 James Antill - 1.1.31-25 +- Update to latest HEAD +- Initial port of DNF copr plugin to yum API. +- reposync: check for existing packages when using -u option. BZ 1140864 +- Add --nolock option to repoquery, so queries can be run in parallel. +- reposync: preserve directory structure. BZ 1139032 +- yum-builddep: don't setup source repos if a local srpm or spec file is specified. BZ 1113167 +- yum-post-transaction-actions: allow colons in command part. BZ 1134989 +- reposync: show urls for all repos when using -u option. BZ 1133125 +- post-transaction-actions: preload filelists for packages to be removed. BZ 1127782. +- needs-restarting: catch IOError. BZ 1127191 +- yum-config-manager: make --setopt work without providing repo name twice. + * Sat Jun 07 2014 Fedora Release Engineering - 1.1.31-24 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild From 3ee4efda22799cc1002d5a7eb6c209734f367458 Mon Sep 17 00:00:00 2001 From: Valentina Mukhamedzhanova Date: Thu, 13 Nov 2014 12:14:36 +0100 Subject: [PATCH 23/55] Update to latest HEAD - reposync: add --download-metadata to the man page. BZ 1079435 - Add python-requests to Requires of copr plugin. BZ 1158395 - Change type of copr plugin to INTERACTIVE. BZ 1161956 --- yum-utils-HEAD.patch | 43 +++++++++++++++++++++++-------------------- yum-utils.spec | 8 +++++++- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 0b3f971..b58cb70 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -792,7 +792,7 @@ index f5a8c5d..ead5a18 100644 Additionally wildcards (shell-style globs) can be used. diff --git a/docs/reposync.1 b/docs/reposync.1 -index c1bc818..d6d245a 100644 +index c1bc818..5a5b092 100644 --- a/docs/reposync.1 +++ b/docs/reposync.1 @@ -1,7 +1,7 @@ @@ -804,7 +804,7 @@ index c1bc818..d6d245a 100644 .SH "SYNOPSIS" \fBreposync\fP [options] .SH "DESCRIPTION" -@@ -14,33 +14,48 @@ Display a help message, and then quit. +@@ -14,33 +14,50 @@ Display a help message, and then quit. Config file to use (defaults to /etc/yum.conf). .IP "\fB\-a ARCH, \-\-arch=ARCH\fP" Act as if running the specified arch (default: current arch, note: does @@ -815,7 +815,7 @@ index c1bc818..d6d245a 100644 .IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" Specify repo ids to query, can be specified multiple times (default is all enabled). -+.IP "\fB\-e\ CACHEDIR, \-\-cachedir CACHEDIR\fP", ++.IP "\fB\-e\ CACHEDIR, \-\-cachedir CACHEDIR\fP" +Directory in which to store metadata. .IP "\fB\-t, \-\-tempcache\fP" Use a temp dir for storing/accessing yum-cache. @@ -837,6 +837,8 @@ index c1bc818..d6d245a 100644 +Enable yum plugin support. +.IP "\fB\-m, \-\-downloadcomps\fP" +Also download comps.xml. ++.IP "\fB\-\-download-metadata\fP" ++Download all the non-default metadata +.IP "\fB\-n, \-\-newest\-only\fP" Download only newest packages per-repo. .IP "\fB\-q, \-\-quiet\fP" @@ -2341,7 +2343,7 @@ index 0000000..8e4d76c +enabled=1 diff --git a/plugins/copr/copr.py b/plugins/copr/copr.py new file mode 100644 -index 0000000..6d922ce +index 0000000..86e4d5f --- /dev/null +++ b/plugins/copr/copr.py @@ -0,0 +1,327 @@ @@ -2377,10 +2379,10 @@ index 0000000..6d922ce +import urllib + +from yum.i18n import _ -+from yum.plugins import TYPE_CORE ++from yum.plugins import TYPE_INTERACTIVE + +requires_api_version = '2.5' -+plugin_type = TYPE_CORE ++plugin_type = (TYPE_INTERACTIVE,) + +yes = set([_('yes'), _('y')]) +no = set([_('no'), _('n'), '']) @@ -6362,7 +6364,7 @@ index 1d37231..04b78a7 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..cac5cdf 100644 +index ce7fb64..c1d0045 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -6463,7 +6465,7 @@ index ce7fb64..cac5cdf 100644 %description -n yum-plugin-fs-snapshot When this plugin is installed it will automatically snapshot any -@@ -378,6 +363,15 @@ Requires: puppet +@@ -378,6 +363,16 @@ Requires: puppet %description -n yum-plugin-puppetverify Supplies checksums for files in packages from puppet's state file. @@ -6472,6 +6474,7 @@ index ce7fb64..cac5cdf 100644 +Group: System Environment/Base +Provides: yum-copr = %{version}-%{release} +Requires: yum >= 3.4.3 ++Requires: python-requests + +%description -n yum-plugin-copr +This plugin adds the command copr, for adding/listing/searching copr repos. @@ -6479,7 +6482,7 @@ index ce7fb64..cac5cdf 100644 %prep %setup -q -@@ -395,11 +389,8 @@ plugins="\ +@@ -395,11 +390,8 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -6491,7 +6494,7 @@ index ce7fb64..cac5cdf 100644 upgrade-helper \ aliases \ list-data \ -@@ -416,16 +407,23 @@ plugins="\ +@@ -416,16 +408,23 @@ plugins="\ fs-snapshot \ ps \ puppetverify \ @@ -6518,7 +6521,7 @@ index ce7fb64..cac5cdf 100644 done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ -@@ -433,6 +431,10 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p +@@ -433,6 +432,10 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo @@ -6529,7 +6532,7 @@ index ce7fb64..cac5cdf 100644 %clean rm -rf $RPM_BUILD_ROOT -@@ -469,8 +471,8 @@ fi +@@ -469,8 +472,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -6539,7 +6542,7 @@ index ce7fb64..cac5cdf 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,10 +489,19 @@ fi +@@ -487,10 +490,19 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -6559,7 +6562,7 @@ index ce7fb64..cac5cdf 100644 %files -n yum-updateonboot %defattr(-, root, root) -@@ -502,7 +513,7 @@ fi +@@ -502,7 +514,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING @@ -6568,7 +6571,7 @@ index ce7fb64..cac5cdf 100644 %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* -@@ -510,20 +521,20 @@ fi +@@ -510,20 +522,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf @@ -6592,7 +6595,7 @@ index ce7fb64..cac5cdf 100644 %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* -@@ -531,85 +542,74 @@ fi +@@ -531,85 +543,74 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf @@ -6691,7 +6694,7 @@ index ce7fb64..cac5cdf 100644 %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) -@@ -619,13 +619,13 @@ fi +@@ -619,13 +620,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING @@ -6707,7 +6710,7 @@ index ce7fb64..cac5cdf 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. -@@ -634,19 +634,19 @@ fi +@@ -634,19 +635,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING @@ -6730,7 +6733,7 @@ index ce7fb64..cac5cdf 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -@@ -654,13 +654,13 @@ fi +@@ -654,13 +655,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf @@ -6746,7 +6749,7 @@ index ce7fb64..cac5cdf 100644 %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* -@@ -668,13 +668,20 @@ fi +@@ -668,13 +669,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf diff --git a/yum-utils.spec b/yum-utils.spec index 9fbbcae..47d3116 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 25%{?dist} +Release: 26%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -681,6 +681,12 @@ fi %{_mandir}/man8/yum-copr.8.* %changelog +* Thu Nov 13 2014 Valentina Mukhamedzhanova - 1.1.31-26 +- Update to latest HEAD +- reposync: add --download-metadata to the man page. BZ 1079435 +- Add python-requests to Requires of copr plugin. BZ 1158395 +- Change type of copr plugin to INTERACTIVE. BZ 1161956 + * Tue Sep 23 2014 James Antill - 1.1.31-25 - Update to latest HEAD - Initial port of DNF copr plugin to yum API. From 3d94e6e0c3257627be83498035d9510e17bf23ad Mon Sep 17 00:00:00 2001 From: Valentina Mukhamedzhanova Date: Thu, 13 Nov 2014 13:01:12 +0100 Subject: [PATCH 24/55] Add python-requests to Requires of copr plugin. BZ 1158395 --- yum-utils.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 47d3116..22274eb 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 26%{?dist} +Release: 27%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -368,6 +368,7 @@ Summary: Yum plugin to add copr command Group: System Environment/Base Provides: yum-copr = %{version}-%{release} Requires: yum >= 3.4.3 +Requires: python-requests %description -n yum-plugin-copr This plugin adds the command copr, for adding/listing/searching copr repos. @@ -681,10 +682,12 @@ fi %{_mandir}/man8/yum-copr.8.* %changelog +* Thu Nov 13 2014 Valentina Mukhamedzhanova - 1.1.31-27 +- Add python-requests to Requires of copr plugin. BZ 1158395 + * Thu Nov 13 2014 Valentina Mukhamedzhanova - 1.1.31-26 - Update to latest HEAD - reposync: add --download-metadata to the man page. BZ 1079435 -- Add python-requests to Requires of copr plugin. BZ 1158395 - Change type of copr plugin to INTERACTIVE. BZ 1161956 * Tue Sep 23 2014 James Antill - 1.1.31-25 From 8136a6d1fd8aedc029d39958fbc3c9f9ee84844b Mon Sep 17 00:00:00 2001 From: Valentina Mukhamedzhanova Date: Tue, 31 Mar 2015 09:59:30 +0200 Subject: [PATCH 25/55] Add 'deprecated' message to all utils. --- yum-utils-HEAD.patch | 8 +- yum-utils-deprecated.patch | 495 +++++++++++++++++++++++++++++++++++++ yum-utils.spec | 7 +- 3 files changed, 506 insertions(+), 4 deletions(-) create mode 100644 yum-utils-deprecated.patch diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index b58cb70..8e4ecc3 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -616,7 +616,7 @@ index 0000000..4d336a5 +See the Authors file included with this program. +.fi diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..ead5a18 100644 +index f5a8c5d..def752f 100644 --- a/docs/repoquery.1 +++ b/docs/repoquery.1 @@ -1,11 +1,11 @@ @@ -633,11 +633,13 @@ index f5a8c5d..ead5a18 100644 .SH "DESCRIPTION" .PP \fBrepoquery\fP is a program for querying information from YUM repositories -@@ -14,11 +14,11 @@ similarly to rpm queries. +@@ -13,12 +13,12 @@ similarly to rpm queries. + .PP .SH "GENERAL OPTIONS" .IP "\fB\-\-querytags\fP" - List valid queryformat tags and exit.. +-List valid queryformat tags and exit.. -.IP "\fB\-v, \-\-version\fP" ++List valid queryformat tags and exit. +.IP "\fB\-\-version\fP" Report program version and exit. .IP "\fB\-\-repoid=\fP" diff --git a/yum-utils-deprecated.patch b/yum-utils-deprecated.patch new file mode 100644 index 0000000..8e7ffc5 --- /dev/null +++ b/yum-utils-deprecated.patch @@ -0,0 +1,495 @@ +diff --git a/debuginfo-install.py b/debuginfo-install.py +index bb61a1d..5252d72 100755 +--- a/debuginfo-install.py ++++ b/debuginfo-install.py +@@ -23,6 +23,7 @@ import yum.Errors + + from utils import YumUtilBase + from yum import _ ++from yumutils.deprecated import deprecated_warning + + import logging + import rpmUtils +@@ -196,5 +197,6 @@ if __name__ == '__main__': + import codecs + sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) + sys.stdout.errors = 'replace' +- ++ ++ deprecated_warning() + util = DebugInfoInstall() +diff --git a/find-repos-of-install.py b/find-repos-of-install.py +index aac29ea..f4dada8 100644 +--- a/find-repos-of-install.py ++++ b/find-repos-of-install.py +@@ -19,9 +19,12 @@ import os + import os.path + + from optparse import OptionParser ++from yumutils.deprecated import deprecated_warning + + import yum + ++deprecated_warning() ++ + my = yum.YumBase() + my.conf.showdupesfromrepos = 1 + +diff --git a/needs-restarting.py b/needs-restarting.py +index b0e540b..a9ba04e 100755 +--- a/needs-restarting.py ++++ b/needs-restarting.py +@@ -45,6 +45,7 @@ import glob + import stat + from optparse import OptionParser + from yum.Errors import RepoError ++from yumutils.deprecated import deprecated_warning + sys.path.insert(0,'/usr/share/yum-cli') + import utils + +@@ -175,6 +176,7 @@ def main(args): + + if __name__ == "__main__": + try: ++ deprecated_warning() + sys.exit(main(sys.argv)) + except RepoError, e: + print >>sys.stderr, e +diff --git a/package-cleanup.py b/package-cleanup.py +index acad9f2..9c3a474 100755 +--- a/package-cleanup.py ++++ b/package-cleanup.py +@@ -34,6 +34,7 @@ import yum.depsolve # For flags + from yum.Errors import YumBaseError + from rpmUtils import miscutils, arch + from optparse import OptionGroup ++from yumutils.deprecated import deprecated_warning + + def exactlyOne(l): + return len(filter(None, l)) == 1 +@@ -397,4 +398,5 @@ class PackageCleanup(YumUtilBase): + + if __name__ == '__main__': + setup_locale() ++ deprecated_warning() + util = PackageCleanup() +diff --git a/repo-check.py b/repo-check.py +index 2aa8bde..f2ce616 100755 +--- a/repo-check.py ++++ b/repo-check.py +@@ -19,6 +19,7 @@ sys.path.insert(0,'/usr/share/yum-cli') + import logging + from utils import YumUtilBase + from yum.misc import getCacheDir, setup_locale ++from yumutils.deprecated import deprecated_warning + + import yum.Errors + +@@ -238,5 +239,6 @@ class RepoCheck(YumUtilBase): + + if __name__ == '__main__': + setup_locale() ++ deprecated_warning() + util = RepoCheck() + +diff --git a/repo-graph.py b/repo-graph.py +index bca41d0..72880fc 100755 +--- a/repo-graph.py ++++ b/repo-graph.py +@@ -23,6 +23,7 @@ import yum + import sys + from yum.misc import getCacheDir + from optparse import OptionParser ++from yumutils.deprecated import deprecated_warning + + default_header = """ + size="20.69,25.52"; +@@ -94,6 +95,7 @@ class yumQuiet(yum.YumBase): + return requires + + if __name__ == '__main__': ++ deprecated_warning() + parser = OptionParser() + parser.add_option("--repoid", default=[], action="append", + help="specify repositories to use") +diff --git a/repo-rss.py b/repo-rss.py +index 871e338..5d9c249 100755 +--- a/repo-rss.py ++++ b/repo-rss.py +@@ -20,6 +20,7 @@ import yum.Errors + from yum.misc import getCacheDir, to_unicode + from yum.comps import Comps, CompsException + from yum.Errors import RepoMDError ++from yumutils.deprecated import deprecated_warning + import sys + import os + import libxml2 +@@ -252,6 +253,7 @@ def main(options, args): + + + if __name__ == "__main__": ++ deprecated_warning() + usage = "repo-rss.py [options] repoid1 repoid2" + + parser = OptionParser(usage=usage) +diff --git a/repoclosure.py b/repoclosure.py +index f895f84..693b67d 100755 +--- a/repoclosure.py ++++ b/repoclosure.py +@@ -32,6 +32,7 @@ import rpmUtils.arch + import rpmUtils.updates + from yum.constants import * + from yum.packageSack import ListPackageSack ++from yumutils.deprecated import deprecated_warning + + def parseArgs(): + usage = """ +@@ -303,6 +304,7 @@ def main(): + + if __name__ == "__main__": + try: ++ deprecated_warning() + main() + except (yum.Errors.YumBaseError, ValueError), e: + print >> sys.stderr, str(e) +diff --git a/repodiff.py b/repodiff.py +index 5ae1d8f..44092df 100755 +--- a/repodiff.py ++++ b/repodiff.py +@@ -21,6 +21,7 @@ import os + import locale + import rpmUtils.arch + from yum.i18n import to_unicode ++from yumutils.deprecated import deprecated_warning + + from urlgrabber.progress import format_number + +@@ -371,4 +372,5 @@ def main(args): + + if __name__ == "__main__": + yum.misc.setup_locale(override_time=True) ++ deprecated_warning() + main(sys.argv[1:]) +diff --git a/repomanage.py b/repomanage.py +index bef3b03..6ffd8f5 100755 +--- a/repomanage.py ++++ b/repomanage.py +@@ -27,6 +27,7 @@ import fnmatch + import string + import rpmUtils + from yum import misc ++from yumutils.deprecated import deprecated_warning + + from optparse import OptionParser + +@@ -221,6 +222,7 @@ def usage(): + + + if __name__ == "__main__": ++ deprecated_warning() + if len(sys.argv) < 1: + usage() + sys.exit(1) +diff --git a/repoquery.py b/repoquery.py +index af70518..7b4fed3 100755 +--- a/repoquery.py ++++ b/repoquery.py +@@ -37,6 +37,7 @@ import yum.config + import yum.Errors + import yum.packages + from yum.i18n import to_unicode ++from yumutils.deprecated import deprecated_warning + from rpmUtils.arch import getArchList, getBaseArch + from rpmUtils.miscutils import formatRequire + import output +@@ -1547,6 +1548,7 @@ def main(args): + + if __name__ == "__main__": + misc.setup_locale() ++ deprecated_warning() + main(sys.argv) + + # vim:sw=4:sts=4:expandtab +diff --git a/reposync.py b/reposync.py +index 541ab9d..09133b5 100755 +--- a/reposync.py ++++ b/reposync.py +@@ -41,6 +41,7 @@ from optparse import OptionParser + from urlparse import urljoin + + from yumutils.i18n import _ ++from yumutils.deprecated import deprecated_warning + + import yum + import yum.Errors +@@ -329,4 +330,5 @@ def main(): + sys.exit(exit_code) + + if __name__ == "__main__": ++ deprecated_warning() + main() +diff --git a/repotrack.py b/repotrack.py +index 8dd8b9c..618d8f3 100755 +--- a/repotrack.py ++++ b/repotrack.py +@@ -37,6 +37,7 @@ from yum.misc import getCacheDir + from yum.constants import * + from yum.packages import parsePackages + from yum.packageSack import ListPackageSack ++from yumutils.deprecated import deprecated_warning + + class RepoTrack(yum.YumBase): + def __init__(self, opts): +@@ -243,5 +244,6 @@ def main(): + shutil.copy2(path, local) + + if __name__ == "__main__": ++ deprecated_warning() + main() + +diff --git a/show-changed-rco.py b/show-changed-rco.py +index f314ef0..0c0ed05 100755 +--- a/show-changed-rco.py ++++ b/show-changed-rco.py +@@ -22,6 +22,7 @@ import os + + from optparse import OptionParser + from optparse import SUPPRESS_HELP ++from yumutils.deprecated import deprecated_warning + + version = "1.0.0" + +@@ -306,4 +307,5 @@ def main(): + + if __name__ == "__main__": + yum.misc.setup_locale() ++ deprecated_warning() + main() +diff --git a/show-installed.py b/show-installed.py +index 65aae11..674414c 100755 +--- a/show-installed.py ++++ b/show-installed.py +@@ -7,6 +7,7 @@ TODO: + + import yum + from optparse import OptionParser ++from yumutils.deprecated import deprecated_warning + import sys + + __stateprefixes = { +@@ -406,4 +407,5 @@ def __main__(): + p.writeList() + + if __name__ == "__main__": ++ deprecated_warning() + __main__() +diff --git a/verifytree.py b/verifytree.py +index 78e8264..76fd453 100755 +--- a/verifytree.py ++++ b/verifytree.py +@@ -20,6 +20,7 @@ import os + from yum.misc import getCacheDir, checksum + import urlparse + from yum import Errors ++from yumutils.deprecated import deprecated_warning + from optparse import OptionParser + import ConfigParser + +@@ -285,5 +286,6 @@ def main(): + return retval + + if __name__ == "__main__": ++ deprecated_warning() + rc = main() + sys.exit(rc) +diff --git a/yum-builddep.py b/yum-builddep.py +index 7c40713..7b3c8a1 100755 +--- a/yum-builddep.py ++++ b/yum-builddep.py +@@ -22,6 +22,7 @@ from yum.misc import setup_locale + from yum.i18n import exception2msg + import yum.Errors + from utils import YumUtilBase ++from yumutils.deprecated import deprecated_warning + + import logging + import rpmUtils +@@ -252,6 +253,7 @@ class YumBuildDep(YumUtilBase): + + if __name__ == '__main__': + setup_locale() ++ deprecated_warning() + util = YumBuildDep() + + +diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py +index 6b01e4e..0000412 100755 +--- a/yum-complete-transaction.py ++++ b/yum-complete-transaction.py +@@ -22,6 +22,7 @@ from yum.misc import setup_locale + + from utils import YumUtilBase + from yum.constants import TS_REMOVE_STATES ++from yumutils.deprecated import deprecated_warning + + import logging + import os +@@ -263,6 +264,7 @@ class YumCompleteTransaction(YumUtilBase): + + if __name__ == '__main__': + setup_locale() ++ deprecated_warning() + util = YumCompleteTransaction() + + +diff --git a/yum-config-manager.py b/yum-config-manager.py +index 380a54f..f751cb4 100755 +--- a/yum-config-manager.py ++++ b/yum-config-manager.py +@@ -14,6 +14,8 @@ import yum.config + import yum.yumRepo + + from yum.parser import varReplace ++from yumutils.deprecated import deprecated_warning ++ + + # Regular expressions to sanitise cache filenames + re_url_scheme = re.compile(r'^\w+:/*(\w+:|www\.)?') +@@ -110,6 +112,7 @@ VERSION = '1.0' + USAGE = '"yum-config-manager [options] [section]' + + yum.misc.setup_locale() ++deprecated_warning() + + yb = YumUtilBase(NAME, VERSION, USAGE) + logger = logging.getLogger("yum.verbose.cli.yum-config-manager") +diff --git a/yum-debug-dump.py b/yum-debug-dump.py +index 67d943f..fce26f7 100755 +--- a/yum-debug-dump.py ++++ b/yum-debug-dump.py +@@ -22,6 +22,7 @@ import time + import yum + from yum import Errors + from yum.misc import getCacheDir ++from yumutils.deprecated import deprecated_warning + from rpmUtils import miscutils + import gzip + import rpm +@@ -207,4 +208,5 @@ def main(): + print "Output written to: %s" % fn + + if __name__ == "__main__": ++ deprecated_warning() + main() +diff --git a/yum-debug-restore.py b/yum-debug-restore.py +index 1d827f4..f201260 100755 +--- a/yum-debug-restore.py ++++ b/yum-debug-restore.py +@@ -25,6 +25,7 @@ from optparse import OptionParser + + import yum + import rpmUtils.miscutils ++from yumutils.deprecated import deprecated_warning + + sections = ['%%%%SYSTEM INFO\n', '%%%%YUM INFO\n', + '%%%%RPMDB PROBLEMS\n', '%%%%RPMDB\n', +@@ -236,6 +237,7 @@ def main(): + os.system("yum shell %s %s" % (" ".join(xtra_args), fo.name)) + + if __name__ == "__main__": ++ deprecated_warning() + main() + + +diff --git a/yum-groups-manager.py b/yum-groups-manager.py +index c536092..300abff 100755 +--- a/yum-groups-manager.py ++++ b/yum-groups-manager.py +@@ -9,6 +9,7 @@ import gzip + + import yum + from yum.i18n import to_unicode ++from yumutils.deprecated import deprecated_warning + import yum.comps + + sys.path.insert(0, '/usr/share/yum-cli') +@@ -308,4 +309,5 @@ def main(): + print to_unicode(comps.xml()) + + if __name__ == "__main__": ++ deprecated_warning() + main() +diff --git a/yumdb.py b/yumdb.py +index c50159e..3196713 100755 +--- a/yumdb.py ++++ b/yumdb.py +@@ -9,6 +9,7 @@ import shlex + + import os + import glob ++from yumutils.deprecated import deprecated_warning + + parser = None + +@@ -247,4 +248,5 @@ def main(): + + + if __name__ == '__main__': ++ deprecated_warning() + main() +diff --git a/yumdownloader.py b/yumdownloader.py +index 1b95e8d..8b3d00a 100755 +--- a/yumdownloader.py ++++ b/yumdownloader.py +@@ -23,6 +23,7 @@ from yum.misc import setup_locale + from yum.packages import parsePackages + from yum.Errors import RepoError + from yum.i18n import exception2msg ++from yumutils.deprecated import deprecated_warning + from utils import YumUtilBase + + from urlparse import urljoin +@@ -258,5 +259,6 @@ class YumDownloader(YumUtilBase): + + if __name__ == '__main__': + setup_locale() ++ deprecated_warning() + util = YumDownloader() + sys.exit(util.exit_code) +diff --git a/yumutils/deprecated.py b/yumutils/deprecated.py +new file mode 100644 +index 0000000..d583915 +--- /dev/null ++++ b/yumutils/deprecated.py +@@ -0,0 +1,29 @@ ++#!/usr/bin/python -tt ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# 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 Library General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++from __future__ import print_function ++from yumutils.i18n import _ ++ ++import sys ++ ++WARNING = _(""" ++Yum-utils package has been deprecated, use dnf instead. ++See 'man yum2dnf' for more information. ++ ++""") ++ ++def deprecated_warning(): ++ print(WARNING, file=sys.stderr) ++ +-- +1.8.3.1 diff --git a/yum-utils.spec b/yum-utils.spec index 22274eb..3e7f90f 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,11 +10,12 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 27%{?dist} +Release: 505%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz Patch1: yum-utils-HEAD.patch +Patch2: yum-utils-deprecated.patch URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -376,6 +377,7 @@ This plugin adds the command copr, for adding/listing/searching copr repos. %prep %setup -q %patch1 -p1 +%patch2 -p1 %install rm -rf $RPM_BUILD_ROOT @@ -682,6 +684,9 @@ fi %{_mandir}/man8/yum-copr.8.* %changelog +* Tue Mar 31 2015 Valentina Mukhamedzhanova - 1.1.31-505 +- Add 'deprecated' message to all utils. + * Thu Nov 13 2014 Valentina Mukhamedzhanova - 1.1.31-27 - Add python-requests to Requires of copr plugin. BZ 1158395 From ed403b499301a2e35da6b26ad737af29f1dcce86 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 19 Jun 2015 04:40:53 +0000 Subject: [PATCH 26/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 3e7f90f..f9e2af2 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 505%{?dist} +Release: 506%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -684,6 +684,9 @@ fi %{_mandir}/man8/yum-copr.8.* %changelog +* Fri Jun 19 2015 Fedora Release Engineering - 1.1.31-506 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + * Tue Mar 31 2015 Valentina Mukhamedzhanova - 1.1.31-505 - Add 'deprecated' message to all utils. From 5222ac8ee35123a0e7913720444b1c4f8afe44fa Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 10 Aug 2015 15:32:45 -0400 Subject: [PATCH 27/55] Update to latest HEAD - Add support for weak deps. to repoquery. - yum-builddep: respect --tolerant to ignore missing dependencies - Add plugin for overlayfs issue workaround. Patch by Pavel Odvody. BZ#1213602 - yum-config-manager: require \* syntax to disable all repos. BZ#1151154 - yum-config-manager: update config file specified using -c option. BZ#1075708 - Deal with gpgdir and gpgcadir keys, in keys plugin. --- yum-utils-HEAD.patch | 514 ++++++++++++++++++++++++++++++++++++------- yum-utils.spec | 149 +------------ 2 files changed, 446 insertions(+), 217 deletions(-) diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch index 8e4ecc3..4c14717 100644 --- a/yum-utils-HEAD.patch +++ b/yum-utils-HEAD.patch @@ -139,6 +139,16 @@ index bc802f6..e9be2e4 100644 2008-08-04 James Antill +diff --git a/README b/README +index 8abe805..0c01d0e 100644 +--- a/README ++++ b/README +@@ -67,3 +67,5 @@ Author of the update on boot init scripts + - Tim Lauridsen + Maintainer of yum-utils - fixer of a lot of misc utils. + ++- Valentina Mukhamedzhanova ++Maintainer of yum-utils. diff --git a/debuginfo-install.py b/debuginfo-install.py index 177c6c3..bb61a1d 100755 --- a/debuginfo-install.py @@ -616,7 +626,7 @@ index 0000000..4d336a5 +See the Authors file included with this program. +.fi diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..def752f 100644 +index f5a8c5d..195780d 100644 --- a/docs/repoquery.1 +++ b/docs/repoquery.1 @@ -1,11 +1,11 @@ @@ -683,7 +693,7 @@ index f5a8c5d..def752f 100644 .IP "\fB\-\-setopt=option=value\fP" Set any config option in yum config or repo files. For options in the global config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid.option=value -@@ -64,13 +75,13 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid +@@ -64,13 +75,21 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid .PP .SH "PACKAGE QUERY OPTIONS" .IP "\fB\-i, \-\-info\fP" @@ -693,13 +703,21 @@ index f5a8c5d..def752f 100644 List files in package. .IP "\fB\-R, \-\-requires\fP" List package dependencies. ++.IP "\fB\-R, \-\-weak\-requires\fP" ++List package weak dependencies. ++.IP "\fB\-R, \-\-info\-requires\fP" ++List package informational dependencies. ++.IP "\fB\-R, \-\-weak\-reverse\-requires\fP" ++List package weak reverse dependencies. ++.IP "\fB\-R, \-\-info\-reverse\-requires\fP" ++List package informational reverse dependencies. .IP "\fB\-\-resolve\fP" -When used with --requires, resolve capabilities to originating packages. -+When used with \-\-requires, resolve capabilities to originating packages. ++When used with \-\-requires/\-\-weak\-requires/etc, resolve capabilities to originating packages. .IP "\fB\-\-provides\fP" List capabilities package provides. .IP "\fB\-\-obsoletes\fP" -@@ -81,7 +92,7 @@ List capabilities conflicting with package. +@@ -81,7 +100,7 @@ List capabilities conflicting with package. List package changelog. .IP "\fB\-\-location\fP" Show a location where the package could be downloaded from. @@ -708,7 +726,7 @@ index f5a8c5d..def752f 100644 .IP "\fB\-s, \-\-source\fP" Show package source RPM name. .IP "\fB\-\-srpm\fP" -@@ -95,16 +106,16 @@ Use name-epoch:version-release.architecture output format (default) +@@ -95,23 +114,26 @@ Use name-epoch:version-release.architecture output format (default) .IP "\fB\-\-envra\fP" Use epoch:name-version-release.architecture output format (easier to parse than nevra) @@ -718,17 +736,20 @@ index f5a8c5d..def752f 100644 ":isodate" to all the tags that are a time, and you can add ":k", ":m", ":g", ":t" and ":h" to sizes. You can also specify field width as in sprintf (Eg. %-20{name}) - .IP "\fB\-\-output [text|ascii-tree|dot-tree]\fP" +-.IP "\fB\-\-output [text|ascii-tree|dot-tree]\fP" -Output format which can be used with --requires/--whatrequires/--obsoletes/--conflicts. -+Output format which can be used with \-\-requires/\-\-whatrequires/\-\-obsoletes/\-\-conflicts. ++.IP "\fB\-\-output [text|ascii-tree|ascii-tree+|dot-tree|dot-tree+]\fP" ++Output format which can be used with \-\-requires/\-\-weak-requires/\-\-whatrequires/\-\-obsoletes/\-\-conflicts. The variants with a + suffix are used for weak dependencies and will merge the stronger variants into the output. Default output is 'text'. .IP "\fB\-\-level [all|any int]\fP" -In combination with --output ascii-tree|dot-tree this option specifies the -+In combination with \-\-output ascii-tree|dot-tree this option specifies the - number of level to print on the tree. Default level is 'all'. +-number of level to print on the tree. Default level is 'all'. ++In combination with \-\-output ascii-tree|dot-tree|ascii-tree+|dot-tree+ this ++option specifies the number of level to print on the tree. ++ Default level is 'all'. .PP -@@ -112,6 +123,8 @@ number of level to print on the tree. Default level is 'all'. + .SH "PACKAGE SELECTION OPTIONS" .IP "\fB\-a, \-\-all\fP" Query all available packages (for rpmquery compatibility / shorthand for repoquery '*') @@ -737,7 +758,7 @@ index f5a8c5d..def752f 100644 .IP "\fB\-f, \-\-file FILE\fP" Query package owning FILE. .IP "\fB\-\-whatobsoletes CAPABILITY\fP" -@@ -123,14 +136,15 @@ Query all packages that provide CAPABILITY. +@@ -123,14 +145,15 @@ Query all packages that provide CAPABILITY. .IP "\fB\-\-whatrequires CAPABILITY\fP" Query all packages that require CAPABILITY. .IP "\fB\-\-alldeps\fP" @@ -757,7 +778,7 @@ index f5a8c5d..def752f 100644 .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" Limit the query to packages of given architecture(s). Valid values are all architectures known to rpm/yum such as 'i386' and 'src' for -@@ -166,19 +180,19 @@ Query groups instead of packages. +@@ -166,19 +189,19 @@ Query groups instead of packages. .SH "EXAMPLES" .IP "List all packages whose name contains 'perl':" @@ -784,7 +805,7 @@ index f5a8c5d..def752f 100644 NB: This command will only work if you have repositories enabled which include srpms. .\"TODO: Add more examples... -@@ -204,7 +218,7 @@ of the following: +@@ -204,7 +227,7 @@ of the following: .br \fBepoch:name-ver-rel.arch\fP .IP @@ -2962,7 +2983,7 @@ index 5094881..5761e76 100644 + if create_snapshots_in_post: + create_snapshots(conduit) diff --git a/plugins/keys/keys.py b/plugins/keys/keys.py -index 3342576..4d2ca96 100644 +index 3342576..d765ef7 100644 --- a/plugins/keys/keys.py +++ b/plugins/keys/keys.py @@ -31,6 +31,15 @@ except: @@ -2981,7 +3002,21 @@ index 3342576..4d2ca96 100644 def match_keys(patterns, key, globs=True): for pat in patterns: if pat == key.keyid: -@@ -250,7 +259,7 @@ Key ID : %s +@@ -141,7 +150,12 @@ class KeysListCommand: + if gpgme is not None: + base.repos.doSetup() # Without this repo.cachedir is empty *sigh* + for repo in base.repos.listEnabled(): +- gpgdir = '%s/gpgdir' % repo.cachedir ++ if hasattr(repo, 'gpgcadir'): ++ gpgdirs = [repo.gpgcadir, repo.gpgdir] ++ else: ++ gpgdirs = ['%s/gpgdir' % repo.cachedir] ++ ++ for gpgdir in gpgdirs: + if not os.path.exists(gpgdir): + continue + +@@ -250,7 +264,7 @@ Key ID : %s time.ctime(key.createts), gpg_cert.version, gpg_cert.user_id, yum.pgpmsg.algo_pk_to_str[gpg_cert.public_key.pk_algo], @@ -3003,6 +3038,67 @@ index c45a1ce..cab69c5 100644 return conf_fname = '/etc/yum.repos.d/_local.repo' +diff --git a/plugins/ovl/ovl.conf b/plugins/ovl/ovl.conf +new file mode 100644 +index 0000000..8e4d76c +--- /dev/null ++++ b/plugins/ovl/ovl.conf +@@ -0,0 +1,2 @@ ++[main] ++enabled=1 +diff --git a/plugins/ovl/ovl.py b/plugins/ovl/ovl.py +new file mode 100644 +index 0000000..f2fbdd4 +--- /dev/null ++++ b/plugins/ovl/ovl.py +@@ -0,0 +1,47 @@ ++# Copyright (C) 2015 Red Hat, Inc. ++# ++# Authors: Pavel Odvody ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions of ++# the GNU General Public License v.2, or (at your option) any later version. ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY expressed or implied, including the implied warranties of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. You should have received a copy of the ++# GNU General Public License along with this program; if not, write to the ++# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the ++# source code or documentation are not subject to the GNU General Public ++# License and may only be used or replicated with the express permission of ++# Red Hat, Inc. ++ ++from yum.plugins import TYPE_CORE ++from os import utime, walk, path ++ ++requires_api_version = '2.3' ++plugin_type = (TYPE_CORE,) ++mtab = '/etc/mtab' ++ ++def should_touch(): ++ """ ++ Touch the files only once we've verified that ++ we're on overlay mount ++ """ ++ with open(mtab, 'r') as f: ++ line = f.readline() ++ return line and line.startswith('overlay /') ++ return False ++ ++def prereposetup_hook(conduit): ++ if not should_touch(): ++ return ++ rpmdb_path = conduit.getRpmDB()._rpmdbpath ++ try: ++ for root, _, files in walk(rpmdb_path): ++ for f in files: ++ p = path.join(root, f) ++ with open(p, 'a'): ++ utime(p, None) ++ except Exception as e: ++ conduit.error(1, "Error while doing RPMdb copy-up:\n%s" % e) diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py index b4da1ce..d59dc40 100644 --- a/plugins/post-transaction-actions/post-transaction-actions.py @@ -4499,7 +4595,7 @@ index ff77e0d..bef3b03 100755 # (c) Copyright Seth Vidal 2004 diff --git a/repoquery.py b/repoquery.py -index a3bb111..af70518 100755 +index a3bb111..dd4336c 100755 --- a/repoquery.py +++ b/repoquery.py @@ -8,11 +8,11 @@ @@ -4533,9 +4629,12 @@ index a3bb111..af70518 100755 Repository : %{repoid} Summary : %{summary} Source : %{sourcerpm} -@@ -74,6 +74,15 @@ querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', +@@ -73,7 +73,18 @@ querytags = [ 'name', 'version', 'release', 'epoch', 'arch', 'summary', + 'vendor', 'group', 'license', 'buildtime', 'filetime', 'installedsize', 'archivesize', 'packagesize', 'repoid', 'requires', 'provides', 'conflicts', 'obsoletes', ++ 'weak_requires', 'info_requires', ++ 'weak_reverse_requires', 'info_reverse_requires', 'relativepath', 'hdrstart', 'hdrend', 'id', + 'checksum', 'pkgid', 'committer', 'committime', + 'ui_evr', 'evr', 'ui_nevra', 'ui_envra', @@ -4549,7 +4648,7 @@ index a3bb111..af70518 100755 ] def sec2isodate(timestr): -@@ -114,7 +123,7 @@ convertmap = { 'date': sec2date, +@@ -114,7 +125,7 @@ convertmap = { 'date': sec2date, 'h': size2h, } @@ -4558,7 +4657,78 @@ index a3bb111..af70518 100755 def __init__(self, value=None): Exception.__init__(self) self.value = value -@@ -316,12 +325,13 @@ class pkgQuery: +@@ -257,18 +268,42 @@ class pkgQuery: + return self._translated_qf[self.qf] % self + + def fmt_requires(self, **kw): +- if self.yb.options.output in ("ascii-tree", "dot-tree"): ++ if self.yb.options.output in ("ascii-tree", "dot-tree", ++ "ascii-tree+", "dot-tree+"): + self.fmt_tree_requires(output = self.yb.options.output, + tree_level = self.yb.options.tree_level, + dot = self.yb.options.dot) + else: + return "\n".join(self.prco('requires')) + ++ def fmt_weak_requires(self, **kw): ++ if self.yb.options.output in ("ascii-tree", "dot-tree", ++ "ascii-tree+", "dot-tree+"): ++ self.fmt_tree_weak_requires(output = self.yb.options.output, ++ tree_level = self.yb.options.tree_level, ++ dot = self.yb.options.dot) ++ else: ++ return "\n".join(self.prco('weak_requires')) ++ def fmt_recommends(self, **kw): ++ return self.fmt_weak_requires(**kw) ++ ++ def fmt_info_requires(self, **kw): ++ if self.yb.options.output in ("ascii-tree", "dot-tree", ++ "ascii-tree+", "dot-tree+"): ++ self.fmt_tree_info_requires(output = self.yb.options.output, ++ tree_level = self.yb.options.tree_level, ++ dot = self.yb.options.dot) ++ else: ++ return "\n".join(self.prco('info_requires')) ++ def fmt_suggests(self, **kw): ++ return self.fmt_info_requires(**kw) ++ + def fmt_provides(self, **kw): + return "\n".join(self.prco('provides')) + + def fmt_conflicts(self, **kw): +- if self.yb.options.output in ("ascii-tree", "dot-tree"): ++ if self.yb.options.output in ("ascii-tree", "dot-tree", ++ "ascii-tree+", "dot-tree+"): + self.fmt_tree_conflicts(output = self.yb.options.output, + tree_level = self.yb.options.tree_level, + dot = self.yb.options.dot) +@@ -276,13 +311,24 @@ class pkgQuery: + return "\n".join(self.prco('conflicts')) + + def fmt_obsoletes(self, **kw): +- if self.yb.options.output in ("ascii-tree", "dot-tree"): ++ if self.yb.options.output in ("ascii-tree", "dot-tree", ++ "ascii-tree+", "dot-tree+"): + self.fmt_tree_obsoletes(output = self.yb.options.output, + tree_level = self.yb.options.tree_level, + dot = self.yb.options.dot) + else: + return "\n".join(self.prco('obsoletes')) + ++ def fmt_weak_reverse_requires(self, **kw): ++ return "\n".join(self.prco('weak_reverse_requires')) ++ def fmt_supplements(self, **kw): ++ return self.fmt_weak_reverse_requires(**kw) ++ ++ def fmt_info_reverse_requires(self, **kw): ++ return "\n".join(self.prco('info_reverse_requires')) ++ def fmt_enhances(self, **kw): ++ return self.fmt_info_reverse_requires(**kw) ++ + def fmt_list(self, **kw): + return "\n".join(self.files()) + +@@ -316,12 +362,13 @@ class pkgQuery: print "%s%s [%s]" % (indent, str(req), str(val)) # These are common helpers for the --tree-* options... @@ -4575,7 +4745,13 @@ index a3bb111..af70518 100755 def _tree_pkg2uniq(self, pkg): """ Turn a pkg into a "unique" req.""" if self.yb and self.yb.conf.showdupesfromrepos: -@@ -365,6 +375,7 @@ class pkgQuery: +@@ -360,11 +407,12 @@ class pkgQuery: + level = kw.get('level', 0) + all_reqs = kw.get('all_reqs', {}) + +- if kw['output'].lower() == 'dot-tree': ++ if kw['output'].lower() in ('dot-tree', 'dot-tree+'): + if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -4583,7 +4759,7 @@ index a3bb111..af70518 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -375,6 +386,15 @@ class pkgQuery: +@@ -375,6 +423,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -4599,7 +4775,7 @@ index a3bb111..af70518 100755 __req2pkgs = {} def req2pkgs(ignore, req): req = str(req) -@@ -406,6 +426,8 @@ class pkgQuery: +@@ -406,6 +463,8 @@ class pkgQuery: providers = matches.keys() @@ -4608,13 +4784,18 @@ index a3bb111..af70518 100755 except yum.Errors.YumBaseError, err: print >>sys.stderr, "No package provides %s" % req return [] -@@ -413,14 +435,9 @@ class pkgQuery: +@@ -413,14 +472,14 @@ class pkgQuery: __req2pkgs[req] = providers return providers - dot = kw['dot'] - tups = getattr(pkg, prco_type) ++ if kw['output'].lower() in ('ascii-tree+', 'dot-tree+'): ++ if prco_type in ("info_requires",): ++ tups.extend(getattr(pkg, "weak_requires")) ++ if prco_type in ("info_requires", "weak_requires"): ++ tups.extend(getattr(pkg, "requires")) rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, req2pkgs) - if dot is None: - self._tree_print_req(pkg, req, level) @@ -4624,7 +4805,16 @@ index a3bb111..af70518 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -449,6 +466,7 @@ class pkgQuery: +@@ -444,11 +503,16 @@ class pkgQuery: + + def fmt_tree_requires(self, **kw): + return self._fmt_tree_prov('requires', **kw) ++ def fmt_tree_weak_requires(self, **kw): ++ return self._fmt_tree_prov('weak_requires', **kw) ++ def fmt_tree_info_requires(self, **kw): ++ return self._fmt_tree_prov('info_requires', **kw) + def fmt_tree_conflicts(self, **kw): + return self._fmt_tree_prov('conflicts', **kw) def fmt_tree_obsoletes(self, **kw): pkg = kw.get('pkg', self.pkg) @@ -4632,7 +4822,7 @@ index a3bb111..af70518 100755 level = kw.get('level', 0) all_reqs = kw.get('all_reqs', {}) -@@ -457,6 +475,7 @@ class pkgQuery: +@@ -457,6 +521,7 @@ class pkgQuery: kw['dot'] = DotPlot() elif 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = None @@ -4640,7 +4830,7 @@ index a3bb111..af70518 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -467,6 +486,15 @@ class pkgQuery: +@@ -467,6 +532,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -4656,7 +4846,7 @@ index a3bb111..af70518 100755 def obs2pkgs(): if self.yb is None: return [] -@@ -496,10 +524,7 @@ class pkgQuery: +@@ -496,10 +570,7 @@ class pkgQuery: else: reason = 'cmd line' rpkgs = obs2pkgs() @@ -4668,7 +4858,7 @@ index a3bb111..af70518 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 all_reqs[pkg] = None -@@ -514,6 +539,7 @@ class pkgQuery: +@@ -514,6 +585,7 @@ class pkgQuery: self._tree_print_req(rpkg, '', nlevel) continue self.fmt_tree_obsoletes(pkg=rpkg, level=nlevel, all_reqs=all_reqs, @@ -4676,7 +4866,7 @@ index a3bb111..af70518 100755 tree_level = kw['tree_level'], output = kw['output'], dot = dot) -@@ -527,6 +553,7 @@ class pkgQuery: +@@ -527,6 +599,7 @@ class pkgQuery: if kw['output'].lower() == 'dot-tree': if 'dot' not in kw.keys() or kw['dot'] is None: kw['dot'] = DotPlot() @@ -4684,7 +4874,7 @@ index a3bb111..af70518 100755 if str(kw['tree_level']).lower() != 'all': try: -@@ -537,6 +564,15 @@ class pkgQuery: +@@ -537,6 +610,15 @@ class pkgQuery: if not 'output' in kw.keys(): kw['output'] = 'ascii-tree' @@ -4700,7 +4890,7 @@ index a3bb111..af70518 100755 __prov2pkgs = {} def prov2pkgs(prov, ignore): if str(prov) in __prov2pkgs: -@@ -562,6 +598,8 @@ class pkgQuery: +@@ -562,6 +644,8 @@ class pkgQuery: arequirers = [pkg for pkg in areqs if pkg.pkgtup not in skip] @@ -4709,7 +4899,7 @@ index a3bb111..af70518 100755 except yum.Errors.YumBaseError, err: print >>sys.stderr, "No package provides %s" % str(prov) return [] -@@ -575,12 +613,8 @@ class pkgQuery: +@@ -575,12 +659,8 @@ class pkgQuery: tups = pkg.provides + filetupes rpkgs, loc_reqs = self._tree_maybe_add_pkgs(all_reqs, tups, prov2pkgs) @@ -4723,7 +4913,19 @@ index a3bb111..af70518 100755 dot.addPackage(pkg, rpkgs) lim = level + 2 nlevel = level + 1 -@@ -719,13 +753,13 @@ class groupQuery: +@@ -671,6 +751,11 @@ class instPkgQuery(pkgQuery): + + def prco(self, what, **kw): + prcodict = {} ++ what = {"weak_requires" : "recommends", ++ "info_requires" : "suggests", ++ "weak_reverse_requires" : "supplements", ++ "info_reverse_requires" : "enhances"}.get(what, what) ++ + # rpm names are without the trailing s :) + what = what[:-1] + +@@ -719,13 +804,13 @@ class groupQuery: raise queryError("Invalid group query: %s" % method) # XXX temporary hack to make --group -a query work @@ -4740,7 +4942,7 @@ index a3bb111..af70518 100755 pkgs = [] for t in self.grouppkgs.split(','): if t == "mandatory": -@@ -741,10 +775,10 @@ class groupQuery: +@@ -741,10 +826,10 @@ class groupQuery: return pkgs @@ -4753,7 +4955,7 @@ index a3bb111..af70518 100755 return ["%s:\n\n%s\n" % (self.name, self.group.description)] -@@ -848,6 +882,8 @@ class YumBaseQuery(yum.YumBase): +@@ -848,6 +933,8 @@ class YumBaseQuery(yum.YumBase): matches = yum.YumBase.searchPackageProvides(self, [str(depstring)]) provider = matches.keys() # provider.extend(yum.YumBase.returnPackagesByDep(self, depstring)) @@ -4762,7 +4964,7 @@ index a3bb111..af70518 100755 except yum.Errors.YumBaseError, err: self.logger.error("No package provides %s" % depstring) return self.queryPkgFactory(provider) -@@ -1008,12 +1044,12 @@ class YumBaseQuery(yum.YumBase): +@@ -1008,12 +1095,12 @@ class YumBaseQuery(yum.YumBase): def fmt_whatrequires(self, name, **kw): pkgs = {} @@ -4777,18 +4979,22 @@ index a3bb111..af70518 100755 provs = [name] -@@ -1054,10 +1090,21 @@ class YumBaseQuery(yum.YumBase): +@@ -1052,14 +1139,41 @@ class YumBaseQuery(yum.YumBase): + pkgs.append(pkg) + return self.queryPkgFactory(pkgs) - def fmt_requires(self, name, **kw): +- def fmt_requires(self, name, **kw): ++ def fmt_requires(self, name, requires="requires", **kw): pkgs = {} - for pkg in self.returnByName(name): +- for req in pkg.prco("requires"): + done = set() + def require_recursive(pkg): + if pkg.name in done: + return + done.add(pkg.name) + - for req in pkg.prco("requires"): ++ for req in pkg.prco(requires): for res in self.fmt_whatprovides(req): pkgs[(res.name, res.pkg.arch)] = res + if self.options.recursive: @@ -4799,8 +5005,26 @@ index a3bb111..af70518 100755 + return pkgs.values() ++ def fmt_weak_requires(self, name, **kw): ++ return self.fmt_requires(name, requires="weak_requires", **kw) ++ def fmt_recommends(self, name, **kw): ++ return self.fmt_requires(name, requires="recommends", **kw) ++ ++ def fmt_info_requires(self, name, **kw): ++ return self.fmt_requires(name, requires="info_requires", **kw) ++ def fmt_suggests(self, name, **kw): ++ return self.fmt_requires(name, requires="suggests", **kw) ++ ++ def fmt_weak_reverse_requires(self, name, **kw): ++ return self.fmt_requires(name, requires="weak_reverse_requires", **kw) ++ ++ def fmt_info_reverse_requires(self, name, **kw): ++ return self.fmt_requires(name, requires="info_reverse_requires", **kw) ++ def fmt_location(self, name): -@@ -1070,6 +1117,44 @@ class YumBaseQuery(yum.YumBase): + loc = [] + for pkg in self.returnByName(name): +@@ -1070,6 +1184,44 @@ class YumBaseQuery(yum.YumBase): loc.append("%s/%s" % (repo.urls[0], pkg['relativepath'])) return loc @@ -4845,7 +5069,52 @@ index a3bb111..af70518 100755 def main(args): -@@ -1172,6 +1257,8 @@ def main(args): +@@ -1099,6 +1251,44 @@ def main(args): + help="query all packages/groups") + parser.add_option("-R", "--requires", action="store_true", + help="list package dependencies") ++ parser.add_option("--weak-requires", action="store_true", ++ help="list package weak dependencies") ++ parser.add_option("--recommends", action="store_true", ++ dest="weak_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--weak-reverse-requires", action="store_true", ++ help="list package weak reverse dependencies") ++ parser.add_option("--reverse-weak-requires", action="store_true", ++ dest="weak_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--rev-weak-requires", action="store_true", ++ dest="weak_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--weak-rev-requires", action="store_true", ++ dest="weak_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--supplements", action="store_true", ++ dest="weak_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--info-requires", action="store_true", ++ help="list package informational dependencies") ++ parser.add_option("--suggests", action="store_true", ++ dest="info_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--info-reverse-requires", action="store_true", ++ help="list package informational reverse dependencies") ++ parser.add_option("--reverse-info-requires", action="store_true", ++ dest="info_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--rev-info-requires", action="store_true", ++ dest="info_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--info-rev-requires", action="store_true", ++ dest="info_reverse_requires", ++ help=SUPPRESS_HELP) ++ parser.add_option("--enhances", action="store_true", ++ dest="info_reverse_requires", ++ help=SUPPRESS_HELP) + parser.add_option("--provides", action="store_true", + help="list capabilities this package provides") + parser.add_option("--obsoletes", action="store_true", +@@ -1172,6 +1362,8 @@ def main(args): help="run from cache only") parser.add_option("--tempcache", action="store_true", help="use private cache (default when used as non-root)") @@ -4854,7 +5123,15 @@ index a3bb111..af70518 100755 parser.add_option("--querytags", action="store_true", help="list available tags in queryformat queries") parser.add_option("-c", "--config", dest="conffile", -@@ -1198,6 +1285,10 @@ def main(args): +@@ -1191,13 +1383,17 @@ def main(args): + parser.add_option("--level", dest="tree_level", default="all", + help="levels to display (can be any number or 'all', default to 'all')") + parser.add_option("--output", dest="output", default="text", +- help="output format to use (can be text|ascii-tree|dot-tree, default to 'text')") ++ help="output format to use (can be text|ascii-tree|dot-tree|ascii-tree+|dot-tree+, default to 'text')") + parser.add_option("--search", action="store_true", + dest="search", default=False, + help="Use yum's search to return pkgs") parser.add_option("--search-fields", action="append", dest="searchfields", default=[], help="search fields to search using --search") @@ -4865,7 +5142,34 @@ index a3bb111..af70518 100755 (opts, regexs) = parser.parse_args() -@@ -1261,9 +1352,10 @@ def main(args): +@@ -1225,6 +1421,26 @@ def main(args): + sackops.append("requires") + else: + pkgops.append("requires") ++ if opts.info_requires: ++ if opts.resolve: ++ sackops.append("info_requires") ++ else: ++ pkgops.append("info_requires") ++ if opts.weak_requires: ++ if opts.resolve: ++ sackops.append("weak_requires") ++ else: ++ pkgops.append("weak_requires") ++ if opts.info_reverse_requires: ++ if opts.resolve: ++ sackops.append("info_reverse_requires") ++ else: ++ pkgops.append("info_reverse_requires") ++ if opts.weak_reverse_requires: ++ if opts.resolve: ++ sackops.append("weak_reverse_requires") ++ else: ++ pkgops.append("weak_reverse_requires") + if opts.provides: + pkgops.append("provides") + if opts.obsoletes: +@@ -1261,9 +1477,10 @@ def main(args): if opts.srpm: needsource = 1 if opts.whatrequires: @@ -4877,7 +5181,7 @@ index a3bb111..af70518 100755 if opts.whatprovides: sackops.append("whatprovides") if opts.whatobsoletes: -@@ -1280,7 +1372,6 @@ def main(args): +@@ -1280,7 +1497,6 @@ def main(args): needgroup = 1 if opts.installed: opts.pkgnarrow = 'installed' @@ -4885,7 +5189,7 @@ index a3bb111..af70518 100755 if opts.nevra: pkgops.append("nevra") -@@ -1303,6 +1394,13 @@ def main(args): +@@ -1303,6 +1519,13 @@ def main(args): repoq = YumBaseQuery(pkgops, sackops, opts) @@ -4899,7 +5203,7 @@ index a3bb111..af70518 100755 # silence initialisation junk from modules etc unless verbose mode initnoise = (not opts.quiet) * 2 repoq.preconf.releasever = opts.releasever -@@ -1312,7 +1410,26 @@ def main(args): +@@ -1312,7 +1535,26 @@ def main(args): repoq.preconf.fn = opts.conffile repoq.preconf.debuglevel = initnoise repoq.preconf.init_plugins = opts.plugins @@ -4927,7 +5231,7 @@ index a3bb111..af70518 100755 if opts.repofrompath: # setup the fake repos -@@ -1327,8 +1444,13 @@ def main(args): +@@ -1327,8 +1569,13 @@ def main(args): else: baseurl = repopath @@ -4943,7 +5247,7 @@ index a3bb111..af70518 100755 if not opts.quiet: repoq.logger.info( "Added %s repo from %s" % (repoid,repopath)) -@@ -1345,6 +1467,11 @@ def main(args): +@@ -1345,6 +1592,11 @@ def main(args): repoq.repos.setProgressBar(TextMeter(fo=sys.stdout)) repoq.repos.callback = output.CacheProgressCallback() repoq.repos.setFailureCallback(freport) @@ -4955,7 +5259,7 @@ index a3bb111..af70518 100755 if not repoq.setCacheDir(opts.tempcache): repoq.logger.error("Error: Could not make cachedir, exiting") -@@ -1359,6 +1486,13 @@ def main(args): +@@ -1359,6 +1611,13 @@ def main(args): if opts.show_dupes: repoq.conf.showdupesfromrepos = True @@ -4969,7 +5273,7 @@ index a3bb111..af70518 100755 if opts.repoid: found_repos = set() for repo in repoq.repos.findRepos('*'): -@@ -1380,6 +1514,14 @@ def main(args): +@@ -1380,6 +1639,14 @@ def main(args): for repo in repoq.repos.findRepos(repo_match): repo.enable() @@ -4984,7 +5288,7 @@ index a3bb111..af70518 100755 try: if not hasattr(repoq, 'arch'): repoq.doSackSetup(archlist=archlist) -@@ -1396,10 +1538,12 @@ def main(args): +@@ -1396,10 +1663,12 @@ def main(args): except (yum.Errors.RepoError, yum.Errors.GroupsError), e: repoq.logger.error(e) sys.exit(1) @@ -5630,7 +5934,7 @@ index d1fe5e2..78e8264 100755 group = my.comps.return_group('core') for pname in group.mandatory_packages: diff --git a/yum-builddep.py b/yum-builddep.py -index d7a37c3..7c40713 100755 +index d7a37c3..5f59ab8 100755 --- a/yum-builddep.py +++ b/yum-builddep.py @@ -8,17 +8,18 @@ @@ -5721,29 +6025,29 @@ index d7a37c3..7c40713 100755 - print "Could not setup repo %s: %s" % (r.id, e) - sys.exit(1) - def install_deps(self, deplist): +- def install_deps(self, deplist): ++ def install_deps(self, deplist, opts): + errors = set() for dep in deplist: self.logger.debug(' REQ: %s' % dep) if dep.startswith("rpmlib("): -@@ -152,10 +159,13 @@ class YumBuildDep(YumUtilBase): +@@ -152,9 +159,13 @@ class YumBuildDep(YumUtilBase): pkg = self.returnPackageByDep(dep) self.logger.info(' --> %s' % pkg) self.install(pkg) - except yum.Errors.YumBaseError, e: - self.logger.error("Error: %s" % e) -- sys.exit(1) + errors.add(exception2msg(e)) + + if errors: + for i in sorted(errors): + self.logger.error("Error: %s" % i) -+ sys.exit(1) ++ if not opts.tolerant: + sys.exit(1) # go through each of the pkgs, figure out what they are/where they are - # if they are not a local package then run -@@ -170,10 +180,14 @@ class YumBuildDep(YumUtilBase): +@@ -170,10 +181,14 @@ class YumBuildDep(YumUtilBase): specnames = [] srpms = [] specworks = False @@ -5758,7 +6062,7 @@ index d7a37c3..7c40713 100755 for arg in self.cmds: if arg.endswith('.src.rpm'): -@@ -192,7 +206,6 @@ class YumBuildDep(YumUtilBase): +@@ -192,7 +207,6 @@ class YumBuildDep(YumUtilBase): toActOn = [] if srcnames: @@ -5766,7 +6070,7 @@ index d7a37c3..7c40713 100755 pkgs = self.pkgSack.returnPackages(patterns=srcnames) exact, match, unmatch = yum.packages.parsePackages(pkgs, srcnames, casematch=1) srpms += exact + match -@@ -206,22 +219,30 @@ class YumBuildDep(YumUtilBase): +@@ -206,28 +220,36 @@ class YumBuildDep(YumUtilBase): sys.exit(1) toActOn = [] @@ -5780,7 +6084,8 @@ index d7a37c3..7c40713 100755 for srpm in toActOn: self.logger.info('Getting requirements for %s' % srpm) - self.install_deps(srpm.requiresList()) +- self.install_deps(srpm.requiresList()) ++ self.install_deps(srpm.requiresList(), opts) for name in specnames: + # (re)load rpm config for target if set @@ -5800,6 +6105,13 @@ index d7a37c3..7c40713 100755 buildreqs = [] for d in rpm.ds(spec.sourceHeader, 'requires'): buildreqs.append(d.DNEVR()[2:]) + + self.logger.info('Getting requirements for %s' % name) +- self.install_deps(buildreqs) ++ self.install_deps(buildreqs, opts) + + if __name__ == '__main__': + setup_locale() diff --git a/yum-complete-transaction.py b/yum-complete-transaction.py index c5074ab..6b01e4e 100755 --- a/yum-complete-transaction.py @@ -5860,7 +6172,7 @@ index c5074ab..6b01e4e 100755 diff --git a/yum-config-manager.py b/yum-config-manager.py -index 50f5123..380a54f 100755 +index 50f5123..0531c72 100755 --- a/yum-config-manager.py +++ b/yum-config-manager.py @@ -7,8 +7,11 @@ import yum @@ -5897,7 +6209,33 @@ index 50f5123..380a54f 100755 logger.error(str(e)) sys.exit(50) -@@ -153,7 +162,7 @@ if (not args and not opts.addrepo) or 'main' in args: +@@ -137,8 +146,11 @@ if opts.enable and opts.disable: + logger.error("Error: Trying to enable and disable repos.") + opts.enable = opts.disable = False + if opts.enable and not args: +- logger.error("Error: Trying to enable already enabled repos.") ++ logger.error("Error: please specify repos to enable (\* to enable all).") + opts.enable = False ++if opts.disable and not args: ++ logger.error("Error: please specify repos to disable (\* to disable all).") ++ opts.disable = False + + only = None + +@@ -146,14 +158,17 @@ if (not args and not opts.addrepo) or 'main' in args: + print yb.fmtSection('main') + print yb.conf.dump() + if opts.save and hasattr(yb, 'main_setopts') and yb.main_setopts: +- fn = '/etc/yum/yum.conf' ++ fn = opts.conffile + if not os.path.exists(fn): +- # Try the old default +- fn = '/etc/yum.conf' ++ if fn == '/etc/yum/yum.conf': ++ # Try the old default ++ fn = '/etc/yum.conf' ++ else: ++ raise yum.Errors.ConfigError("Error accessing file for config %s" % fn) ybc = yb.conf writeRawConfigFile(fn, 'main', ybc.yumvar, ybc.cfg.options, ybc.iteritems, ybc.optionobj, @@ -5906,7 +6244,7 @@ index 50f5123..380a54f 100755 if opts.enable or opts.disable: opts.save = True -@@ -161,7 +170,13 @@ if opts.enable or opts.disable: +@@ -161,7 +176,13 @@ if opts.enable or opts.disable: only = ['enabled'] if args: @@ -5921,7 +6259,7 @@ index 50f5123..380a54f 100755 else: repos = yb.repos.listEnabled() -@@ -174,7 +189,7 @@ if not opts.addrepo: +@@ -174,7 +195,7 @@ if not opts.addrepo: repo.disable() print repo.dump() if (opts.save and @@ -5930,7 +6268,7 @@ index 50f5123..380a54f 100755 writeRawConfigFile(repo.repofile, repo.id, repo.yumvar, repo.cfg.options, repo.iteritems, repo.optionobj, only) -@@ -196,13 +211,16 @@ if opts.addrepo: +@@ -196,13 +217,16 @@ if opts.addrepo: if url.endswith('.repo'): # this is a .repo file - fetch it, put it in our reposdir and enable it destname = os.path.basename(url) destname = myrepodir + '/' + destname @@ -6366,7 +6704,7 @@ index 1d37231..04b78a7 100644 # mode: shell-script # sh-basic-offset: 4 diff --git a/yum-utils.spec b/yum-utils.spec -index ce7fb64..c1d0045 100644 +index ce7fb64..142afa1 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,4 +1,11 @@ @@ -6467,7 +6805,7 @@ index ce7fb64..c1d0045 100644 %description -n yum-plugin-fs-snapshot When this plugin is installed it will automatically snapshot any -@@ -378,6 +363,16 @@ Requires: puppet +@@ -378,6 +363,25 @@ Requires: puppet %description -n yum-plugin-puppetverify Supplies checksums for files in packages from puppet's state file. @@ -6480,11 +6818,20 @@ index ce7fb64..c1d0045 100644 + +%description -n yum-plugin-copr +This plugin adds the command copr, for adding/listing/searching copr repos. ++ ++%package -n yum-plugin-ovl ++Summary: Yum plugin to work around overlayfs issues ++Group: System Environment/Base ++Provides: yum-ovl = %{version}-%{release} ++Requires: yum >= 3.4.3 ++ ++%description -n yum-plugin-ovl ++This plugin touches rpmdb files to work around overlayfs issues. + %prep %setup -q -@@ -395,11 +390,8 @@ plugins="\ +@@ -395,11 +399,8 @@ plugins="\ protectbase \ versionlock \ tsflags \ @@ -6496,11 +6843,12 @@ index ce7fb64..c1d0045 100644 upgrade-helper \ aliases \ list-data \ -@@ -416,16 +408,23 @@ plugins="\ +@@ -416,16 +417,24 @@ plugins="\ fs-snapshot \ ps \ puppetverify \ + copr \ ++ ovl \ +" + +%if %{package_yum_updatesd} @@ -6523,7 +6871,7 @@ index ce7fb64..c1d0045 100644 done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ -@@ -433,6 +432,10 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p +@@ -433,6 +442,10 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo @@ -6534,7 +6882,7 @@ index ce7fb64..c1d0045 100644 %clean rm -rf $RPM_BUILD_ROOT -@@ -469,8 +472,8 @@ fi +@@ -469,8 +482,8 @@ fi %{_bindir}/yum-builddep %{_bindir}/yum-config-manager %{_bindir}/yum-debug-dump @@ -6544,7 +6892,7 @@ index ce7fb64..c1d0045 100644 %{_bindir}/show-installed %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction -@@ -487,10 +490,19 @@ fi +@@ -487,10 +500,19 @@ fi %{_mandir}/man1/show-installed.1.* %{_mandir}/man1/yum-builddep.1.* %{_mandir}/man1/yum-debug-dump.1.* @@ -6564,7 +6912,7 @@ index ce7fb64..c1d0045 100644 %files -n yum-updateonboot %defattr(-, root, root) -@@ -502,7 +514,7 @@ fi +@@ -502,7 +524,7 @@ fi %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING @@ -6573,7 +6921,7 @@ index ce7fb64..c1d0045 100644 %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* -@@ -510,20 +522,20 @@ fi +@@ -510,20 +532,20 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf @@ -6597,7 +6945,7 @@ index ce7fb64..c1d0045 100644 %{_mandir}/man1/yum-versionlock.1.* %{_mandir}/man5/yum-versionlock.conf.5.* -@@ -531,85 +543,74 @@ fi +@@ -531,85 +553,74 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf @@ -6696,7 +7044,7 @@ index ce7fb64..c1d0045 100644 %files -n yum-NetworkManager-dispatcher %defattr(-, root, root) -@@ -619,13 +620,13 @@ fi +@@ -619,13 +630,13 @@ fi %files -n yum-plugin-remove-with-leaves %defattr(-, root, root) %doc COPYING @@ -6712,7 +7060,7 @@ index ce7fb64..c1d0045 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action # Default *.action file dropping dir. -@@ -634,19 +635,19 @@ fi +@@ -634,19 +645,19 @@ fi %files -n yum-plugin-rpm-warm-cache %defattr(-, root, root) %doc COPYING @@ -6735,7 +7083,7 @@ index ce7fb64..c1d0045 100644 %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -@@ -654,13 +655,13 @@ fi +@@ -654,13 +665,13 @@ fi %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf @@ -6751,7 +7099,7 @@ index ce7fb64..c1d0045 100644 %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* -@@ -668,13 +669,20 @@ fi +@@ -668,13 +679,26 @@ fi %defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf @@ -6771,6 +7119,12 @@ index ce7fb64..c1d0045 100644 +%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/copr.conf +%{pluginhome}/copr.* +%{_mandir}/man8/yum-copr.8.* ++ ++%files -n yum-plugin-ovl ++%defattr(-, root, root) ++%doc COPYING ++%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ovl.conf ++%{pluginhome}/ovl.* %changelog * Thu Aug 10 2011 Tim Lauridsen diff --git a/yum-utils.spec b/yum-utils.spec index f9e2af2..bca5500 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 506%{?dist} +Release: 508%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -684,6 +684,15 @@ fi %{_mandir}/man8/yum-copr.8.* %changelog +* Mon Aug 10 2015 James Antill - 1.1.31-508 +- Update to latest HEAD +- Add support for weak deps. to repoquery. +- yum-builddep: respect --tolerant to ignore missing dependencies +- Add plugin for overlayfs issue workaround. Patch by Pavel Odvody. BZ#1213602 +- yum-config-manager: require \* syntax to disable all repos. BZ#1151154 +- yum-config-manager: update config file specified using -c option. BZ#1075708 +- Deal with gpgdir and gpgcadir keys, in keys plugin. + * Fri Jun 19 2015 Fedora Release Engineering - 1.1.31-506 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild @@ -848,10 +857,10 @@ fi * Sat Jan 14 2012 Fedora Release Engineering - 1.1.31-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild -* Thu Aug 13 2011 Tim Lauridsen +* Sat Aug 13 2011 Tim Lauridsen - fix traceback in auto-update-debuginfo plugin (rhbz #729982) -* Thu Aug 10 2011 Tim Lauridsen +* Wed Aug 10 2011 Tim Lauridsen - mark as 1.1.31 - remove patches @@ -867,137 +876,3 @@ fi * Mon Jan 3 2011 Tim Lauridsen - Added yumutils python module - -* Thu Dec 30 2010 Tim Lauridsen -- Added Translation support and need Requires, BuildRequires - -* Sun Nov 7 2010 Tim Lauridsen -- mark as 1.1.29 - -* Tue Aug 3 2010 Seth Vidal -- add COPYING docs to all the plugins to make fedora(and Tim) happy. :) - -* Tue Aug 3 2010 Tim Lauridsen -- mark as 1.1.28 - -* Sun Jun 6 2010 Tim Lauridsen -- mark as 1.1.27 - -* Wed Feb 10 2010 Tim Lauridsen -- mark as 1.1.26 - -* Wed Jan 27 2010 Tim Lauridsen -- mark as 1.1.25 -- add touch /etc/yum.repos.d/_local.repo to install section -- this need for for the ghost in files section of yum-plugin-local - -* Sun Nov 8 2009 Tim Lauridsen -- remove basearchonly since all versions of yum for quite some time obsolete it -- truncate changelog to last 2 years - -* Sat Nov 7 2009 Tim Lauridsen -- mark as 1.1.24 - -* Wed Nov 4 2009 Seth Vidal -- add needs-restarting - -* Mon Oct 12 2009 Seth Vidal -- add python compileall to all plugins so we get .pyc/.pyo files in them -- fixes https://bugzilla.redhat.com/show_bug.cgi?id=493174 - -* Wed Sep 2 2009 Tim Lauridsen -- mark as 1.1.23 - -* Tue May 19 2009 Tim Lauridsen -- mark as 1.1.22 - -* Mon May 18 2009 Seth Vidal -- add show-leaves plugin from Ville Skyttä - -* Wed Mar 25 2009 Tim Lauridsen -- mark as 1.1.21 - -* Mon Mar 2 2009 Tim Lauridsen -- set yum require to 3.2.21 (the 3.2.21 in rawhide is patched to yum head, so it matches the need yum 3.2.22 code) -- Added versioned Provides: yum- to make rpm/yum happy. -- yum-updateonboot is not renamed and dont need Obsoletes/Conflicts/Provides - -* Sun Mar 1 2009 Tim Lauridsen -- mark as 1.1.20 -- rename plugins from yum-name to yum-plugin-name - -* Wed Feb 25 2009 Tim Lauridsen -- Remove yum-kernel-module & yum-fedorakmod plugins (no obsoleting yet) -- Remove yum-skip-broken plugin leftovers - -* Tue Feb 3 2009 James Antill -- add auto-update-debuginfo plugin - -* Wed Dec 17 2008 Tim Lauridsen -- mark as 1.1.19 - -* Wed Dec 10 2008 Seth Vidal -- add find-repos-of-install from James' stash of misc stuff - -* Wed Oct 29 2008 Tim Lauridsen -- mark as 1.1.18 - -* Mon Oct 27 2008 Seth Vidal -- add rpm-warm-cache plugin - -* Fri Sep 19 2008 Tim Lauridsen -- removed skip-broken plugin - -* Wed Sep 17 2008 Tim Lauridsen -- mark as 1.1.17 - -* Mon Sep 8 2008 Seth Vidal -- add yum-remove-with-leaves plugin - -* Wed Aug 27 2008 Tim Lauridsen -- mark as 1.1.16 -* Wed Aug 20 2008 James Antill -- add yum-groups-manager - -* Thu Aug 7 2008 Tim Lauridsen -- mark as 1.1.15 -* Wed May 21 2008 Tim Lauridsen -- add verifytree - -* Wed May 21 2008 Tim Lauridsen - Make yum-fastestmirror %%files handle the fastestmirror-asyncore.py file -* Wed May 21 2008 Tim Lauridsen -- mark as 1.1.14 -* Fri Apr 10 2008 James Antill -- Add keys plugin - -* Fri Mar 31 2008 James Antill -- Add yum-aliases man page - -* Fri Mar 21 2008 Tim Lauridsen -- mark as 1.1.13 -* Fri Mar 21 2008 Tim Lauridsen -- mark as 1.1.12 -* Tue Mar 18 2008 Shawn Starr -- Add yum-utils.1 manual page -- Rename yum-complete-transaction manual page to 8 -- Move yum-complete-transaction to /usr/sbin - -* Sat Mar 1 2008 James Antill -- Add verify plugin - -* Wed Feb 20 2008 James Antill -- Add empty versionlock file - -* Fri Feb 1 2008 James Antill -- Add filter-data plugin - -* Wed Jan 30 2008 Tim Lauridsen -- mark as 1.1.11 - -* Sun Jan 13 2008 Seth Vidal -- add repodiff - -* Thu Jan 3 2008 Tim Lauridsen -- mark as 1.1.10 - From b43977c1fd00637949753721b8db65cdca8184cf Mon Sep 17 00:00:00 2001 From: James Antill Date: Mon, 10 Aug 2015 15:42:48 -0400 Subject: [PATCH 28/55] Update to latest HEAD - Add support for weak deps. to repoquery. - yum-builddep: respect --tolerant to ignore missing dependencies - Add plugin for overlayfs issue workaround. Patch by Pavel Odvody. BZ#1213602 - yum-config-manager: require \* syntax to disable all repos. BZ#1151154 - yum-config-manager: update config file specified using -c option. BZ#1075708 - Deal with gpgdir and gpgcadir keys, in keys plugin. --- yum-utils.spec | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/yum-utils.spec b/yum-utils.spec index bca5500..1bd4e2f 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -374,6 +374,15 @@ Requires: python-requests %description -n yum-plugin-copr This plugin adds the command copr, for adding/listing/searching copr repos. +%package -n yum-plugin-ovl +Summary: Yum plugin to work around overlayfs issues +Group: System Environment/Base +Provides: yum-ovl = %{version}-%{release} +Requires: yum >= 3.4.3 + +%description -n yum-plugin-ovl +This plugin touches rpmdb files to work around overlayfs issues. + %prep %setup -q %patch1 -p1 @@ -412,6 +421,7 @@ plugins="\ ps \ puppetverify \ copr \ + ovl \ " %if %{package_yum_updatesd} @@ -436,6 +446,11 @@ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo +%check +# To execute: ./test/test-all +# Tests are not suitable for running at build time +# because they require networking and a populated /var/cache/yum + %clean rm -rf $RPM_BUILD_ROOT @@ -683,6 +698,12 @@ fi %{pluginhome}/copr.* %{_mandir}/man8/yum-copr.8.* +%files -n yum-plugin-ovl +%defattr(-, root, root) +%doc COPYING +%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ovl.conf +%{pluginhome}/ovl.* + %changelog * Mon Aug 10 2015 James Antill - 1.1.31-508 - Update to latest HEAD From 3f29fc65b42f5d91adadb9cf42ba2cb27100c3bc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 5 Feb 2016 04:01:19 +0000 Subject: [PATCH 29/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 1bd4e2f..d5270e4 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 508%{?dist} +Release: 509%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -705,6 +705,9 @@ fi %{pluginhome}/ovl.* %changelog +* Fri Feb 05 2016 Fedora Release Engineering - 1.1.31-509 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + * Mon Aug 10 2015 James Antill - 1.1.31-508 - Update to latest HEAD - Add support for weak deps. to repoquery. From 145529731df4345bfdd37b5e0e574d3c5d218445 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 19 Jul 2016 13:14:29 +0000 Subject: [PATCH 30/55] - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index d5270e4..42f5ce2 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 509%{?dist} +Release: 510%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -705,6 +705,9 @@ fi %{pluginhome}/ovl.* %changelog +* Tue Jul 19 2016 Fedora Release Engineering - 1.1.31-510 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + * Fri Feb 05 2016 Fedora Release Engineering - 1.1.31-509 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild From 16aefa4f29ad2206707cc328bfb8b0de44ab7e89 Mon Sep 17 00:00:00 2001 From: Parag A Nemade Date: Sat, 13 Aug 2016 07:38:02 +0530 Subject: [PATCH 31/55] As per FESCo ticket 1605, remove subpackage yum-updateonboot - Reason it still uses init file and not systemd unit file - Also, decided don't add Obsolete for this removal --- yum-utils.spec | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 42f5ce2..94df554 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 510%{?dist} +Release: 511%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -37,18 +37,6 @@ repotrack, show-installed, show-changed-rco, verifytree, yumdownloader, yum-builddep, yum-complete-transaction, yum-config-manager, yum-debug-dump, yum-debug-restore and yum-groups-manager. -%package -n yum-updateonboot -Summary: Run yum update on system boot -Group: System Environment/Base -Requires: python, yum >= 2.4 -Requires(pre): chkconfig -Requires(post): chkconfig - -%description -n yum-updateonboot -Runs yum update on system boot. This allows machines that have been turned -off for an extended amount of time to become secure immediately, instead of -waiting until the next early morning cron job. - %package -n yum-plugin-changelog Summary: Yum plugin for viewing package changelogs before/after updating Group: System Environment/Base @@ -391,7 +379,6 @@ This plugin touches rpmdb files to work around overlayfs issues. %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install -make -C updateonboot DESTDIR=$RPM_BUILD_ROOT install %find_lang %name @@ -454,15 +441,6 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %clean rm -rf $RPM_BUILD_ROOT -%post -n yum-updateonboot -/sbin/chkconfig --add yum-updateonboot >/dev/null 2>&1 || :; - -%preun -n yum-updateonboot -if [ $1 = 0 ]; then - /sbin/service yum-updateonboot stop >/dev/null 2>&1 || :; - /sbin/chkconfig --del yum-updateonboot >/dev/null 2>&1 || :; -fi - %files -f %{name}.lang %defattr(-, root, root) %doc README yum-util-cli-template @@ -518,12 +496,6 @@ fi %{_mandir}/man1/verifytree.1.* %{_mandir}/man1/yum-config-manager.1.* -%files -n yum-updateonboot -%defattr(-, root, root) -%doc updateonboot/README COPYING -%config(noreplace) %{_sysconfdir}/sysconfig/yum-updateonboot -%{_initrddir}/yum-updateonboot - %files -n yum-plugin-changelog %defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf @@ -705,6 +677,11 @@ fi %{pluginhome}/ovl.* %changelog +* Sat Aug 13 2016 Parag Nemade - 1.1.31-511 +- As per FESCo ticket 1605, remove subpackage yum-updateonboot +- Reason it still uses init file and not systemd unit file +- Also, decided don't add Obsolete for this removal + * Tue Jul 19 2016 Fedora Release Engineering - 1.1.31-510 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages From 6f82df1f6bd6fde9b1ae72a274ab7848f4c96cbc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 11 Feb 2017 18:19:51 +0000 Subject: [PATCH 32/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 94df554..de93a02 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 511%{?dist} +Release: 512%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,9 @@ rm -rf $RPM_BUILD_ROOT %{pluginhome}/ovl.* %changelog +* Sat Feb 11 2017 Fedora Release Engineering - 1.1.31-512 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + * Sat Aug 13 2016 Parag Nemade - 1.1.31-511 - As per FESCo ticket 1605, remove subpackage yum-updateonboot - Reason it still uses init file and not systemd unit file From bb491372dc6421e907c3817dbe8981d1b876be4a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 27 Jul 2017 22:38:30 +0000 Subject: [PATCH 33/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index de93a02..59f8ecc 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 512%{?dist} +Release: 513%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,9 @@ rm -rf $RPM_BUILD_ROOT %{pluginhome}/ovl.* %changelog +* Thu Jul 27 2017 Fedora Release Engineering - 1.1.31-513 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + * Sat Feb 11 2017 Fedora Release Engineering - 1.1.31-512 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild From 1b4f292d8557aa23de9e20f91ffb06fcd7cf0916 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 9 Feb 2018 22:21:38 +0000 Subject: [PATCH 34/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 59f8ecc..e4ee76c 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 513%{?dist} +Release: 514%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -677,6 +677,9 @@ rm -rf $RPM_BUILD_ROOT %{pluginhome}/ovl.* %changelog +* Fri Feb 09 2018 Fedora Release Engineering - 1.1.31-514 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + * Thu Jul 27 2017 Fedora Release Engineering - 1.1.31-513 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild From 450a0190e7bddfe0acaa83f84ddba7bd246b8edb Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 00:52:26 +0100 Subject: [PATCH 35/55] Remove BuildRoot definition None of currently supported distributions need that. It was needed last for EL5 which is EOL now Signed-off-by: Igor Gnatenko --- yum-utils.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index e4ee76c..ff1a198 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -17,7 +17,6 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz Patch1: yum-utils-HEAD.patch Patch2: yum-utils-deprecated.patch URL: http://yum.baseurl.org/download/yum-utils/ -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch Requires: yum >= 3.4.3-148 Requires: python-kitchen From 696588ffe1a837235d5615596cba17459d3d5138 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 14 Feb 2018 09:02:44 +0100 Subject: [PATCH 36/55] Remove %clean section None of currently supported distributions need that. Last one was EL5 which is EOL for a while. Signed-off-by: Igor Gnatenko --- yum-utils.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index ff1a198..6a0feee 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -437,9 +437,6 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo # Tests are not suitable for running at build time # because they require networking and a populated /var/cache/yum -%clean -rm -rf $RPM_BUILD_ROOT - %files -f %{name}.lang %defattr(-, root, root) %doc README yum-util-cli-template From 8e3948353caaefd345a6bb815323fecf7bad69fb Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Wed, 14 Feb 2018 17:27:47 +0100 Subject: [PATCH 37/55] Update Python 2 dependency declarations to new packaging standards --- yum-utils.spec | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 6a0feee..db91ca1 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 514%{?dist} +Release: 515%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -19,8 +19,8 @@ Patch2: yum-utils-deprecated.patch URL: http://yum.baseurl.org/download/yum-utils/ BuildArch: noarch Requires: yum >= 3.4.3-148 -Requires: python-kitchen -BuildRequires: python-devel >= 2.4 +Requires: python2-kitchen +BuildRequires: python2-devel >= 2.4 BuildRequires: gettext BuildRequires: intltool Provides: yum-utils-translations = %{version}-%{release} @@ -44,7 +44,7 @@ Obsoletes: yum-changelog < 1.1.20-0 Conflicts: yum-changelog < 1.1.20-0 # changelog requires new update_md.UpdateMetadata() API in 3.2.23 Requires: yum >= 3.2.23 -Requires: python-dateutil +Requires: python2-dateutil %description -n yum-plugin-changelog This plugin adds a command line option to allow viewing package changelog @@ -345,7 +345,7 @@ Summary: Yum plugin to add puppet checksums to verify data Group: System Environment/Base Provides: yum-puppetverify = %{version}-%{release} Requires: yum >= 3.2.12 -Requires: PyYAML >= 3.09 +Requires: python2-pyyaml >= 3.09 Requires: puppet %description -n yum-plugin-puppetverify @@ -356,7 +356,7 @@ Summary: Yum plugin to add copr command Group: System Environment/Base Provides: yum-copr = %{version}-%{release} Requires: yum >= 3.4.3 -Requires: python-requests +Requires: python2-requests %description -n yum-plugin-copr This plugin adds the command copr, for adding/listing/searching copr repos. @@ -673,6 +673,10 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{pluginhome}/ovl.* %changelog +* Wed Feb 14 2018 Iryna Shcherbina - 1.1.31-515 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + * Fri Feb 09 2018 Fedora Release Engineering - 1.1.31-514 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 1986b08ca21e6ab34b3edcca84eaf5bfdfe2d8ad Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Mon, 9 Jul 2018 23:44:16 -0500 Subject: [PATCH 38/55] Remove needless use of %defattr --- yum-utils.spec | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index db91ca1..a3cbd5e 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -438,7 +438,6 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo # because they require networking and a populated /var/cache/yum %files -f %{name}.lang -%defattr(-, root, root) %doc README yum-util-cli-template %doc COPYING %doc plugins/README @@ -493,7 +492,6 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{_mandir}/man1/yum-config-manager.1.* %files -n yum-plugin-changelog -%defattr(-, root, root) %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf %doc COPYING %{pluginhome}/changelog.* @@ -501,19 +499,16 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{_mandir}/man5/yum-changelog.conf.5.* %files -n yum-plugin-fastestmirror -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf %{pluginhome}/fastestmirror*.* %files -n yum-plugin-protectbase -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/protectbase.conf %{pluginhome}/protectbase.* %files -n yum-plugin-versionlock -%defattr(-, root, root) %doc plugins/versionlock/README COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.conf %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/versionlock.list @@ -522,39 +517,33 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{_mandir}/man5/yum-versionlock.conf.5.* %files -n yum-plugin-tsflags -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf %{pluginhome}/tsflags.* %files -n yum-plugin-priorities -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/priorities.conf %{pluginhome}/priorities.* %if %{package_yum_updatesd} %files -n yum-plugin-refresh-updatesd -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/refresh-updatesd.conf %{pluginhome}/refresh-updatesd.* %endif %files -n yum-plugin-merge-conf -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf %{pluginhome}/merge-conf.* %files -n yum-plugin-upgrade-helper -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/upgrade-helper.conf %{pluginhome}/upgrade-helper.* %files -n yum-plugin-aliases -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/aliases.conf %config(noreplace) %{_sysconfdir}/yum/aliases.conf @@ -562,51 +551,43 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{_mandir}/man1/yum-aliases.1.* %files -n yum-plugin-list-data -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/list-data.conf %{pluginhome}/list-data.* %{_mandir}/man1/yum-list-data.1.* %files -n yum-plugin-filter-data -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/filter-data.conf %{pluginhome}/filter-data.* %{_mandir}/man1/yum-filter-data.1.* %files -n yum-plugin-tmprepo -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tmprepo.conf %{pluginhome}/tmprepo.* %files -n yum-plugin-verify -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/verify.conf %{pluginhome}/verify.* %{_mandir}/man1/yum-verify.1.* %files -n yum-plugin-keys -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/keys.conf %{pluginhome}/keys.* %files -n yum-NetworkManager-dispatcher -%defattr(-, root, root) %doc COPYING /etc/NetworkManager/dispatcher.d/* %files -n yum-plugin-remove-with-leaves -%defattr(-, root, root) %doc COPYING %{pluginhome}/remove-with-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/remove-with-leaves.conf %files -n yum-plugin-post-transaction-actions -%defattr(-, root, root) %doc COPYING %{pluginhome}/post-transaction-actions.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf @@ -615,32 +596,27 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %dir %{_sysconfdir}/yum/post-actions %files -n yum-plugin-rpm-warm-cache -%defattr(-, root, root) %doc COPYING %{pluginhome}/rpm-warm-cache.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/rpm-warm-cache.conf %files -n yum-plugin-auto-update-debug-info -%defattr(-, root, root) %doc COPYING %{pluginhome}/auto-update-debuginfo.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/auto-update-debuginfo.conf %files -n yum-plugin-show-leaves -%defattr(-, root, root) %doc COPYING %{pluginhome}/show-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -%defattr(-, root, root) %doc COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf %{pluginhome}/local.* %files -n yum-plugin-fs-snapshot -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fs-snapshot.conf %{pluginhome}/fs-snapshot.* @@ -648,26 +624,22 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{_mandir}/man5/yum-fs-snapshot.conf.5.* %files -n yum-plugin-ps -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf %{pluginhome}/ps.* %files -n yum-plugin-puppetverify -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf %{pluginhome}/puppetverify.* %files -n yum-plugin-copr -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/copr.conf %{pluginhome}/copr.* %{_mandir}/man8/yum-copr.8.* %files -n yum-plugin-ovl -%defattr(-, root, root) %doc COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ovl.conf %{pluginhome}/ovl.* From e0e80b57de71108ac9d930e6c6e0ac32109c05c1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 14 Jul 2018 09:46:05 +0000 Subject: [PATCH 39/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index a3cbd5e..a094525 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 515%{?dist} +Release: 516%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -645,6 +645,9 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{pluginhome}/ovl.* %changelog +* Sat Jul 14 2018 Fedora Release Engineering - 1.1.31-516 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + * Wed Feb 14 2018 Iryna Shcherbina - 1.1.31-515 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) From 813a4eb6314d82a70edee7cd8267cc92880ea055 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sun, 29 Jul 2018 23:11:46 +0200 Subject: [PATCH 40/55] =?UTF-8?q?%{python=5Fsitelib}=20=E2=86=92=20%{pytho?= =?UTF-8?q?n2=5Fsitelib}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- yum-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index a094525..3f512f9 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -465,7 +465,7 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{_bindir}/show-changed-rco %{_sbindir}/yum-complete-transaction %{_sbindir}/yumdb -%{python_sitelib}/yumutils/ +%{python2_sitelib}/yumutils/ %{_mandir}/man1/yum-utils.1.* %{_mandir}/man1/debuginfo-install.1.* %{_mandir}/man1/package-cleanup.1.* From a9004bdf51093109a1d6b42876503fe1bdedacc9 Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Fri, 31 Aug 2018 17:59:46 +0200 Subject: [PATCH 41/55] Use explicit python2 executable at build time --- explicit-python2-at-build.patch | 9 +++++++++ yum-utils.spec | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 explicit-python2-at-build.patch diff --git a/explicit-python2-at-build.patch b/explicit-python2-at-build.patch new file mode 100644 index 0000000..48f7e59 --- /dev/null +++ b/explicit-python2-at-build.patch @@ -0,0 +1,9 @@ +diff -up yum-utils-1.1.31/yumutils/Makefile.orig yum-utils-1.1.31/yumutils/Makefile +--- yum-utils-1.1.31/yumutils/Makefile.orig 2011-08-10 17:20:19.000000000 +0200 ++++ yum-utils-1.1.31/yumutils/Makefile 2018-08-31 17:49:34.965067361 +0200 +@@ -1,4 +1,4 @@ +-PYTHON=python ++PYTHON=/usr/bin/python2 + PACKAGE = $(shell basename `pwd`) + PYFILES = $(wildcard *.py) + PYVER := $(shell $(PYTHON) -c 'import sys; print "%.3s" %(sys.version)') diff --git a/yum-utils.spec b/yum-utils.spec index 3f512f9..cea2141 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -4,18 +4,19 @@ %define package_yum_updatesd 1 %endif -%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%{!?python_sitelib: %define python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %define pluginhome /usr/lib/yum-plugins Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 516%{?dist} +Release: 517%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz Patch1: yum-utils-HEAD.patch Patch2: yum-utils-deprecated.patch +Patch3: explicit-python2-at-build.patch URL: http://yum.baseurl.org/download/yum-utils/ BuildArch: noarch Requires: yum >= 3.4.3-148 @@ -374,6 +375,7 @@ This plugin touches rpmdb files to work around overlayfs issues. %setup -q %patch1 -p1 %patch2 -p1 +%patch3 -p1 %install rm -rf $RPM_BUILD_ROOT @@ -423,7 +425,7 @@ cd plugins for plug in $plugins; do install -m 644 $plug/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ install -m 644 $plug/*.py $RPM_BUILD_ROOT/%pluginhome - %{__python} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/%pluginhome', 1)" + %{__python2} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/%pluginhome', 1)" done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ @@ -645,6 +647,9 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{pluginhome}/ovl.* %changelog +* Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 +- Use explicit python2 executable at build time + * Sat Jul 14 2018 Fedora Release Engineering - 1.1.31-516 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 20f83a7c326451844559b1415fbdb8173dc59d8d Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Fri, 31 Aug 2018 18:06:09 +0200 Subject: [PATCH 42/55] reposync: prevent path traversal (CVE-2018-10897) Resolves: bug#1600454 --- reposync-prevent-path-traversal.patch | 119 ++++++++++++++++++++++++++ yum-utils.spec | 4 + 2 files changed, 123 insertions(+) create mode 100644 reposync-prevent-path-traversal.patch diff --git a/reposync-prevent-path-traversal.patch b/reposync-prevent-path-traversal.patch new file mode 100644 index 0000000..026778d --- /dev/null +++ b/reposync-prevent-path-traversal.patch @@ -0,0 +1,119 @@ +diff -up yum-utils-1.1.31/docs/reposync.1.orig yum-utils-1.1.31/docs/reposync.1 +--- yum-utils-1.1.31/docs/reposync.1.orig 2018-08-31 15:14:08.100322216 +0200 ++++ yum-utils-1.1.31/docs/reposync.1 2018-08-31 15:14:14.680403500 +0200 +@@ -47,6 +47,16 @@ Download all the non-default metadata + Download only newest packages per-repo. + .IP "\fB\-q, \-\-quiet\fP" + Output as little information as possible. ++.IP "\fB\-\-allow-path-traversal\fP" ++Allow packages stored outside their repo directory to be synced. ++These are packages that are referenced in metadata by using absolute paths or ++up-level ".." symbols, and are normally skipped by \fBreposync\fR for security ++reasons. ++ ++\fBCAUTION:\fR Using this option has potential security implications since, by ++providing malicious repodata, an attacker could make \fBreposync\fR write to ++arbitrary locations on the file system that are accessible by the user running ++it. + .SH "EXAMPLES" + .IP "Sync all packages from the 'updates' repo to the current directory:" + \fB reposync \-\-repoid=updates\fP +diff -up yum-utils-1.1.31/reposync.py.orig yum-utils-1.1.31/reposync.py +--- yum-utils-1.1.31/reposync.py.orig 2018-08-31 15:14:08.112322364 +0200 ++++ yum-utils-1.1.31/reposync.py 2018-08-31 15:14:14.680403500 +0200 +@@ -75,6 +75,12 @@ def localpkgs(directory): + cache[name] = {'path': fn, 'size': st.st_size, 'device': st.st_dev} + return cache + ++def is_subpath(path, root): ++ root = os.path.realpath(root) ++ path = os.path.realpath(os.path.join(root, path)) ++ # join() is used below to ensure root ends with a slash ++ return path.startswith(os.path.join(root, '')) ++ + def parseArgs(): + usage = _(""" + Reposync is used to synchronize a remote yum repository to a local +@@ -117,6 +123,10 @@ def parseArgs(): + parser.add_option("", "--download-metadata", dest="downloadmd", + default=False, action="store_true", + help=_("download all the non-default metadata")) ++ parser.add_option("", "--allow-path-traversal", default=False, ++ action="store_true", ++ help=_("Allow packages stored outside their repo directory to be synced " ++ "(UNSAFE, USE WITH CAUTION!)")) + (opts, args) = parser.parse_args() + return (opts, args) + +@@ -217,13 +227,36 @@ def main(): + else: + local_repo_path = opts.destdir + '/' + repo.id + ++ # Ensure we don't traverse out of local_repo_path by dropping any ++ # packages whose remote_path is absolute or contains up-level ++ # references (unless explicitly allowed). ++ # See RHBZ#1600221 for details. ++ if not opts.allow_path_traversal: ++ newlist = [] ++ skipped = False ++ for pkg in download_list: ++ if is_subpath(pkg.remote_path, local_repo_path): ++ newlist.append(pkg) ++ continue ++ my.logger.warning( ++ _('WARNING: skipping package %s: remote path "%s" not ' ++ 'within repodir, unsafe to mirror locally') ++ % (pkg, pkg.remote_path) ++ ) ++ skipped = True ++ if skipped: ++ my.logger.info( ++ _('You can enable unsafe remote paths by using ' ++ '--allow-path-traversal (see reposync(1) for details)') ++ ) ++ download_list = newlist ++ + if opts.delete and os.path.exists(local_repo_path): + current_pkgs = localpkgs(local_repo_path) + + download_set = {} + for pkg in download_list: +- remote = pkg.returnSimple('relativepath') +- rpmname = os.path.basename(remote) ++ rpmname = os.path.basename(pkg.remote_path) + download_set[rpmname] = 1 + + for pkg in current_pkgs: +@@ -270,8 +303,7 @@ def main(): + remote_size = 0 + if not opts.urls: + for pkg in download_list: +- remote = pkg.returnSimple('relativepath') +- local = local_repo_path + '/' + remote ++ local = os.path.join(local_repo_path, pkg.remote_path) + sz = int(pkg.returnSimple('packagesize')) + if os.path.exists(local) and os.path.getsize(local) == sz: + continue +@@ -283,10 +315,9 @@ def main(): + download_list.sort(key=lambda pkg: pkg.name) + if opts.urls: + for pkg in download_list: +- remote = pkg.returnSimple('relativepath') +- local = os.path.join(local_repo_path, remote) ++ local = os.path.join(local_repo_path, pkg.remote_path) + if not (os.path.exists(local) and my.verifyPkg(local, pkg, False)): +- print urljoin(pkg.repo.urls[0], pkg.relativepath) ++ print urljoin(pkg.repo.urls[0], pkg.remote_path) + continue + + # create dest dir +@@ -295,8 +326,7 @@ def main(): + + # set localpaths + for pkg in download_list: +- rpmfn = pkg.remote_path +- pkg.localpath = os.path.join(local_repo_path, rpmfn) ++ pkg.localpath = os.path.join(local_repo_path, pkg.remote_path) + pkg.repo.copy_local = True + pkg.repo.cache = 0 + localdir = os.path.dirname(pkg.localpath) diff --git a/yum-utils.spec b/yum-utils.spec index cea2141..37d2d5c 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -17,6 +17,7 @@ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz Patch1: yum-utils-HEAD.patch Patch2: yum-utils-deprecated.patch Patch3: explicit-python2-at-build.patch +Patch4: reposync-prevent-path-traversal.patch URL: http://yum.baseurl.org/download/yum-utils/ BuildArch: noarch Requires: yum >= 3.4.3-148 @@ -376,6 +377,7 @@ This plugin touches rpmdb files to work around overlayfs issues. %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 %install rm -rf $RPM_BUILD_ROOT @@ -649,6 +651,8 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %changelog * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time +- reposync: prevent path traversal (CVE-2018-10897) +- Resolves: bug#1600454 * Sat Jul 14 2018 Fedora Release Engineering - 1.1.31-516 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild From 2ab7f48ba5f3d42b66878e2c93b0e51581236ed6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 18:51:15 +0200 Subject: [PATCH 43/55] Replace %%define with %%global --- yum-utils.spec | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 37d2d5c..8b09095 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -1,16 +1,16 @@ %if 0%{?rhel} -%define package_yum_updatesd 0 +%global package_yum_updatesd 0 %else -%define package_yum_updatesd 1 +%global package_yum_updatesd 1 %endif -%{!?python_sitelib: %define python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%define pluginhome /usr/lib/yum-plugins +%{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} +%global pluginhome /usr/lib/yum-plugins Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 517%{?dist} +Release: 518%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -649,6 +649,9 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %{pluginhome}/ovl.* %changelog +* Wed Oct 17 2018 Björn Esser - 1.1.31-518 +- Replace %%define with %%global + * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time - reposync: prevent path traversal (CVE-2018-10897) From ee9bb2d244955a92fe6842eb5c969b6e16ab2847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 18:53:14 +0200 Subject: [PATCH 44/55] Use explicit python2 shebang --- yum-utils.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yum-utils.spec b/yum-utils.spec index 8b09095..5793f5d 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -4,6 +4,7 @@ %global package_yum_updatesd 1 %endif +%global __python %{__python2} %{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global pluginhome /usr/lib/yum-plugins @@ -435,6 +436,9 @@ install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/p mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo +# use explicit python2 shebang. +grep -Rl '#!.*/usr/bin/python' $RPM_BUILD_ROOT | \ +xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' %check # To execute: ./test/test-all @@ -651,6 +655,7 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo %changelog * Wed Oct 17 2018 Björn Esser - 1.1.31-518 - Replace %%define with %%global +- Use explicit python2 shebang * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From e6207805fd716a17d451acf890cf5f94c5d7e723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:03:02 +0200 Subject: [PATCH 45/55] Move COPYING to %%license --- yum-utils.spec | 55 +++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 5793f5d..1a966e3 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -447,7 +447,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' %files -f %{name}.lang %doc README yum-util-cli-template -%doc COPYING +%license COPYING %doc plugins/README %{_sysconfdir}/bash_completion.d %{_bindir}/debuginfo-install @@ -501,18 +501,18 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' %files -n yum-plugin-changelog %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/changelog.conf -%doc COPYING +%license COPYING %{pluginhome}/changelog.* %{_mandir}/man1/yum-changelog.1.* %{_mandir}/man5/yum-changelog.conf.5.* %files -n yum-plugin-fastestmirror -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fastestmirror.conf %{pluginhome}/fastestmirror*.* %files -n yum-plugin-protectbase -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/protectbase.conf %{pluginhome}/protectbase.* @@ -525,78 +525,78 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' %{_mandir}/man5/yum-versionlock.conf.5.* %files -n yum-plugin-tsflags -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tsflags.conf %{pluginhome}/tsflags.* %files -n yum-plugin-priorities -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/priorities.conf %{pluginhome}/priorities.* %if %{package_yum_updatesd} %files -n yum-plugin-refresh-updatesd -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/refresh-updatesd.conf %{pluginhome}/refresh-updatesd.* %endif %files -n yum-plugin-merge-conf -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/merge-conf.conf %{pluginhome}/merge-conf.* %files -n yum-plugin-upgrade-helper -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/upgrade-helper.conf %{pluginhome}/upgrade-helper.* %files -n yum-plugin-aliases -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/aliases.conf %config(noreplace) %{_sysconfdir}/yum/aliases.conf %{pluginhome}/aliases.* %{_mandir}/man1/yum-aliases.1.* %files -n yum-plugin-list-data -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/list-data.conf %{pluginhome}/list-data.* %{_mandir}/man1/yum-list-data.1.* %files -n yum-plugin-filter-data -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/filter-data.conf %{pluginhome}/filter-data.* %{_mandir}/man1/yum-filter-data.1.* %files -n yum-plugin-tmprepo -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/tmprepo.conf %{pluginhome}/tmprepo.* %files -n yum-plugin-verify -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/verify.conf %{pluginhome}/verify.* %{_mandir}/man1/yum-verify.1.* %files -n yum-plugin-keys -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/keys.conf %{pluginhome}/keys.* %files -n yum-NetworkManager-dispatcher -%doc COPYING +%license COPYING /etc/NetworkManager/dispatcher.d/* %files -n yum-plugin-remove-with-leaves -%doc COPYING +%license COPYING %{pluginhome}/remove-with-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/remove-with-leaves.conf %files -n yum-plugin-post-transaction-actions -%doc COPYING +%license COPYING %{pluginhome}/post-transaction-actions.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/post-transaction-actions.conf %doc plugins/post-transaction-actions/sample.action @@ -604,51 +604,51 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' %dir %{_sysconfdir}/yum/post-actions %files -n yum-plugin-rpm-warm-cache -%doc COPYING +%license COPYING %{pluginhome}/rpm-warm-cache.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/rpm-warm-cache.conf %files -n yum-plugin-auto-update-debug-info -%doc COPYING +%license COPYING %{pluginhome}/auto-update-debuginfo.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/auto-update-debuginfo.conf %files -n yum-plugin-show-leaves -%doc COPYING +%license COPYING %{pluginhome}/show-leaves.* %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/show-leaves.conf %files -n yum-plugin-local -%doc COPYING +%license COPYING %ghost %{_sysconfdir}/yum.repos.d/_local.repo %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/local.conf %{pluginhome}/local.* %files -n yum-plugin-fs-snapshot -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/fs-snapshot.conf %{pluginhome}/fs-snapshot.* %{_mandir}/man1/yum-fs-snapshot.1.* %{_mandir}/man5/yum-fs-snapshot.conf.5.* %files -n yum-plugin-ps -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ps.conf %{pluginhome}/ps.* %files -n yum-plugin-puppetverify -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/puppetverify.conf %{pluginhome}/puppetverify.* %files -n yum-plugin-copr -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/copr.conf %{pluginhome}/copr.* %{_mandir}/man8/yum-copr.8.* %files -n yum-plugin-ovl -%doc COPYING +%license COPYING %config(noreplace) %{_sysconfdir}/yum/pluginconf.d/ovl.conf %{pluginhome}/ovl.* @@ -656,6 +656,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' * Wed Oct 17 2018 Björn Esser - 1.1.31-518 - Replace %%define with %%global - Use explicit python2 shebang +- Move COPYING to %%license * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 17bddd0bce729456c9f5369d82ea582ad19fec0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:11:09 +0200 Subject: [PATCH 46/55] Use %%py_byte_compile for %%pluginhome --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 1a966e3..6b3c308 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -428,7 +428,6 @@ cd plugins for plug in $plugins; do install -m 644 $plug/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ install -m 644 $plug/*.py $RPM_BUILD_ROOT/%pluginhome - %{__python2} -c "import compileall; compileall.compile_dir('$RPM_BUILD_ROOT/%pluginhome', 1)" done install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ @@ -440,6 +439,9 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo grep -Rl '#!.*/usr/bin/python' $RPM_BUILD_ROOT | \ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' +# Python byte compilation for %%pluginhome. +%py_byte_compile %{__python2} $RPM_BUILD_ROOT/%pluginhome + %check # To execute: ./test/test-all # Tests are not suitable for running at build time @@ -657,6 +659,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Replace %%define with %%global - Use explicit python2 shebang - Move COPYING to %%license +- Use %%py_byte_compile for %%pluginhome * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 87c18a342e9442aadd2b0ce7ce62f63d50a54b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:15:25 +0200 Subject: [PATCH 47/55] Clean trailing white-space --- yum-utils.spec | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 6b3c308..aa19be4 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -32,8 +32,8 @@ Provides: yum-utils-translations = %{version}-%{release} %description yum-utils is a collection of utilities and examples for the yum package manager. It includes utilities by different authors that make yum easier and -more powerful to use. These tools include: debuginfo-install, -find-repos-of-install, needs-restarting, package-cleanup, repoclosure, +more powerful to use. These tools include: debuginfo-install, +find-repos-of-install, needs-restarting, package-cleanup, repoclosure, repodiff, repo-graph, repomanage, repoquery, repo-rss, reposync, repotrack, show-installed, show-changed-rco, verifytree, yumdownloader, yum-builddep, yum-complete-transaction, yum-config-manager, yum-debug-dump, @@ -276,7 +276,7 @@ no checking of previous data, so if your WiFi keeps going up and down (or you suspend/resume a lot) yum will recheck its cached data a lot. %package -n yum-plugin-rpm-warm-cache -Summary: Yum plugin to access the rpmdb files early to warm up access to the db +Summary: Yum plugin to access the rpmdb files early to warm up access to the db Group: System Environment/Base Provides: yum-rpm-warm-cache = %{version}-%{release} Obsoletes: yum-rpm-warm-cache < 1.1.20-0 @@ -352,7 +352,7 @@ Requires: python2-pyyaml >= 3.09 Requires: puppet %description -n yum-plugin-puppetverify -Supplies checksums for files in packages from puppet's state file. +Supplies checksums for files in packages from puppet's state file. %package -n yum-plugin-copr Summary: Yum plugin to add copr command @@ -660,6 +660,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Use explicit python2 shebang - Move COPYING to %%license - Use %%py_byte_compile for %%pluginhome +- Clean trailing white-space * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time @@ -866,10 +867,10 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' * Sat Jan 14 2012 Fedora Release Engineering - 1.1.31-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild -* Sat Aug 13 2011 Tim Lauridsen +* Sat Aug 13 2011 Tim Lauridsen - fix traceback in auto-update-debuginfo plugin (rhbz #729982) -* Wed Aug 10 2011 Tim Lauridsen +* Wed Aug 10 2011 Tim Lauridsen - mark as 1.1.31 - remove patches @@ -880,8 +881,8 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' * Tue Feb 08 2011 Fedora Release Engineering - 1.1.30-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild -* Thu Jan 13 2011 Tim Lauridsen -- mark as 1.1.30 - +* Thu Jan 13 2011 Tim Lauridsen +- mark as 1.1.30 + * Mon Jan 3 2011 Tim Lauridsen - Added yumutils python module From 4805f3079ab3fac9c1a5fb102ae9e4a6843af4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:17:24 +0200 Subject: [PATCH 48/55] Remove obsolete Group tag --- yum-utils.spec | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index aa19be4..261d09f 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -13,7 +13,6 @@ Name: yum-utils Version: 1.1.31 Release: 518%{?dist} License: GPLv2+ -Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz Patch1: yum-utils-HEAD.patch Patch2: yum-utils-deprecated.patch @@ -41,7 +40,6 @@ yum-debug-restore and yum-groups-manager. %package -n yum-plugin-changelog Summary: Yum plugin for viewing package changelogs before/after updating -Group: System Environment/Base Provides: yum-changelog = %{version}-%{release} Obsoletes: yum-changelog < 1.1.20-0 Conflicts: yum-changelog < 1.1.20-0 @@ -55,7 +53,6 @@ deltas before or after updating packages. %package -n yum-plugin-fastestmirror Summary: Yum plugin which chooses fastest repository from a mirrorlist -Group: System Environment/Base Provides: yum-fastestmirror = %{version}-%{release} Obsoletes: yum-fastestmirror < 1.1.20-0 Conflicts: yum-fastestmirror < 1.1.20-0 @@ -67,7 +64,6 @@ prior to downloading packages. %package -n yum-plugin-protectbase Summary: Yum plugin to protect packages from certain repositories. -Group: System Environment/Base Provides: yum-protectbase = %{version}-%{release} Obsoletes: yum-protectbase < 1.1.20-0 Conflicts: yum-protectbase < 1.1.20-0 @@ -80,7 +76,6 @@ repositories even if the non-protected repo has a later version. %package -n yum-plugin-versionlock Summary: Yum plugin to lock specified packages from being updated -Group: System Environment/Base Provides: yum-versionlock = %{version}-%{release} Obsoletes: yum-versionlock < 1.1.20-0 Conflicts: yum-versionlock < 1.1.20-0 @@ -94,7 +89,6 @@ for example. %package -n yum-plugin-tsflags Summary: Yum plugin to add tsflags by a commandline option -Group: System Environment/Base Provides: yum-tsflags = %{version}-%{release} Obsoletes: yum-tsflags < 1.1.20-0 Conflicts: yum-tsflags < 1.1.20-0 @@ -106,7 +100,6 @@ command line %package -n yum-plugin-priorities Summary: plugin to give priorities to packages from different repos -Group: System Environment/Base Provides: yum-priorities = %{version}-%{release} Obsoletes: yum-priorities < 1.1.20-0 Conflicts: yum-priorities < 1.1.20-0 @@ -120,7 +113,6 @@ from a repository with a higher priority even if repo has a later version. %if %{package_yum_updatesd} %package -n yum-plugin-refresh-updatesd Summary: Tell yum-updatesd to check for updates when yum exits -Group: System Environment/Base Provides: yum-refresh-updatesd = %{version}-%{release} Obsoletes: yum-refresh-updatesd < 1.1.20-0 Conflicts: yum-refresh-updatesd < 1.1.20-0 @@ -135,7 +127,6 @@ will almost instantly update itself to reflect this. %package -n yum-plugin-merge-conf Summary: Yum plugin to merge configuration changes when installing packages -Group: System Environment/Base Provides: yum-merge-conf = %{version}-%{release} Obsoletes: yum-merge-conf < 1.1.20-0 Conflicts: yum-merge-conf < 1.1.20-0 @@ -148,7 +139,6 @@ package. %package -n yum-plugin-upgrade-helper Summary: Yum plugin to help upgrades to the next distribution version -Group: System Environment/Base Provides: yum-upgrade-helper = %{version}-%{release} Obsoletes: yum-upgrade-helper < 1.1.20-0 Conflicts: yum-upgrade-helper < 1.1.20-0 @@ -160,7 +150,6 @@ metadata file in repositories. It is used to simplify distribution upgrade hangu %package -n yum-plugin-aliases Summary: Yum plugin to enable aliases filters -Group: System Environment/Base Provides: yum-aliases = %{version}-%{release} Obsoletes: yum-aliases < 1.1.20-0 Conflicts: yum-aliases < 1.1.20-0 @@ -174,7 +163,6 @@ enable aliases. %package -n yum-plugin-list-data Summary: Yum plugin to list aggregate package data -Group: System Environment/Base Provides: yum-list-data = %{version}-%{release} Obsoletes: yum-list-data < 1.1.20-0 Conflicts: yum-list-data < 1.1.20-0 @@ -187,7 +175,6 @@ installed-sizes. %package -n yum-plugin-filter-data Summary: Yum plugin to list filter based on package data -Group: System Environment/Base Provides: yum-filter-data = %{version}-%{release} Obsoletes: yum-filter-data < 1.1.20-0 Conflicts: yum-filter-data < 1.1.20-0 @@ -201,7 +188,6 @@ each category, if any were specified. %package -n yum-plugin-tmprepo Summary: Yum plugin to add temporary repositories -Group: System Environment/Base Provides: yum-tmprepo = %{version}-%{release} Obsoletes: yum-tmprepo < 1.1.20-0 Conflicts: yum-tmprepo < 1.1.20-0 @@ -216,7 +202,6 @@ gpg checking to be disabled. %package -n yum-plugin-verify Summary: Yum plugin to add verify command, and options -Group: System Environment/Base Provides: yum-verify = %{version}-%{release} Obsoletes: yum-verify < 1.1.20-0 Conflicts: yum-verify < 1.1.20-0 @@ -229,7 +214,6 @@ installation. %package -n yum-plugin-keys Summary: Yum plugin to deal with signing keys -Group: System Environment/Base Provides: yum-keys = %{version}-%{release} Obsoletes: yum-keys < 1.1.20-0 Conflicts: yum-keys < 1.1.20-0 @@ -241,7 +225,6 @@ allow you to query and remove signing keys. %package -n yum-plugin-remove-with-leaves Summary: Yum plugin to remove dependencies which are no longer used because of a removal -Group: System Environment/Base Provides: yum-remove-with-leaves = %{version}-%{release} Obsoletes: yum-remove-with-leaves < 1.1.20-0 Conflicts: yum-remove-with-leaves < 1.1.20-0 @@ -254,7 +237,6 @@ libraries and packages. %package -n yum-plugin-post-transaction-actions Summary: Yum plugin to run arbitrary commands when certain pkgs are acted on -Group: System Environment/Base Provides: yum-post-transaction-actions = %{version}-%{release} Obsoletes: yum-post-transaction-actions < 1.1.20-0 Conflicts: yum-post-transaction-actions < 1.1.20-0 @@ -266,7 +248,6 @@ transaction when specified packages are changed. %package -n yum-NetworkManager-dispatcher Summary: NetworkManager script which tells yum to check its cache on network change -Group: System Environment/Base Requires: yum >= 3.2.17 %description -n yum-NetworkManager-dispatcher @@ -277,7 +258,6 @@ suspend/resume a lot) yum will recheck its cached data a lot. %package -n yum-plugin-rpm-warm-cache Summary: Yum plugin to access the rpmdb files early to warm up access to the db -Group: System Environment/Base Provides: yum-rpm-warm-cache = %{version}-%{release} Obsoletes: yum-rpm-warm-cache < 1.1.20-0 Conflicts: yum-rpm-warm-cache < 1.1.20-0 @@ -290,7 +270,6 @@ rpmdb directly. In some cases this should speed up access to rpmdb information %package -n yum-plugin-auto-update-debug-info # Works by searching for *-debuginfo ... so it shouldn't trigger on itself. Summary: Yum plugin to enable automatic updates to installed debuginfo packages -Group: System Environment/Base Obsoletes: yum-plugin-auto-update-debuginfo < 1.1.21-0 Conflicts: yum-plugin-auto-update-debuginfo < 1.1.21-0 Provides: yum-plugin-auto-update-debuginfo = %{version}-%{release} @@ -303,7 +282,6 @@ repositories. %package -n yum-plugin-show-leaves Summary: Yum plugin which shows newly installed leaf packages -Group: System Environment/Base Requires: yum >= 3.2.23 %description -n yum-plugin-show-leaves @@ -312,7 +290,6 @@ and packages that became leaves after a transaction %package -n yum-plugin-local Summary: Yum plugin to automatically manage a local repo. of downloaded packages -Group: System Environment/Base # Who the hell knows what version :) Requires: yum >= 3.2.22 Requires: createrepo @@ -325,7 +302,6 @@ repo. removes it (and can thus. be reinstalled/downgraded/etc.). %package -n yum-plugin-fs-snapshot Summary: Yum plugin to automatically snapshot your filesystems during updates -Group: System Environment/Base Requires: yum >= 3.2.22 Requires: btrfs-progs @@ -335,7 +311,6 @@ filesystem that is touched by the packages in a yum update or yum remove. %package -n yum-plugin-ps Summary: Yum plugin to look at processes, with respect to packages -Group: System Environment/Base Requires: yum >= 3.2.27 %description -n yum-plugin-ps @@ -345,7 +320,6 @@ need rebooting, or have updates, etc.) %package -n yum-plugin-puppetverify Summary: Yum plugin to add puppet checksums to verify data -Group: System Environment/Base Provides: yum-puppetverify = %{version}-%{release} Requires: yum >= 3.2.12 Requires: python2-pyyaml >= 3.09 @@ -356,7 +330,6 @@ Supplies checksums for files in packages from puppet's state file. %package -n yum-plugin-copr Summary: Yum plugin to add copr command -Group: System Environment/Base Provides: yum-copr = %{version}-%{release} Requires: yum >= 3.4.3 Requires: python2-requests @@ -366,7 +339,6 @@ This plugin adds the command copr, for adding/listing/searching copr repos. %package -n yum-plugin-ovl Summary: Yum plugin to work around overlayfs issues -Group: System Environment/Base Provides: yum-ovl = %{version}-%{release} Requires: yum >= 3.4.3 @@ -661,6 +633,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Move COPYING to %%license - Use %%py_byte_compile for %%pluginhome - Clean trailing white-space +- Remove obsolete Group tag * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 0ef80740aeb910b5cd9a5237f0af888e16814efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:22:17 +0200 Subject: [PATCH 49/55] Replace $RPM_BUILD_ROOT with %%{buildroot} --- yum-utils.spec | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 261d09f..45f08f6 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -353,8 +353,8 @@ This plugin touches rpmdb files to work around overlayfs issues. %patch4 -p1 %install -rm -rf $RPM_BUILD_ROOT -make DESTDIR=$RPM_BUILD_ROOT install +rm -rf %{buildroot} +make DESTDIR=%{buildroot} install %find_lang %name @@ -393,26 +393,26 @@ plugins="$plugins \ " %endif -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ $RPM_BUILD_ROOT/%pluginhome -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/post-actions +mkdir -p %{buildroot}%{_sysconfdir}/yum/pluginconf.d/ %{buildroot}%pluginhome +mkdir -p %{buildroot}%{_sysconfdir}/yum/post-actions cd plugins for plug in $plugins; do - install -m 644 $plug/*.conf $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ - install -m 644 $plug/*.py $RPM_BUILD_ROOT/%pluginhome + install -m 644 $plug/*.conf %{buildroot}%{_sysconfdir}/yum/pluginconf.d/ + install -m 644 $plug/*.py %{buildroot}%pluginhome done -install -m 644 aliases/aliases $RPM_BUILD_ROOT/%{_sysconfdir}/yum/aliases.conf -install -m 644 versionlock/versionlock.list $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d/ +install -m 644 aliases/aliases %{buildroot}%{_sysconfdir}/yum/aliases.conf +install -m 644 versionlock/versionlock.list %{buildroot}%{_sysconfdir}/yum/pluginconf.d/ # need for for the ghost in files section of yum-plugin-local -mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum.repos.d -touch $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d/_local.repo +mkdir -p %{buildroot}%{_sysconfdir}/yum.repos.d +touch %{buildroot}%{_sysconfdir}/yum.repos.d/_local.repo # use explicit python2 shebang. -grep -Rl '#!.*/usr/bin/python' $RPM_BUILD_ROOT | \ +grep -Rl '#!.*/usr/bin/python' %{buildroot} | \ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' # Python byte compilation for %%pluginhome. -%py_byte_compile %{__python2} $RPM_BUILD_ROOT/%pluginhome +%py_byte_compile %{__python2} %{buildroot}%pluginhome %check # To execute: ./test/test-all @@ -634,6 +634,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Use %%py_byte_compile for %%pluginhome - Clean trailing white-space - Remove obsolete Group tag +- Replace $RPM_BUILD_ROOT with %%{buildroot} * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 2b7f3fd6cd0b50c2d0d5fee231ec64578865780b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:24:10 +0200 Subject: [PATCH 50/55] Use %%autosetup --- yum-utils.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index 45f08f6..051f3c9 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -346,11 +346,7 @@ Requires: yum >= 3.4.3 This plugin touches rpmdb files to work around overlayfs issues. %prep -%setup -q -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 +%autosetup -p1 %install rm -rf %{buildroot} @@ -635,6 +631,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Clean trailing white-space - Remove obsolete Group tag - Replace $RPM_BUILD_ROOT with %%{buildroot} +- Use %%autosetup * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 881f03ae9ea76d4637bc6ecaab9defa28fadb1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:24:50 +0200 Subject: [PATCH 51/55] Drop rm -rf %%{buildroot} --- yum-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 051f3c9..f88cebb 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -349,7 +349,6 @@ This plugin touches rpmdb files to work around overlayfs issues. %autosetup -p1 %install -rm -rf %{buildroot} make DESTDIR=%{buildroot} install %find_lang %name @@ -632,6 +631,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Remove obsolete Group tag - Replace $RPM_BUILD_ROOT with %%{buildroot} - Use %%autosetup +- Drop rm -rf %%{buildroot} * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From d9e63e37472ce9cd9a3df1385c214f1e013a3817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:25:30 +0200 Subject: [PATCH 52/55] Use %%make_install --- yum-utils.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yum-utils.spec b/yum-utils.spec index f88cebb..7755c4c 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -349,8 +349,7 @@ This plugin touches rpmdb files to work around overlayfs issues. %autosetup -p1 %install -make DESTDIR=%{buildroot} install - +%make_install %find_lang %name # Plugins to install @@ -632,6 +631,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Replace $RPM_BUILD_ROOT with %%{buildroot} - Use %%autosetup - Drop rm -rf %%{buildroot} +- Use %%make_install * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 814878d86d85c9c37b81a95366fe549898a92eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 17 Oct 2018 19:41:15 +0200 Subject: [PATCH 53/55] Drop unused definition of %%python_sitelib --- yum-utils.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index 7755c4c..cdd533a 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -5,7 +5,6 @@ %endif %global __python %{__python2} -%{!?python_sitelib: %global python_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %global pluginhome /usr/lib/yum-plugins Summary: Utilities based around the yum package manager @@ -632,6 +631,7 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' - Use %%autosetup - Drop rm -rf %%{buildroot} - Use %%make_install +- Drop unused definition of %%python_sitelib * Fri Aug 31 2018 Michal Domonkos - 1.1.31-517 - Use explicit python2 executable at build time From 0e5e6c9eb8ad0109282e1a0e5915bd6161f9be63 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 3 Feb 2019 13:05:13 +0000 Subject: [PATCH 54/55] - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- yum-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yum-utils.spec b/yum-utils.spec index cdd533a..7a9617b 100644 --- a/yum-utils.spec +++ b/yum-utils.spec @@ -10,7 +10,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 518%{?dist} +Release: 519%{?dist} License: GPLv2+ Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz Patch1: yum-utils-HEAD.patch @@ -620,6 +620,9 @@ xargs sed -i -e 's~#!.*/usr/bin/python~#!%{__python2}~g' %{pluginhome}/ovl.* %changelog +* Sun Feb 03 2019 Fedora Release Engineering - 1.1.31-519 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + * Wed Oct 17 2018 Björn Esser - 1.1.31-518 - Replace %%define with %%global - Use explicit python2 shebang From f30a17f6dccb700b3493b935d2cfc23bfa7ec7b9 Mon Sep 17 00:00:00 2001 From: Michal Domonkos Date: Tue, 26 Feb 2019 12:48:00 +0100 Subject: [PATCH 55/55] Superseded by DNF. For details, see: https://fedoraproject.org/wiki/Changes/Retire_YUM_3 --- .gitignore | 5 - commit-build.sh | 6 - dead.package | 1 + diff-specs.sh | 7 - explicit-python2-at-build.patch | 9 - reposync-prevent-path-traversal.patch | 119 - sources | 1 - yum-utils-HEAD.patch | 7480 ------------------------- yum-utils-deprecated.patch | 495 -- yum-utils.spec | 862 --- 10 files changed, 1 insertion(+), 8984 deletions(-) delete mode 100644 .gitignore delete mode 100755 commit-build.sh create mode 100644 dead.package delete mode 100755 diff-specs.sh delete mode 100644 explicit-python2-at-build.patch delete mode 100644 reposync-prevent-path-traversal.patch delete mode 100644 sources delete mode 100644 yum-utils-HEAD.patch delete mode 100644 yum-utils-deprecated.patch delete mode 100644 yum-utils.spec diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 137fcee..0000000 --- a/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -yum-utils-1.1.27.tar.gz -yum-utils-1.1.28.tar.gz -/yum-utils-1.1.29.tar.gz -/yum-utils-1.1.30.tar.gz -/yum-utils-1.1.31.tar.gz diff --git a/commit-build.sh b/commit-build.sh deleted file mode 100755 index 7094099..0000000 --- a/commit-build.sh +++ /dev/null @@ -1,6 +0,0 @@ -#! /bin/sh -e - -fedpkg clog -git commit -a -F clog -git push -fedpkg build 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/diff-specs.sh b/diff-specs.sh deleted file mode 100755 index fd23347..0000000 --- a/diff-specs.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -e - -# yum-utils-3.4.3-44.fc19 -ver=$(/usr/bin/fedpkg verrel | perl -lpe 's/-[^-]+$//') - -fedpkg prep > /dev/null -diff -u yum-utils.spec $ver/yum-utils.spec diff --git a/explicit-python2-at-build.patch b/explicit-python2-at-build.patch deleted file mode 100644 index 48f7e59..0000000 --- a/explicit-python2-at-build.patch +++ /dev/null @@ -1,9 +0,0 @@ -diff -up yum-utils-1.1.31/yumutils/Makefile.orig yum-utils-1.1.31/yumutils/Makefile ---- yum-utils-1.1.31/yumutils/Makefile.orig 2011-08-10 17:20:19.000000000 +0200 -+++ yum-utils-1.1.31/yumutils/Makefile 2018-08-31 17:49:34.965067361 +0200 -@@ -1,4 +1,4 @@ --PYTHON=python -+PYTHON=/usr/bin/python2 - PACKAGE = $(shell basename `pwd`) - PYFILES = $(wildcard *.py) - PYVER := $(shell $(PYTHON) -c 'import sys; print "%.3s" %(sys.version)') diff --git a/reposync-prevent-path-traversal.patch b/reposync-prevent-path-traversal.patch deleted file mode 100644 index 026778d..0000000 --- a/reposync-prevent-path-traversal.patch +++ /dev/null @@ -1,119 +0,0 @@ -diff -up yum-utils-1.1.31/docs/reposync.1.orig yum-utils-1.1.31/docs/reposync.1 ---- yum-utils-1.1.31/docs/reposync.1.orig 2018-08-31 15:14:08.100322216 +0200 -+++ yum-utils-1.1.31/docs/reposync.1 2018-08-31 15:14:14.680403500 +0200 -@@ -47,6 +47,16 @@ Download all the non-default metadata - Download only newest packages per-repo. - .IP "\fB\-q, \-\-quiet\fP" - Output as little information as possible. -+.IP "\fB\-\-allow-path-traversal\fP" -+Allow packages stored outside their repo directory to be synced. -+These are packages that are referenced in metadata by using absolute paths or -+up-level ".." symbols, and are normally skipped by \fBreposync\fR for security -+reasons. -+ -+\fBCAUTION:\fR Using this option has potential security implications since, by -+providing malicious repodata, an attacker could make \fBreposync\fR write to -+arbitrary locations on the file system that are accessible by the user running -+it. - .SH "EXAMPLES" - .IP "Sync all packages from the 'updates' repo to the current directory:" - \fB reposync \-\-repoid=updates\fP -diff -up yum-utils-1.1.31/reposync.py.orig yum-utils-1.1.31/reposync.py ---- yum-utils-1.1.31/reposync.py.orig 2018-08-31 15:14:08.112322364 +0200 -+++ yum-utils-1.1.31/reposync.py 2018-08-31 15:14:14.680403500 +0200 -@@ -75,6 +75,12 @@ def localpkgs(directory): - cache[name] = {'path': fn, 'size': st.st_size, 'device': st.st_dev} - return cache - -+def is_subpath(path, root): -+ root = os.path.realpath(root) -+ path = os.path.realpath(os.path.join(root, path)) -+ # join() is used below to ensure root ends with a slash -+ return path.startswith(os.path.join(root, '')) -+ - def parseArgs(): - usage = _(""" - Reposync is used to synchronize a remote yum repository to a local -@@ -117,6 +123,10 @@ def parseArgs(): - parser.add_option("", "--download-metadata", dest="downloadmd", - default=False, action="store_true", - help=_("download all the non-default metadata")) -+ parser.add_option("", "--allow-path-traversal", default=False, -+ action="store_true", -+ help=_("Allow packages stored outside their repo directory to be synced " -+ "(UNSAFE, USE WITH CAUTION!)")) - (opts, args) = parser.parse_args() - return (opts, args) - -@@ -217,13 +227,36 @@ def main(): - else: - local_repo_path = opts.destdir + '/' + repo.id - -+ # Ensure we don't traverse out of local_repo_path by dropping any -+ # packages whose remote_path is absolute or contains up-level -+ # references (unless explicitly allowed). -+ # See RHBZ#1600221 for details. -+ if not opts.allow_path_traversal: -+ newlist = [] -+ skipped = False -+ for pkg in download_list: -+ if is_subpath(pkg.remote_path, local_repo_path): -+ newlist.append(pkg) -+ continue -+ my.logger.warning( -+ _('WARNING: skipping package %s: remote path "%s" not ' -+ 'within repodir, unsafe to mirror locally') -+ % (pkg, pkg.remote_path) -+ ) -+ skipped = True -+ if skipped: -+ my.logger.info( -+ _('You can enable unsafe remote paths by using ' -+ '--allow-path-traversal (see reposync(1) for details)') -+ ) -+ download_list = newlist -+ - if opts.delete and os.path.exists(local_repo_path): - current_pkgs = localpkgs(local_repo_path) - - download_set = {} - for pkg in download_list: -- remote = pkg.returnSimple('relativepath') -- rpmname = os.path.basename(remote) -+ rpmname = os.path.basename(pkg.remote_path) - download_set[rpmname] = 1 - - for pkg in current_pkgs: -@@ -270,8 +303,7 @@ def main(): - remote_size = 0 - if not opts.urls: - for pkg in download_list: -- remote = pkg.returnSimple('relativepath') -- local = local_repo_path + '/' + remote -+ local = os.path.join(local_repo_path, pkg.remote_path) - sz = int(pkg.returnSimple('packagesize')) - if os.path.exists(local) and os.path.getsize(local) == sz: - continue -@@ -283,10 +315,9 @@ def main(): - download_list.sort(key=lambda pkg: pkg.name) - if opts.urls: - for pkg in download_list: -- remote = pkg.returnSimple('relativepath') -- local = os.path.join(local_repo_path, remote) -+ local = os.path.join(local_repo_path, pkg.remote_path) - if not (os.path.exists(local) and my.verifyPkg(local, pkg, False)): -- print urljoin(pkg.repo.urls[0], pkg.relativepath) -+ print urljoin(pkg.repo.urls[0], pkg.remote_path) - continue - - # create dest dir -@@ -295,8 +326,7 @@ def main(): - - # set localpaths - for pkg in download_list: -- rpmfn = pkg.remote_path -- pkg.localpath = os.path.join(local_repo_path, rpmfn) -+ pkg.localpath = os.path.join(local_repo_path, pkg.remote_path) - pkg.repo.copy_local = True - pkg.repo.cache = 0 - localdir = os.path.dirname(pkg.localpath) diff --git a/sources b/sources deleted file mode 100644 index 09a2534..0000000 --- a/sources +++ /dev/null @@ -1 +0,0 @@ -b2859b89321b98f2581243536e1b4993 yum-utils-1.1.31.tar.gz diff --git a/yum-utils-HEAD.patch b/yum-utils-HEAD.patch deleted file mode 100644 index 4c14717..0000000 --- a/yum-utils-HEAD.patch +++ /dev/null @@ -1,7480 +0,0 @@ -diff --git a/COPYING b/COPYING -index e77696a..d159169 100644 ---- a/COPYING -+++ b/COPYING -@@ -1,12 +1,12 @@ -- GNU GENERAL PUBLIC LICENSE -- Version 2, June 1991 -+ GNU GENERAL PUBLIC LICENSE -+ Version 2, June 1991 - -- Copyright (C) 1989, 1991 Free Software Foundation, Inc. -- 675 Mass Ave, Cambridge, MA 02139, USA -+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -- Preamble -+ Preamble - - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public -@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This - General Public License applies to most of the Free Software - Foundation's software and to any other program whose authors commit to - using it. (Some other Free Software Foundation software is covered by --the GNU Library General Public License instead.) You can apply it to -+the GNU Lesser General Public License instead.) You can apply it to - your programs, too. - - When we speak of free software, we are referring to freedom, not -@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and - modification follow. -- -- GNU GENERAL PUBLIC LICENSE -+ -+ GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions: - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) -- -+ - These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the Program, - and can be reasonably considered independent and separate works in -@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent - access to copy the source code from the same place counts as - distribution of the source code, even though third parties are not - compelled to copy the source along with the object code. -- -+ - 4. You may not copy, modify, sublicense, or distribute the Program - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense or distribute the Program is -@@ -225,7 +225,7 @@ impose that choice. - - This section is intended to make thoroughly clear what is believed to - be a consequence of the rest of this License. -- -+ - 8. If the distribution and/or use of the Program is restricted in - certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Program under this License -@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals - of preserving the free status of all derivatives of our free software and - of promoting the sharing and reuse of software generally. - -- NO WARRANTY -+ NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY - FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGES. - -- END OF TERMS AND CONDITIONS -- -- How to Apply These Terms to Your New Programs -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest - possible use to the public, the best way to achieve this is to make it -@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least - the "copyright" line and a pointer to where the full notice is found. - - -- Copyright (C) 19yy -+ Copyright (C) - - 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 -@@ -303,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Also add information on how to contact you by electronic and paper mail. - - If the program is interactive, make it output a short notice like this - when it starts in an interactive mode: - -- Gnomovision version 69, Copyright (C) 19yy name of author -+ Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. -@@ -335,5 +335,5 @@ necessary. Here is a sample; alter the names: - This General Public License does not permit incorporating your program into - proprietary programs. If your program is a subroutine library, you may - consider it more useful to permit linking proprietary applications with the --library. If this is what you want to do, use the GNU Library General -+library. If this is what you want to do, use the GNU Lesser General - Public License instead of this License. -diff --git a/ChangeLog b/ChangeLog -index bc802f6..e9be2e4 100644 ---- a/ChangeLog -+++ b/ChangeLog -@@ -3370,7 +3370,7 @@ - 2008-08-04 James Antill - - * yum-builddep.py: Allow yum-builddep to use "extras" -- (installed/not-available pacakges -+ (installed/not-available packages - - 2008-08-04 James Antill - -diff --git a/README b/README -index 8abe805..0c01d0e 100644 ---- a/README -+++ b/README -@@ -67,3 +67,5 @@ Author of the update on boot init scripts - - Tim Lauridsen - Maintainer of yum-utils - fixer of a lot of misc utils. - -+- Valentina Mukhamedzhanova -+Maintainer of yum-utils. -diff --git a/debuginfo-install.py b/debuginfo-install.py -index 177c6c3..bb61a1d 100755 ---- a/debuginfo-install.py -+++ b/debuginfo-install.py -@@ -7,11 +7,11 @@ - # 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 Library General Public License for more details. -+# GNU General Public License for more details. - # - # You should have received a copy of the GNU General Public License --# along with this program; if not, write to the Free Software --# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+# along with this program; if not, write to the Free Software Foundation, -+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - # Copyright 2007 Seth Vidal - - import sys -@@ -52,7 +52,12 @@ class DebugInfoInstall(YumUtilBase): - action="store_true", - help="Turn off automatic installation/update of the yum debuginfo plugin") - -- self.main() -+ self.done = set() -+ try: -+ self.main() -+ except yum.Errors.YumBaseError, e: -+ print e -+ sys.exit(1) - - def doUtilConfigSetup(self, *args, **kwargs): - """ We override this to get our extra option out. """ -@@ -81,7 +86,10 @@ class DebugInfoInstall(YumUtilBase): - for repo in self.repos.listEnabled(): - repos[repo.id] = repo - for repoid in repos: -- di = '%s-debuginfo' % repoid -+ if repoid.endswith('-rpms'): -+ di = repoid[:-5] + '-debug-rpms' -+ else: -+ di = '%s-debuginfo' % repoid - if di in repos: - continue - repo = repos[repoid] -@@ -117,6 +125,9 @@ class DebugInfoInstall(YumUtilBase): - sys.exit(self.doUtilTransaction()) - - def di_try_install(self, po): -+ if po in self.done: -+ return -+ self.done.add(po) - if po.name.endswith('-debuginfo'): # Wildcard matches produce this - return - di_name = '%s-debuginfo' % po.name -@@ -156,6 +167,10 @@ class DebugInfoInstall(YumUtilBase): - self.di_try_install(deppo) - except yum.Errors.InstallError, e: - self.logger.critical('Could not find debuginfo pkg for dependency package %s' % deppo) -+ -+ for pkgname in u: -+ self.logger.critical('Could not find a package for: %s' % pkgname) -+ - # This is kinda hacky, accessing the option from the plugins code - # but I'm not sure of a better way of doing it - if not self.no_debuginfo_plugin and self.tsInfo: -diff --git a/docs/Makefile b/docs/Makefile -index d01c1e4..79d8a1b 100644 ---- a/docs/Makefile -+++ b/docs/Makefile -@@ -1,9 +1,11 @@ - DOCS = repoquery package-cleanup repo-rss yumdownloader yum-builddep yum-changelog reposync \ - yum-list-data yum-filter-data yum-verify yum-utils yum-aliases yum-debug-dump yum-versionlock \ - yum-groups-manager debuginfo-install repodiff yum-fs-snapshot \ -- show-installed show-changed-rco -+ show-installed show-changed-rco yum-debug-restore \ -+ find-repos-of-install needs-restarting repo-graph repoclosure \ -+ repomanage repotrack verifytree yum-config-manager - DOCS5 = yum-changelog.conf yum-versionlock.conf yum-fs-snapshot.conf --DOCS8 = yum-security yum-complete-transaction yumdb -+DOCS8 = yum-complete-transaction yumdb yum-copr - - all: - echo "Nothing to do" -diff --git a/docs/debuginfo-install.1 b/docs/debuginfo-install.1 -index a47e28a..a829869 100644 ---- a/docs/debuginfo-install.1 -+++ b/docs/debuginfo-install.1 -@@ -1,7 +1,7 @@ - .\" debuginfo-install - .TH "debuginfo-install" "1" "21 October 2008" "James Antill" "" - .SH "NAME" --debuginfo-install -+debuginfo-install \- install debuginfo packages and their dependencies - .SH "SYNOPSIS" - \fBdebuginfo-install\fP package - .SH "DESCRIPTION" -diff --git a/docs/find-repos-of-install.1 b/docs/find-repos-of-install.1 -new file mode 100644 -index 0000000..77be909 ---- /dev/null -+++ b/docs/find-repos-of-install.1 -@@ -0,0 +1,51 @@ -+.\" find-repos-of-install -+.TH "find-repos-of-install" "1" "13 January 2013" "" "" -+.SH "NAME" -+find-repos-of-install \- report which Yum repository a package was installed from -+.SH "SYNOPSIS" -+\fBfind-repos-of-install\fP [options] package1 [package2...] -+.SH "DESCRIPTION" -+.PP -+\fBfind-repos-of-install\fP is a program which reports the Yum repository that -+a specified package was installed from. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-\-version\fP" -+Report program version and exit. -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-\-repoid=REPOID\fP" -+Specify repo ids to query, can be specified multiple times (default is -+all enabled). -+.IP "\fB\-\-enablerepo=ENABLEREPOS\fP" -+In addition to the default set, query the given additional repository, even if -+it is disabled in YUM configuration. Can be used multiple times. -+.IP "\fB\-\-disablerepo=DISABLEREPOS\fP" -+Do not query the given repository, even if it is enabled in YUM -+configuration. Can be used multiple times. -+.IP "\fB\-\-repofrompath=REPOID,PATH/URL\fP" -+Specify a path or url to a repository (same path as in a baseurl) to add to -+the repositories for this query. This option can be used multiple times. If -+you want to view only the pkgs from this repository combine this with -+\-\-repoid. The repoid for the repository is specified by REPOID. -+.IP "\fB\-C, \-\-cache\fP" -+Tells repoquery to run entirely from YUM cache - does not download any metadata -+or update the cache. Queries in this mode can fail or give partial/incorrect -+results if the cache isn't fully populated beforehand with eg "yum makecache". -+.IP "\fB\-\-tempcache\fP" -+Use a temp dir for storing/accessing yum-cache. -+.IP "\fB\-\-sync2yumdb\fP" -+Sync anything that is found to the yumdb, if available. -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH AUTHORS -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/needs-restarting.1 b/docs/needs-restarting.1 -new file mode 100644 -index 0000000..74b1904 ---- /dev/null -+++ b/docs/needs-restarting.1 -@@ -0,0 +1,29 @@ -+.\" needs-restarting -+.TH "needs-restarting" "1" "13 January 2013" "" "" -+.SH "NAME" -+needs-restarting \- report running processes that have been updated -+.SH "SYNOPSIS" -+\fBneeds-restarting\fP [options] -+.SH "DESCRIPTION" -+.PP -+\fBneeds-restarting\fP is a program that reports a list of process ids that -+started running before they or some component that they use were updated. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-u, \-\-useronly\fP" -+Show processes for my userid only. -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/package-cleanup.1 b/docs/package-cleanup.1 -index 867cf4d..61959ac 100644 ---- a/docs/package-cleanup.1 -+++ b/docs/package-cleanup.1 -@@ -1,7 +1,7 @@ - .\" package-cleanup - .TH "package-cleanup" "1" "03 November 2005" "Gijs Hollestelle" "" - .SH "NAME" --package-cleanup -+package-cleanup \- clean up locally installed, duplicate, or orphaned packages - .SH "SYNOPSIS" - \fBpackage-cleanup\fP [options] - .SH "DESCRIPTION" -@@ -14,7 +14,7 @@ Use alternative config file (default is /etc/yum.conf). - .IP "\fB\-h, \-\-help\fP" - Help; display a help message and then quit\&. - .IP "\fB\-q, \-\-quiet\fP" --Print out nothing unecessary. -+Print out nothing unnecessary. - .IP "\fB\-v, \-\-version\fP" - Report program version and exit. - .IP "\fB\-y\fP" -@@ -36,6 +36,8 @@ Scan for duplicates in the local RPM database. - .IP "\fB\-\-cleandupes\fP" - Scan for duplicates in the local RPM database and clean out the - older versions. -+.IP "\fB\-\-count \fP" -+Number of duplicate/kernel packages to keep on the system (default 2) - .PP - .SH "LEAVES OPTIONS" - .IP "\fB\-\-all\fP" -@@ -49,21 +51,19 @@ When listing leaf nodes do not list development packages. - When listing leaf nodes do not list packages with files in bin directories. - .PP - .SH "OLDKERNELS OPTIONS" --.IP "\fB\-\-count \fP" --Number of kernel packages to keep on the system (default 2) - .IP "\fB\-\-keepdevel\fP" - Do not remove kernel-devel packages when removing kernels - - .SH "EXAMPLES" - .IP "List all dependency problems:" --\fBpackage-cleanup --problems\fP -+\fBpackage-cleanup \-\-problems\fP - .IP "List all packages that are not in any Yum repository:" --\fBpackage-cleanup --orphans\fP -+\fBpackage-cleanup \-\-orphans\fP - .IP "Remove old kernels keeping 3 and leaving old kernel-devel packages installed:" --\fBpackage-cleanup --oldkernels --count=3 --keepdevel\fP -+\fBpackage-cleanup \-\-oldkernels \-\-count=3 \-\-keepdevel\fP - .PP - .IP "List all leaf packages with no files in a bin directory whose name begins with either 'perl' or 'python':" --\fBpackage-cleanup --leaves --exclude-bin --leaf-regex="^(perl)|(python)"\fP -+\fBpackage-cleanup \-\-leaves \-\-exclude\-bin \-\-leaf\-regex="^(perl)|(python)"\fP - .PP - .SH "FILES" - As package-cleanup uses YUM libraries for retrieving all the information, it -diff --git a/docs/repo-graph.1 b/docs/repo-graph.1 -new file mode 100644 -index 0000000..9bdbb20 ---- /dev/null -+++ b/docs/repo-graph.1 -@@ -0,0 +1,32 @@ -+.\" repo-graph -+.TH "repo-graph" "1" "13 January 2013" "" "" -+.SH "NAME" -+repo-graph \- output a full package dependency graph in dot format -+.SH "SYNOPSIS" -+\fBrepo-graph\fP [options] -+.SH "DESCRIPTION" -+.PP -+\fBrepo-graph\fP is a program that generates a full package dependency list -+from a yum repository and outputs it in dot format. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-\-repoid=REPOID\fP" -+Specify repo ids to query, can be specified multiple times (default is -+all enabled). -+.IP "\fB\-c CONFIG\fP" -+Config file to use (defaults to /etc/yum.conf). -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/repo-rss.1 b/docs/repo-rss.1 -index 90788b8..62e00cc 100644 ---- a/docs/repo-rss.1 -+++ b/docs/repo-rss.1 -@@ -1,7 +1,7 @@ - .\" repo-rss - .TH "repo-rss" "1" "2005" "Seth Vidal" "" - .SH "NAME" --repo-rss -+repo-rss \- generates an RSS feed from one or more Yum repositories - .SH "SYNOPSIS" - \fBrepo-rss\fP [options] repoid1 [repoid2...] - .SH "DESCRIPTION" -@@ -28,7 +28,7 @@ default for non-root users. - - .SH "EXAMPLES" - .IP "Generate an RSS for the updates-released repository and save it as updates-release.xml:" --\fBrepo-rss -f updates-released.xml updates-released\fP -+\fBrepo-rss \-f updates-released.xml updates-released\fP - .PP - .SH "FILES" - As repo-rss uses YUM libraries for retrieving all the information, it -diff --git a/docs/repoclosure.1 b/docs/repoclosure.1 -new file mode 100644 -index 0000000..e0f7091 ---- /dev/null -+++ b/docs/repoclosure.1 -@@ -0,0 +1,57 @@ -+.\" repoclosure -+.TH "repoclosure" "1" "13 January 2013" "" "" -+.SH "NAME" -+repoclosure \- display a list of unresolved dependencies for a yum repository -+.SH "SYNOPSIS" -+\fBrepoclosure\fP [options] -+.SH "DESCRIPTION" -+.PP -+\fBrepoclosure\fP is a program that reads package metadata from one or more yum -+repositories, checks all dependencies, and displays a list of packages with -+unresolved dependencies. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-c CONFIG, \-\-config=CONFIG\fP" -+Config file to use (defaults to /etc/yum.conf). -+.IP "\fB\-a ARCH, \-\-arch=ARCH\fP" -+Check packages of the given archs, can be specified multiple times (default: -+current arch). -+.IP "\fB\-\-basearch=BASEARCH\fP" -+Set the basearch for yum to run as. -+.IP "\fB\-b, \-\-builddeps\fP" -+Check build dependencies only (needs source repos enabled). -+.IP "\fB\-l LOOKASIDE, \-\-lookaside=LOOKASIDE\fP" -+Specify a lookaside repo id to query, can be specified multiple times. -+.IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" -+Specify repo ids to query, can be specified multiple times (default is -+all enabled). -+.IP "\fB\-t, \-\-tempcache\fP" -+Use a temp dir for storing/accessing yum-cache. -+.IP "\fB\-q, \-\-quiet\fP" -+Run quietly: no warnings printed to stderr. -+.IP "\fB\-n, \-\-newest\fP" -+Check only the newest packages in the repos. -+.IP "\fB\-\-repofrompath=REPOID,PATH/URL\fP" -+Specify a path or url to a repository (same path as in a baseurl) to add to -+the repositories for this query. This option can be used multiple times. If -+you want to view only the pkgs from this repository combine this with -+\-\-repoid. The repoid for the repository is specified by REPOID. -+.IP "\fB\-p PKG, \-\-pkg=PKG\fP" -+Check closure for this package only -+.IP "\fB\-g GROUP, \-\-group=GROUP\fP" -+Check closure for packages in this group only -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/repodiff.1 b/docs/repodiff.1 -index c421c5d..75a8860 100644 ---- a/docs/repodiff.1 -+++ b/docs/repodiff.1 -@@ -1,37 +1,45 @@ - .\" repodiff - .TH "repodiff" "1" "21 October 2008" "James Antill" "" - .SH "NAME" --repodiff -+repodiff \- list differences between two or more Yum repositories - .SH "SYNOPSIS" --\fBrepodiff\fP --old=old_repo_baseurl --new=new_repo_baseurl -+\fBrepodiff\fP \-\-old=old_repo_baseurl \-\-new=new_repo_baseurl - .SH "DESCRIPTION" - .PP - \fBrepodiff\fP is a program which will list differences between two sets of - repositories. \fBNote\fP that by default only source packages are compared. - .PP - .SH "GENERAL OPTIONS" --.IP "\fB\-\-old, -o\fP" --Add a repo. as an old repo. --.IP "\fB\-\-new, -n\fP" --Add a repo. as an new repo. --.IP "\fB\-\-archlist, -a\fP" -+.IP "\fB\-\-old, \-o\fP" -+Add a repo. as an old repo. Note that if you prefix the url with "mirror:" then -+the following url is treated as a mirror and not a baseurl. -+.IP "\fB\-\-new, \-n\fP" -+Add a repo. as an new repo. Note that if you prefix the url with "mirror:" then -+the following url is treated as a mirror and not a baseurl. -+.IP "\fB\-\-archlist, \-a\fP" - Add architectures to change the default from just comparing source packages. - Note that if you want the same as a native - "x86_64" architecture machine you just need to pass "x86_64" (this is different - from earlier versions where you needed to specify - "x86_64,athlon,i686,i586,i486,i386,noarch" and you still got "src"). --.IP "\fB\-\-size, -s\fP" --Ouput additional data about the size of the changes. --.IP "\fB\-\-compare-arch\fP" -+.IP "\fB\-\-size, \-s\fP" -+Output additional data about the size of the changes. -+.IP "\fB\-\-compare\-arch\fP" - Normally packages are just compared based on their name, this flag makes the - comparison also use the arch. So foo.i386 and foo.x86_64 are different. -+.IP "\fB\-\-simple\fP" -+Output a simple one line message for modified packages. -+.IP "\fB\-\-downgrade\fP" -+Split the data for modified packages between upgraded and downgraded packages. - .SH "EXAMPLES" - .IP "Compare source pkgs in two local repos:" --\fBrepodiff --old=/tmp/repo-old --new=/tmp/repo-new\fP -+\fBrepodiff \-\-old=/tmp/repo-old \-\-new=/tmp/repo-new\fP - .IP "Compare x86_64 compat. binary pkgs in two remote repos, and two local one:" --\fBrepodiff -a x86_64 --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP -+\fBrepodiff \-a x86_64 \-\-old=http://example.com/repo1-old \-\-old=/tmp/repo-old \-\-new=http://example.com/repo1-new \-\-new=/tmp/repo-new\fP - .IP "Compare x86_64 compat. binary pkgs, but also compare arch:" --\fBrepodiff -a x86_64 --compare-arch --old=http://example.com/repo1-old --old=/tmp/repo-old --new=http://example.com/repo1-new --new=/tmp/repo-new\fP -+\fBrepodiff \-a x86_64 \-\-compare\-arch \-\-old=http://example.com/repo1-old \-\-old=/tmp/repo-old \-\-new=http://example.com/repo1-new \-\-new=/tmp/repo-new\fP -+.IP "Compare two releases of Fedora (15 => 16):" -+\fBrepodiff \-\-old='mirror:https://mirrors.fedoraproject.org/metalink?repo=fedora-source-15&arch=i386' \-\-new='mirror:https://mirrors.fedoraproject.org/metalink?repo=fedora-source-16&arch=i386' \-\-size \-\-simple \-\-downgrade\fP - .PP - - .SH "SEE ALSO" -diff --git a/docs/repomanage.1 b/docs/repomanage.1 -new file mode 100644 -index 0000000..4d336a5 ---- /dev/null -+++ b/docs/repomanage.1 -@@ -0,0 +1,38 @@ -+.\" repomanage -+.TH "repomanage" "1" "13 January 2013" "" "" -+.SH "NAME" -+repomanage \- list the newest or oldest RPM packages in a directory -+.SH "SYNOPSIS" -+\fBrepomanage\fP [options] directory -+.SH "DESCRIPTION" -+.PP -+\fBrepomanage\fP is a program to manage a directory of RPM packages. It -+displays a list of the newest or oldest packages in a directory for easy -+piping to xargs or similar programs. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-o, \-\-old\fP" -+Print the oldest packages. -+.IP "\fB\-n, \-\-new\fP" -+Print the newest packages. -+.IP "\fB\-s, \-\-space\fP" -+Space-separated instead of newline-separated output. -+.IP "\fB\-k KEEP, \-\-keep=KEEP\fP" -+Newest N packages to keep - defaults to 1. -+.IP "\fB\-c, \-\-nocheck\fP" -+Do not check package payload signatures/digests. -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/repoquery.1 b/docs/repoquery.1 -index f5a8c5d..195780d 100644 ---- a/docs/repoquery.1 -+++ b/docs/repoquery.1 -@@ -1,11 +1,11 @@ - .\" repoquery - .TH "repoquery" "1" "17 October 2005" "Panu Matilainen" "" - .SH "NAME" --repoquery -+repoquery \- query information from Yum repositories - .SH "SYNOPSIS" - \fBrepoquery\fP [options] - .br --\fBrepoquery\fP -a [options] -+\fBrepoquery\fP \-a [options] - .SH "DESCRIPTION" - .PP - \fBrepoquery\fP is a program for querying information from YUM repositories -@@ -13,12 +13,12 @@ similarly to rpm queries. - .PP - .SH "GENERAL OPTIONS" - .IP "\fB\-\-querytags\fP" --List valid queryformat tags and exit.. --.IP "\fB\-v, \-\-version\fP" -+List valid queryformat tags and exit. -+.IP "\fB\-\-version\fP" - Report program version and exit. - .IP "\fB\-\-repoid=\fP" - Specify which repository to query. Using this option disables all repositories --not explicitly enabled with --repoid option (can be used multiple times). By -+not explicitly enabled with \-\-repoid option (can be used multiple times). By - default repoquery uses whatever repositories are enabled in YUM configuration. - .IP "\fB\-\-enablerepo=\fP" - In addition to the default set, query the given additional repository, even if -@@ -30,7 +30,7 @@ configuration. Can be used multiple times. - Specify a path or url to a repository (same path as in a baseurl) to add to - the repositories for this query. This option can be used multiple times. If - you want to view only the pkgs from this repository combine this with ----repoid. The repoid for the repository is specified by . -+\-\-repoid. The repoid for the repository is specified by . - .IP "\fB\-\-plugins\fP" - Enable YUM plugin support. - .IP "\fB\-q, \-\-query\fP" -@@ -45,6 +45,10 @@ Produce verbose output. - Tells repoquery to run entirely from YUM cache - does not download any metadata - or update the cache. Queries in this mode can fail or give partial/incorrect - results if the cache isn't fully populated beforehand with eg "yum makecache". -+.IP "\fB\-\-nolock\fP" -+Disable locking the yum cache. This is needed as any yum API caller can alter -+the repo. metadata cache, unless it is locked. This automatically enables the -+--cache and --tempcache options, to try to lower the riskiness. - .IP "\fB\-\-tempcache\fP" - Create and use a private cache instead of the main YUM cache. This is used - by default when run as non-root user. -@@ -57,6 +61,13 @@ the releasever information from outside the installroot. - Note that with the default upstream cachedir, of /var/cache/yum, using this - option will corrupt your cache (and you can use $releasever in your cachedir - configuration to stop this). -+.IP "\fB\-\-installroot=root\fP" -+Specifies an alternative installroot, relative to which all packages will be -+installed. Think of this like doing "chroot yum" except using -+\-\-installroot allows yum to work before the chroot is created. -+Note: You may also want to use the option \-\-releasever=/ when creating the -+installroot as otherwise the $releasever value is taken from the rpmdb within -+the installroot (and thus. will be empty, before creation). - .IP "\fB\-\-setopt=option=value\fP" - Set any config option in yum config or repo files. For options in the global - config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid.option=value -@@ -64,13 +75,21 @@ config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid - .PP - .SH "PACKAGE QUERY OPTIONS" - .IP "\fB\-i, \-\-info\fP" --Show general information about package similarly to "rpm -qi" -+Show general information about package similarly to "rpm \-qi" - .IP "\fB\-l, \-\-list\fP" - List files in package. - .IP "\fB\-R, \-\-requires\fP" - List package dependencies. -+.IP "\fB\-R, \-\-weak\-requires\fP" -+List package weak dependencies. -+.IP "\fB\-R, \-\-info\-requires\fP" -+List package informational dependencies. -+.IP "\fB\-R, \-\-weak\-reverse\-requires\fP" -+List package weak reverse dependencies. -+.IP "\fB\-R, \-\-info\-reverse\-requires\fP" -+List package informational reverse dependencies. - .IP "\fB\-\-resolve\fP" --When used with --requires, resolve capabilities to originating packages. -+When used with \-\-requires/\-\-weak\-requires/etc, resolve capabilities to originating packages. - .IP "\fB\-\-provides\fP" - List capabilities package provides. - .IP "\fB\-\-obsoletes\fP" -@@ -81,7 +100,7 @@ List capabilities conflicting with package. - List package changelog. - .IP "\fB\-\-location\fP" - Show a location where the package could be downloaded from. --For example: \fBwget `repoquery --location yum`\fP -+For example: \fBwget `repoquery \-\-location yum`\fP - .IP "\fB\-s, \-\-source\fP" - Show package source RPM name. - .IP "\fB\-\-srpm\fP" -@@ -95,23 +114,26 @@ Use name-epoch:version-release.architecture output format (default) - .IP "\fB\-\-envra\fP" - Use epoch:name-version-release.architecture output format - (easier to parse than nevra) --.IP "\fB\--qf=FORMAT, \-\-queryformat=FORMAT\fP" -+.IP "\fB\-\-qf=FORMAT, \-\-queryformat=FORMAT\fP" - Specify custom output format for queries. You can add ":date", ":day" and - ":isodate" to all the tags that are a time, and you can add ":k", ":m", ":g", - ":t" and ":h" to sizes. You can also specify field width as in - sprintf (Eg. %-20{name}) --.IP "\fB\-\-output [text|ascii-tree|dot-tree]\fP" --Output format which can be used with --requires/--whatrequires/--obsoletes/--conflicts. -+.IP "\fB\-\-output [text|ascii-tree|ascii-tree+|dot-tree|dot-tree+]\fP" -+Output format which can be used with \-\-requires/\-\-weak-requires/\-\-whatrequires/\-\-obsoletes/\-\-conflicts. The variants with a + suffix are used for weak dependencies and will merge the stronger variants into the output. - Default output is 'text'. - .IP "\fB\-\-level [all|any int]\fP" --In combination with --output ascii-tree|dot-tree this option specifies the --number of level to print on the tree. Default level is 'all'. -+In combination with \-\-output ascii-tree|dot-tree|ascii-tree+|dot-tree+ this -+option specifies the number of level to print on the tree. -+ Default level is 'all'. - .PP - - .SH "PACKAGE SELECTION OPTIONS" - .IP "\fB\-a, \-\-all\fP" - Query all available packages (for rpmquery compatibility / shorthand for - repoquery '*') -+.IP "\fB\--show-duplicates\fP" -+Query all versions of packages. - .IP "\fB\-f, \-\-file FILE\fP" - Query package owning FILE. - .IP "\fB\-\-whatobsoletes CAPABILITY\fP" -@@ -123,14 +145,15 @@ Query all packages that provide CAPABILITY. - .IP "\fB\-\-whatrequires CAPABILITY\fP" - Query all packages that require CAPABILITY. - .IP "\fB\-\-alldeps\fP" --When used with --whatrequires, look for non-explicit dependencies in -+When used with \-\-whatrequires, look for non-explicit dependencies in - addition to explicit ones (e.g. files and Provides in addition to - package names). This is the default. - .IP "\fB\-\-exactdeps\fP" --When used with --whatrequires, search for dependencies only exactly as given. --This is effectively the opposite of --alldeps. -+When used with \-\-whatrequires, search for dependencies only exactly as given. -+This is effectively the opposite of \-\-alldeps. - .IP "\fB\-\-recursive\fP" --When used with --whatrequires, query packages recursively. -+When used with \-\-whatrequires, and \-\-requires \-\-resolve, query packages -+recursively. - .IP "\fB\-\-archlist=ARCH1[,ARCH2...]\fP" - Limit the query to packages of given architecture(s). Valid values are all - architectures known to rpm/yum such as 'i386' and 'src' for -@@ -166,19 +189,19 @@ Query groups instead of packages. - - .SH "EXAMPLES" - .IP "List all packages whose name contains 'perl':" --\fBrepoquery '*perl*'\fP -+\fBrepoquery \(aq*perl*\(aq\fP - .IP "List all packages depending on openssl:" --\fBrepoquery --whatrequires openssl\fP -+\fBrepoquery \-\-whatrequires openssl\fP - .IP "List all package names and the repository they come from, nicely formatted:" --\fBrepoquery -a --qf "%-20{repoid} %{name}"\fP -+\fBrepoquery \-a \-\-qf "%-20{repoid} %{name}"\fP - .IP "List name and summary of all available updates (if any), nicely formatted:" --\fBrepoquery -a --pkgnarrow=updates --qf "%{name}:\\n%{summary}\\n"\fP -+\fBrepoquery \-a \-\-pkgnarrow=updates \-\-qf "%{name}:\\n%{summary}\\n"\fP - .IP "List optional packages in base group:" --\fBrepoquery -g --grouppkgs=optional -l base\fP -+\fBrepoquery \-g \-\-grouppkgs=optional \-l base\fP - .IP "List build requirements from 'anaconda' source rpm:" --\fBrepoquery --requires anaconda.src\fP -+\fBrepoquery \-\-requires anaconda.src\fP - .IP "List packages which BuildRequire gail-devel" --\fBrepoquery --archlist=src --whatrequires gail-devel\fP -+\fBrepoquery \-\-archlist=src \-\-whatrequires gail-devel\fP - NB: This command will only work if you have repositories enabled which include srpms. - - .\"TODO: Add more examples... -@@ -204,7 +227,7 @@ of the following: - .br - \fBepoch:name-ver-rel.arch\fP - .IP --For example: \fBrepoquery -l kernel-2.4.1-10.i686\fP -+For example: \fBrepoquery \-l kernel-2.4.1-10.i686\fP - .br - Additionally wildcards (shell-style globs) can be used. - -diff --git a/docs/reposync.1 b/docs/reposync.1 -index c1bc818..5a5b092 100644 ---- a/docs/reposync.1 -+++ b/docs/reposync.1 -@@ -1,7 +1,7 @@ - .\" reposync - .TH "reposync" "1" "27 April 2007" "" "" - .SH "NAME" --reposync - synchronize yum repositories to a local directory -+reposync \- synchronize yum repositories to a local directory - .SH "SYNOPSIS" - \fBreposync\fP [options] - .SH "DESCRIPTION" -@@ -14,33 +14,50 @@ Display a help message, and then quit. - Config file to use (defaults to /etc/yum.conf). - .IP "\fB\-a ARCH, \-\-arch=ARCH\fP" - Act as if running the specified arch (default: current arch, note: does --not override $releasever). -+not override $releasever. x86_64 is a superset for i*86.). - .IP "\fB\-\-source\fP" - Also download .src.rpm files. - .IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" - Specify repo ids to query, can be specified multiple times (default is - all enabled). -+.IP "\fB\-e\ CACHEDIR, \-\-cachedir CACHEDIR\fP" -+Directory in which to store metadata. - .IP "\fB\-t, \-\-tempcache\fP" - Use a temp dir for storing/accessing yum-cache. -+.IP "\fB\-d, \-\-delete\fP" -+Delete local packages no longer present in repository. - .IP "\fB\-p DESTDIR, \-\-download_path=DESTDIR\fP" - Path to download packages to: defaults to current directory. -+.IP "\fB\-\-norepopath\fP" -+Don't add the reponame to the download path. -+Can only be used when syncing a single repository (default is -+to add the reponame). - .IP "\fB\-g, \-\-gpgcheck\fP" - Remove packages that fail GPG signature checking after downloading. -+exit status is '1' if at least one package was removed. - .IP "\fB\-u, \-\-urls\fP" - Just list urls of what would be downloaded, don't download. --.IP "\fB\-n, \-\-newest-only\fP" -+.IP "\fB\-l, \-\-plugins\fP" -+Enable yum plugin support. -+.IP "\fB\-m, \-\-downloadcomps\fP" -+Also download comps.xml. -+.IP "\fB\-\-download-metadata\fP" -+Download all the non-default metadata -+.IP "\fB\-n, \-\-newest\-only\fP" - Download only newest packages per-repo. - .IP "\fB\-q, \-\-quiet\fP" - Output as little information as possible. - .SH "EXAMPLES" - .IP "Sync all packages from the 'updates' repo to the current directory:" --\fB reposync --repoid=updates\fP -+\fB reposync \-\-repoid=updates\fP - .IP "Sync only the newest packages from the 'updates' repo to the current directory:" --\fB reposync -n --repoid=updates\fP -+\fB reposync \-n \-\-repoid=updates\fP - .IP "Sync packages from the 'updates' and 'extras' repos to the current directory:" --\fB reposync --repoid=updates --repoid=extras\fP -+\fB reposync \-\-repoid=updates \-\-repoid=extras\fP - .IP "Sync all packages from the 'updates' repo to the \fBrepos\fP directory:" --\fB reposync -p repos --repoid=updates\fP -+\fB reposync \-p repos \-\-repoid=updates\fP -+.IP "Sync all packages from the 'updates' repo to the \fBrepos\fP directory excluding x86_64 arch. Edit \fI/etc/yum.conf\fR adding option \fBexclude=*.x86_64\fR. Then: -+\fBreposync \-p repos \-\-repoid=updates\fP - .SH "FILES" - \fBreposync\fP uses the yum libraries for retrieving information and - packages. If no configuration file is specified, the default yum -diff --git a/docs/repotrack.1 b/docs/repotrack.1 -new file mode 100644 -index 0000000..6b46ed0 ---- /dev/null -+++ b/docs/repotrack.1 -@@ -0,0 +1,44 @@ -+.\" repotrack -+.TH "repotrack" "1" "13 January 2013" "" "" -+.SH "NAME" -+repotrack \- track a package and its dependencies and download them -+.SH "SYNOPSIS" -+\fBrepotrack\fP [options] package1 [package2...] -+.SH "DESCRIPTION" -+.PP -+\fBrepotrack\fP is a program for keeping track of a particular package and its -+dependencies. It will download one or more packages and all dependencies. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-c CONFIG, \-\-config=CONFIG\fP" -+Config file to use (defaults to /etc/yum.conf). -+.IP "\fB\-a ARCH, \-\-arch=ARCH\fP" -+Act as if running the specified arch (default: current arch). -+.IP "\fB\-r REPOID, \-\-repoid=REPOID\fP" -+Specify repo ids to query, can be specified multiple times (default is -+all enabled). -+.IP "\fB\-t, \-\-tempcache\fP" -+Use a temp dir for storing/accessing yum-cache. -+.IP "\fB\-p DESTDIR, \-\-download_path=DESTDIR\fP" -+Path to download packages to. -+.IP "\fB\-u, \-\-urls\fP" -+Instead of downloading RPMs, list the URLs that would be downloaded. -+.IP "\fB\-n, \-\-newest\fP" -+Toggle downloading only the newest packages (defaults to newest-only). -+.IP "\fB\-q, \-\-quiet\fP" -+Output as little information as possible. -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/show-changed-rco.1 b/docs/show-changed-rco.1 -index 3e3b62c..a88c942 100644 ---- a/docs/show-changed-rco.1 -+++ b/docs/show-changed-rco.1 -@@ -1,17 +1,17 @@ - .\" show-changed-rco - .TH "show-installed" "1" "30 March 2011" "James Antill" "" - .SH "NAME" --show\-changed-\-rco -+show\-changed\-rco \- show changes in an RPM package - .SH "SYNOPSIS" --\fBshow\-changed-\-rco\fP [options] -+\fBshow\-changed\-rco\fP [options] - .SH "DESCRIPTION" - .PP --\fBshow\-changed-\-rco\fP gives a compact description of the changes to a -+\fBshow\-changed\-rco\fP gives a compact description of the changes to a - packages Requires, Conflicts and Obsoletes data from the installed (or old) to - a specified rpm file. - .SH OPTIONS - .TP --.IP \-h, \-\-help -+.IP "\fB\-h, \-\-help\fP" - show this help message and exit - .IP "\fB\-C, \-\-cache\fP" - Tells repoquery to run entirely from YUM cache - does not download any metadata -@@ -22,7 +22,7 @@ Use alternative config file (default is /etc/yum.conf). - - .IP "\fB\-\-repoid=\fP" - Specify which repository to query. Using this option disables all repositories --not explicitly enabled with --repoid option (can be used multiple times). By -+not explicitly enabled with \-\-repoid option (can be used multiple times). By - default repoquery uses whatever repositories are enabled in YUM configuration. - .IP "\fB\-\-enablerepo=\fP" - In addition to the default set, query the given additional repository, even if -@@ -34,13 +34,13 @@ configuration. Can be used multiple times. - Specify a path or url to a repository (same path as in a baseurl) to add to - the repositories for this query. This option can be used multiple times. If - you want to view only the pkgs from this repository combine this with ----repoid. The repoid for the repository is specified by . -+\-\-repoid. The repoid for the repository is specified by . - --.IP "\fB\-\-old-packages=\fP" -+.IP "\fB\-\-old\-packages=\fP" - Explicitly list the valid old packages to match the new packages against. --.IP "\fB\-\-ignore-arch\fP" -+.IP "\fB\-\-ignore\-arch\fP" - Ignore arch. so you can compare foo-2.i686 to foo-1.x86_64. --.IP "\fB\-\-skip-new\fP" -+.IP "\fB\-\-skip\-new\fP" - Only give output for packages which we've found an old package for. - - .PP -diff --git a/docs/show-installed.1 b/docs/show-installed.1 -index 7072b63..0907ea2 100644 ---- a/docs/show-installed.1 -+++ b/docs/show-installed.1 -@@ -1,7 +1,7 @@ - .\" show-installed - .TH "show-installed" "1" "21 October 2010" "Florian Festi" "" - .SH "NAME" --show\-installed -+show\-installed \- show installed RPM packages and descriptions - .SH "SYNOPSIS" - \fBshow\-installed\fP [options] - .SH "DESCRIPTION" -@@ -16,10 +16,10 @@ show this help message and exit - yum, kickstart or human; yum gives the result as a yum command line; kickstart the content of a %packages section; "human" readable is default. - .TP - .B \-i INPUT, \-\-input=INPUT --File to read the package list from instead of using the rpmdb. \- for stdin. The file must contain package names only separated by white space (including newlines). rpm \-qa \-\-qf='%{name}\\n' produces proper output. -+File to read the package list from instead of using the rpmdb. \- for stdin. The file must contain package names only separated by white space (including newlines). rpm \-qa \-\-qf=\(aq%{name}\\n\(aq produces proper output. - .TP - .B \-o OUTPUT, \-\-output=OUTPUT --File to write the result to. Stdout is used if option is omited. -+File to write the result to. Stdout is used if option is omitted. - .TP - .B \-q, \-\-quiet - Do not show warnings. -diff --git a/docs/verifytree.1 b/docs/verifytree.1 -new file mode 100644 -index 0000000..1389e0f ---- /dev/null -+++ b/docs/verifytree.1 -@@ -0,0 +1,33 @@ -+.\" verifytree -+.TH "verifytree" "1" "13 January 2013" "" "" -+.SH "NAME" -+verifytree \- verify that a local yum repository is consistent -+.SH "SYNOPSIS" -+\fBverifytree\fP [options] directory -+.SH "DESCRIPTION" -+.PP -+\fBverifytree\fP is a program that verifies whether a local yum repository is -+consistent. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-a, \-\-checkall\fP" -+Check all packages in the repository. -+.IP "\fB\-t TESTOPIA, \-\-testopia=TESTOPIA\fP" -+Report results to the given testopia run number. -+.IP "\fB\-r, \-\-treeinfo\fP" -+Check the checksums of listed files in a .treeinfo file, if available. -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/yum-aliases.1 b/docs/yum-aliases.1 -index c0f148d..62fae3e 100644 ---- a/docs/yum-aliases.1 -+++ b/docs/yum-aliases.1 -@@ -26,9 +26,9 @@ last form creates a new alias. - .PP - .SH Explanation of alias to final result conversion - .PP --When you type an aliased command, like "yum --disableexcludes UPT lsu" using -+When you type an aliased command, like "yum \-\-disableexcludes UPT lsu" using - the default aliases, the yum-aliases plugin first takes the first "command", by --skiping over any options, and then looks up the result (in this case "UPT" is converted to "--enablerepo=updates-tesintg"). If there is a match, then it will -+skipping over any options, and then looks up the result (in this case "UPT" is converted to "\-\-enablerepo=updates-testing"). If there is a match, then it will - replace the aliased "command" in the argument list and try again (again - skipping over any options). By convention, in the default aliases list, alias - "commands" that are in all CAPS only add options so you can join together a -@@ -49,19 +49,19 @@ yum - .B alias - rm remove - .PP --To always add the --skip-broken --disableexcludes=all --obsoletes options to -+To always add the \-\-skip\-broken \-\-disableexcludes=all \-\-obsoletes options to - the update command (but leaving the upgrade option alone), you could use: - .IP - yum - .B alias --update \\update --skip-broken --disableexcludes=all --obsoletes -+update \\update \-\-skip\-broken \-\-disableexcludes=all \-\-obsoletes - .PP - To override the default "up" alias to use the above update command, and never - ask for confirmation, you could use: - .IP - yum - .B alias --up update -y -+up update \-y - .br - - -diff --git a/docs/yum-builddep.1 b/docs/yum-builddep.1 -index 4e6c1d7..6cad8a6 100644 ---- a/docs/yum-builddep.1 -+++ b/docs/yum-builddep.1 -@@ -1,7 +1,7 @@ - .\" yum-builddep - .TH "yum-builddep" "1" "17 July 2005 " "Panu Matilainen" "" - .SH "NAME" --yum-builddep -+yum-builddep \- install missing dependencies for building an RPM package - .SH "SYNOPSIS" - \fByum-builddep\fP package - .SH "DESCRIPTION" -@@ -9,7 +9,7 @@ yum-builddep - \fByum-builddep\fP is a program which installs the RPMs needed to build - the specified package. The source RPM for the specified package must - be available in a Yum repository (which will be automatically enabled, if it is --disabled) or it can be a local source RPM file. -+disabled) or it can be a local source RPM or a spec file. - .PP - .SH "EXAMPLES" - .IP "Download and install all the RPMs needed to build the kernel RPM:" -diff --git a/docs/yum-changelog.1 b/docs/yum-changelog.1 -index 64910dc..c7b5486 100644 ---- a/docs/yum-changelog.1 -+++ b/docs/yum-changelog.1 -@@ -14,12 +14,12 @@ is a Yum plugin for viewing package changelogs before/after updating. - yum will invoke - .BR yum-changelog(1) - plugin if the --.B --changelog -+.B \-\-changelog - option or the - .B changelog - command is used with yum. - .SH OPTIONS --.IP --changelog -+.IP \-\-changelog - Show changelog delta of updated packages - .SH COMMANDS - .IP changelog -@@ -53,7 +53,7 @@ changelog stats. 33 pkgs, 12 source pkgs, 1 changelog - .br - .br - # yum update ktechlab --.B --changelog -+.B \-\-changelog - .br - Loading "changelog" plugin - .br -diff --git a/docs/yum-complete-transaction.8 b/docs/yum-complete-transaction.8 -index 945eee8..965c0b1 100644 ---- a/docs/yum-complete-transaction.8 -+++ b/docs/yum-complete-transaction.8 -@@ -1,13 +1,13 @@ - .\" yum-complete-transaction - .TH "yum-complete-transaction" "8" "10 December 2007" "Seth Vidal" "" - .SH "NAME" --yum-complete-transaction -+yum-complete-transaction \- attempt to complete failed or aborted Yum transactions - .SH "SYNOPSIS" - \fByum-complete-transaction\fP [options] - .SH "GENERAL OPTIONS" - .IP "\fB\-h, \-\-help\fP" - Help; display a help message and then quit\&. --.IP "\fB\-\-cleanup-only\fP" -+.IP "\fB\-\-cleanup\-only\fP" - Only clean up only transaction journal files and exit\&. - - .SH "DESCRIPTION" -diff --git a/docs/yum-config-manager.1 b/docs/yum-config-manager.1 -new file mode 100644 -index 0000000..81b895b ---- /dev/null -+++ b/docs/yum-config-manager.1 -@@ -0,0 +1,39 @@ -+.\" yum-config-manager -+.TH "yum-config-manager" "1" "13 January 2013" "" "" -+.SH "NAME" -+yum-config-manager \- manage yum configuration options and yum repositories -+.SH "SYNOPSIS" -+\fByum-config-manager\fP [options] -+.SH "DESCRIPTION" -+.PP -+\fByum-config-manager\fP is a program that can manage main yum configuration -+options, toggle which repositories are enabled or disabled, and add new -+repositories. -+.PP -+.SH "OPTIONS" -+.IP "\fB\-h, \-\-help\fP" -+Display a help message, and then quit. -+.IP "\fB\-\-save\fP" -+Save the current options (useful with \-\-setopt). -+.IP "\fB\-\-enable\fP" -+Enable the specified repos (automatically saves). -+.IP "\fB\-\-disable\fP" -+Disable the specified repos (automatically saves). -+.IP "\fB\-\-add\-repo=ADDREPO\fP" -+Add (and enable) the repo from the specified file or url. -+.SH "ADDITIONAL OPTIONS" -+Yum-config-manager inherits all other options from yum. See the yum(8) -+man page for more information. -+ -+.PP -+.SH "SEE ALSO" -+.nf -+.I yum.conf (5) -+http://yum.baseurl.org/ -+.fi -+ -+.PP -+.SH "AUTHORS" -+.nf -+See the Authors file included with this program. -+.fi -diff --git a/docs/yum-copr.8 b/docs/yum-copr.8 -new file mode 100644 -index 0000000..11afc83 ---- /dev/null -+++ b/docs/yum-copr.8 -@@ -0,0 +1,120 @@ -+.\" Man page generated from reStructuredText. -+. -+.TH "YUM-COPR" "8" "July 29, 2014" "0.1.1" "yum-plugin-copr" -+.SH NAME -+yum-plugin-copr \- YUM copr Plugin -+. -+.nr rst2man-indent-level 0 -+. -+.de1 rstReportMargin -+\\$1 \\n[an-margin] -+level \\n[rst2man-indent-level] -+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] -+- -+\\n[rst2man-indent0] -+\\n[rst2man-indent1] -+\\n[rst2man-indent2] -+.. -+.de1 INDENT -+.\" .rstReportMargin pre: -+. RS \\$1 -+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] -+. nr rst2man-indent-level +1 -+.\" .rstReportMargin post: -+.. -+.de UNINDENT -+. RE -+.\" indent \\n[an-margin] -+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] -+.nr rst2man-indent-level -1 -+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] -+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u -+.. -+. -+.nr rst2man-indent-level 0 -+. -+.de1 rstReportMargin -+\\$1 \\n[an-margin] -+level \\n[rst2man-indent-level] -+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] -+- -+\\n[rst2man-indent0] -+\\n[rst2man-indent1] -+\\n[rst2man-indent2] -+.. -+.de1 INDENT -+.\" .rstReportMargin pre: -+. RS \\$1 -+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] -+. nr rst2man-indent-level +1 -+.\" .rstReportMargin post: -+.. -+.de UNINDENT -+. RE -+.\" indent \\n[an-margin] -+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] -+.nr rst2man-indent-level -1 -+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] -+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u -+.. -+.sp -+Work with Copr & Playground repositories on the local system. -+.INDENT 0.0 -+.IP \(bu 2 -+The \fBcopr\fP command is used to add or remove Copr repositories to the local system -+.IP \(bu 2 -+The \fBplayground\fP is used to enable or disable the Playground repository -+.UNINDENT -+.SH SYNOPSIS -+.sp -+\fByum copr [enable|disable|list|search] \fP -+.sp -+\fByum playground [enable|disable|upgrade]\fP -+.SH ARGUMENTS (COPR) -+.INDENT 0.0 -+.TP -+.B \fBenable name/project [chroot]\fP -+Enable the \fBname/project\fP Copr repository with the optional \fBchroot\fP\&. -+.TP -+.B \fBdisable name/project\fP -+Disable the \fBname/project\fP Copr repository. -+.TP -+.B \fBlist name\fP -+List available Copr repositories for a given \fBname\fP\&. -+.TP -+.B \fBsearch project\fP -+Search for a given \fBproject\fP\&. -+.UNINDENT -+.SH ARGUMENTS (PLAYGROUND) -+.INDENT 0.0 -+.TP -+.B \fBenable\fP -+Enable the Playground repository. -+.TP -+.B \fBdisable\fP -+Disable the Playground repository. -+.TP -+.B \fBupgrade\fP -+Upgrade the Playground repository settings (same as \fBdisable\fP and then \fBenable\fP). -+.UNINDENT -+.SH EXAMPLES -+.INDENT 0.0 -+.TP -+.B \fBcopr enable rhscl/perl516 epel\-6\-x86_64\fP -+Enable the \fBrhscl/perl516\fP Copr repository, using the \fBepel\-6\-x86_64\fP chroot. -+.TP -+.B \fBcopr disable rhscl/perl516\fP -+Disable the \fBrhscl/perl516\fP Copr repository -+.TP -+.B \fBcopr list rita\fP -+List available Copr projects for user \fBrita\fP\&. -+.TP -+.B \fBcopr search tests\fP -+Search for Copr projects named \fBtests\fP\&. -+.UNINDENT -+.SH AUTHOR -+See AUTHORS in the Core DNF Plugins distribution -+.SH COPYRIGHT -+2014, Red Hat, Licensed under GPLv2+ -+.\" Generated by docutils manpage writer. -+. -diff --git a/docs/yum-debug-dump.1 b/docs/yum-debug-dump.1 -index 0e65a07..3f1e2e5 100644 ---- a/docs/yum-debug-dump.1 -+++ b/docs/yum-debug-dump.1 -@@ -1,7 +1,7 @@ - .\" yum-debug-dump - .TH "yum-debug-dump" "1" "28 April 2008" "Seth Vidal" "" - .SH "NAME" --yum-debug-dump -+yum-debug-dump \- write system RPM configuration to a debug-dump file - .SH "SYNOPSIS" - \fByum-debug-dump\fP - .SH "DESCRIPTION" -@@ -10,11 +10,15 @@ yum-debug-dump - lot of information useful to developers trying to debug a problem. - .PP - By default it will output a file to the current working directory named --yum_debug_dump.txt.gz. This file contains no private information but does -+yum_debug_dump--