diff --git a/SOURCES/BZ-1095150-needs-restarting-fixes.patch b/SOURCES/BZ-1095150-needs-restarting-fixes.patch new file mode 100644 index 0000000..cf1a294 --- /dev/null +++ b/SOURCES/BZ-1095150-needs-restarting-fixes.patch @@ -0,0 +1,54 @@ +diff -up yum-utils-1.1.31/needs-restarting.py.old yum-utils-1.1.31/needs-restarting.py +--- yum-utils-1.1.31/needs-restarting.py.old 2014-09-04 14:19:27.000000000 +0200 ++++ yum-utils-1.1.31/needs-restarting.py 2014-09-04 14:29:47.825438668 +0200 +@@ -44,6 +44,8 @@ import yum.misc + import glob + import stat + from optparse import OptionParser ++sys.path.insert(0,'/usr/share/yum-cli') ++import utils + + def parseargs(args): + usage = """ +@@ -77,7 +79,8 @@ def get_open_files(pid): + files = [] + smaps = '/proc/%s/smaps' % pid + try: +- maps = open(smaps, 'r').readlines() ++ with open(smaps, 'r') as maps_f: ++ maps = maps_f.readlines() + except (IOError, OSError), e: + print "Could not open %s" % smaps + return files +@@ -88,7 +91,7 @@ def get_open_files(pid): + continue + line = line.replace('\n', '') + filename = line[slash:] +- #filename = filename.replace('(deleted)', '') #only mildly retarded ++ filename = filename.split(';')[0] + filename = filename.strip() + if filename not in files: + files.append(filename) +@@ -109,10 +112,11 @@ def main(args): + + needing_restart = set() + ++ boot_time = utils.get_boot_time() + for pid in return_running_pids(uid=myuid): + try: +- 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): +@@ -158,7 +162,7 @@ def main(args): + for pid in needing_restart: + try: + cmdline = open('/proc/' +pid+ '/cmdline', 'r').read() +- except OSError, e: ++ except (OSError, IOError), e: + print "Couldn't access process information for %s: %s" % (pid, str(e)) + continue + # proc cmdline is null-delimited so clean that up diff --git a/SOURCES/BZ-1104995-yumdownloader-redownloading-existing-rpms.patch b/SOURCES/BZ-1104995-yumdownloader-redownloading-existing-rpms.patch new file mode 100644 index 0000000..02cba4f --- /dev/null +++ b/SOURCES/BZ-1104995-yumdownloader-redownloading-existing-rpms.patch @@ -0,0 +1,38 @@ +commit 682227430bb2124fb2897371fa5bc5261099064a +Author: Zdenek Pavlas +Date: Mon Sep 9 15:15:35 2013 +0200 + + yumdownloader: make --destdir less of a hack. BZ 1004089 + + Instead of changing po.localpath, use the conf.downloaddir option + already used to override repo.pkgdir(s). + +diff --git a/yumdownloader.py b/yumdownloader.py +index 4c5eefb..b491c7f 100755 +--- a/yumdownloader.py ++++ b/yumdownloader.py +@@ -96,6 +96,9 @@ 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) +@@ -202,14 +205,8 @@ class YumDownloader(YumUtilBase): + print urljoin(pkg.repo.urls[0], pkg.relativepath) + return 0 + +- # create dest dir +- if not os.path.exists(opts.destdir): +- os.makedirs(opts.destdir) +- + # set localpaths + for pkg in toDownload: +- rpmfn = os.path.basename(pkg.remote_path) +- pkg.localpath = os.path.join(opts.destdir, rpmfn) + pkg.repo.copy_local = True + pkg.repo.cache = 0 + diff --git a/SOURCES/BZ-1107658-needs-restarting-graceful-error.patch b/SOURCES/BZ-1107658-needs-restarting-graceful-error.patch new file mode 100644 index 0000000..611ea6f --- /dev/null +++ b/SOURCES/BZ-1107658-needs-restarting-graceful-error.patch @@ -0,0 +1,39 @@ +diff -up yum-utils-1.1.31/needs-restarting.py.old yum-utils-1.1.31/needs-restarting.py +--- yum-utils-1.1.31/needs-restarting.py.old 2014-09-18 10:17:13.000000000 +0200 ++++ yum-utils-1.1.31/needs-restarting.py 2014-09-18 10:22:41.596236067 +0200 +@@ -44,6 +44,7 @@ import yum.misc + import glob + import stat + from optparse import OptionParser ++from yum.Errors import RepoError + sys.path.insert(0,'/usr/share/yum-cli') + import utils + +@@ -82,7 +83,7 @@ def get_open_files(pid): + 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 + return files + + for line in maps: +@@ -164,7 +165,7 @@ def main(args): + try: + cmdline = open('/proc/' +pid+ '/cmdline', 'r').read() + except (OSError, IOError), 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', ' ') +@@ -173,4 +174,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/SOURCES/BZ-1113391-yumdownloader-depsolving-errors.patch b/SOURCES/BZ-1113391-yumdownloader-depsolving-errors.patch new file mode 100644 index 0000000..cd90499 --- /dev/null +++ b/SOURCES/BZ-1113391-yumdownloader-depsolving-errors.patch @@ -0,0 +1,23 @@ +commit 36280feaee2b0cfb83d8af134f6aff3bcc976af1 +Author: Valentina Mukhamedzhanova +Date: Wed Apr 9 15:30:21 2014 +0200 + + Print depsolving errors in yumdownloader instead of ignoring them. BZ 998892 + +diff --git a/yumdownloader.py b/yumdownloader.py +index 1b57777..1b95e8d 100755 +--- a/yumdownloader.py ++++ b/yumdownloader.py +@@ -197,7 +197,11 @@ 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 pkg.ts_state in ('i', 'u') and pkg.po not in toDownload: diff --git a/SOURCES/BZ-1121714-reposync-manpage-missing-switches.patch b/SOURCES/BZ-1121714-reposync-manpage-missing-switches.patch new file mode 100644 index 0000000..b74d0d2 --- /dev/null +++ b/SOURCES/BZ-1121714-reposync-manpage-missing-switches.patch @@ -0,0 +1,44 @@ +From 4833f65fd4b9bd06a9a5e00fb8bc986ad33273e4 Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Mon, 25 Aug 2014 08:57:22 +0200 +Subject: [PATCH] reposync.1 missing options + +--- + docs/reposync.1 | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/docs/reposync.1 b/docs/reposync.1 +index 29043fb..d6d245a 100644 +--- a/docs/reposync.1 ++++ b/docs/reposync.1 +@@ -20,10 +20,18 @@ 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. +@@ -31,6 +39,8 @@ exit status is '1' if at least one package was removed. + Just list urls of what would be downloaded, don't download. + .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" +-- +1.9.3 + diff --git a/SOURCES/BZ-1127782-post-transaction-action.patch b/SOURCES/BZ-1127782-post-transaction-action.patch new file mode 100644 index 0000000..bed3880 --- /dev/null +++ b/SOURCES/BZ-1127782-post-transaction-action.patch @@ -0,0 +1,60 @@ +commit d317fd0d8f56eb352c7dbb78bc283c208da9a561 +Author: Zdenek Pavlas +Date: Tue Jan 14 12:08:43 2014 +0100 + + post-transaction-actions: fix filename matching. BZ 1045494 + + I believe the code now works as origanally intended. When installing + packages, txmbr.po is AvailablePackage instance and .filelist access + may trigger filelist metadata download. + + Since this runs after the transaction, we may look the package up + in rpmdb instead. On removals, thispo is RPMInstalledPackage already. + Thanks to Robert Tomczyk for reporting + and testing this. + +diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py +index b4da1ce..804af9c 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): + + 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) + + if not yum.misc.re_glob(a_k): +commit 78cfff9b48608ad246a8898d002937d9b6ffcc5d +Author: Valentina Mukhamedzhanova +Date: Wed Aug 20 17:31:16 2014 +0200 + + post-transaction-actions: preload filelists for packages to be removed. BZ 1127782 + +diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py +index 804af9c..4d015c1 100644 +--- a/plugins/post-transaction-actions/post-transaction-actions.py ++++ b/plugins/post-transaction-actions/post-transaction-actions.py +@@ -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 diff --git a/SOURCES/BZ-1129590-setopt-wildcards-save.patch b/SOURCES/BZ-1129590-setopt-wildcards-save.patch new file mode 100644 index 0000000..33b4d45 --- /dev/null +++ b/SOURCES/BZ-1129590-setopt-wildcards-save.patch @@ -0,0 +1,32 @@ +diff -up yum-utils-1.1.31/yum-config-manager.py.old yum-utils-1.1.31/yum-config-manager.py +--- yum-utils-1.1.31/yum-config-manager.py.old 2014-08-13 11:50:30.000000000 +0200 ++++ yum-utils-1.1.31/yum-config-manager.py 2014-08-13 11:52:02.801755611 +0200 +@@ -7,6 +7,7 @@ import yum + sys.path.insert(0,'/usr/share/yum-cli') + from utils import YumUtilBase + import logging ++import fnmatch + + from iniparse import INIConfig + +@@ -97,6 +98,11 @@ def writeRawConfigFile(filename, section + 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]' +@@ -175,7 +181,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) diff --git a/SOURCES/BZ-1133125-reposync-urls-for-all-repos.patch b/SOURCES/BZ-1133125-reposync-urls-for-all-repos.patch new file mode 100644 index 0000000..3ec4edb --- /dev/null +++ b/SOURCES/BZ-1133125-reposync-urls-for-all-repos.patch @@ -0,0 +1,19 @@ +commit 2cc8c240f6ea6ba7fae15721c9d7892024c65a8f +Author: Valentina Mukhamedzhanova +Date: Thu Aug 28 10:17:38 2014 +0200 + + reposync: show urls for all repos when using -u option. BZ 1133125 + +diff --git a/reposync.py b/reposync.py +index 6500db6..bb4c59d 100755 +--- a/reposync.py ++++ b/reposync.py +@@ -283,7 +283,7 @@ def main(): + if opts.urls: + for pkg in download_list: + print urljoin(pkg.repo.urls[0], pkg.relativepath) +- return 0 ++ continue + + # create dest dir + if not os.path.exists(local_repo_path): diff --git a/SOURCES/BZ-1134989-post-transaction-actions-allow-colons.patch b/SOURCES/BZ-1134989-post-transaction-actions-allow-colons.patch new file mode 100644 index 0000000..3dcef1d --- /dev/null +++ b/SOURCES/BZ-1134989-post-transaction-actions-allow-colons.patch @@ -0,0 +1,19 @@ +commit 8b046d7d18e0f582d9f703336d5c25a71cf02966 +Author: Valentina Mukhamedzhanova +Date: Thu Aug 28 18:18:53 2014 +0200 + + yum-post-transaction-actions: allow colons in command part. BZ 1134989 + +diff --git a/plugins/post-transaction-actions/post-transaction-actions.py b/plugins/post-transaction-actions/post-transaction-actions.py +index 4d015c1..d59dc40 100644 +--- a/plugins/post-transaction-actions/post-transaction-actions.py ++++ b/plugins/post-transaction-actions/post-transaction-actions.py +@@ -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 diff --git a/SOURCES/BZ-1139032-reposync-directory-structure.patch b/SOURCES/BZ-1139032-reposync-directory-structure.patch new file mode 100644 index 0000000..99c571f --- /dev/null +++ b/SOURCES/BZ-1139032-reposync-directory-structure.patch @@ -0,0 +1,25 @@ +commit abdc5d04ca75357f7e2cf9852c4b6d3486cf8dd5 +Author: Valentina Mukhamedzhanova +Date: Wed Sep 10 09:45:26 2014 +0200 + + reposync: preserve directory structure. BZ 1139032 + +diff --git a/reposync.py b/reposync.py +index bb4c59d..eb8ab21 100755 +--- a/reposync.py ++++ b/reposync.py +@@ -291,10 +291,13 @@ def main(): + + # set localpaths + for pkg in download_list: +- rpmfn = os.path.basename(pkg.remote_path) ++ 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) + + # use downloader from YumBase + probs = my.downloadPkgs(download_list) diff --git a/SOURCES/BZ-1140864-reposync-urls-option-ignores-downloaded.patch b/SOURCES/BZ-1140864-reposync-urls-option-ignores-downloaded.patch new file mode 100644 index 0000000..477a40d --- /dev/null +++ b/SOURCES/BZ-1140864-reposync-urls-option-ignores-downloaded.patch @@ -0,0 +1,15 @@ +diff -up yum-utils-1.1.31/reposync.py.old yum-utils-1.1.31/reposync.py +--- yum-utils-1.1.31/reposync.py.old 2014-09-24 09:47:05.000000000 +0200 ++++ yum-utils-1.1.31/reposync.py 2014-09-24 09:52:46.147944904 +0200 +@@ -293,7 +293,10 @@ def main(): + download_list.sort(sortPkgObj) + if opts.urls: + for pkg in download_list: +- print urljoin(pkg.repo.urls[0], pkg.relativepath) ++ 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 diff --git a/SPECS/yum-utils.spec b/SPECS/yum-utils.spec index 81939f1..5f5c4ff 100644 --- a/SPECS/yum-utils.spec +++ b/SPECS/yum-utils.spec @@ -12,7 +12,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 25%{?dist} +Release: 29%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -23,11 +23,25 @@ Patch4: BZ-1052871-debuginfo-install-wrong-repo-suffix.patch Patch5: BZ-1024070-yum-builddep-requires-source-repos-disabled.patch Patch6: BZ-1060702-reposync-nonexistent-repo.patch Patch7: BZ-1082050-source-repos.patch + +# rhel-7.1 +Patch50: BZ-1134989-post-transaction-actions-allow-colons.patch +Patch51: BZ-1133125-reposync-urls-for-all-repos.patch +Patch52: BZ-1129590-setopt-wildcards-save.patch +Patch53: BZ-1127782-post-transaction-action.patch +Patch54: BZ-1121714-reposync-manpage-missing-switches.patch +Patch55: BZ-1113391-yumdownloader-depsolving-errors.patch +Patch56: BZ-1104995-yumdownloader-redownloading-existing-rpms.patch +Patch57: BZ-1095150-needs-restarting-fixes.patch +Patch58: BZ-1139032-reposync-directory-structure.patch +Patch59: BZ-1140864-reposync-urls-option-ignores-downloaded.patch +Patch60: BZ-1107658-needs-restarting-graceful-error.patch + URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -# For new findRepos() API. -Requires: yum >= 3.4.3-96 +# For new findRepos() API and utils.get_process_info() API. +Requires: yum >= 3.4.3-120 Requires: python-kitchen BuildRequires: python-devel >= 2.4 BuildRequires: gettext @@ -383,6 +397,19 @@ Supplies checksums for files in packages from puppet's state file. %patch6 -p1 %patch7 -p1 +# rhel-7.1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 + %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install @@ -686,6 +713,38 @@ fi %endif %changelog +* Mon Nov 10 2014 Valentina Mukhamedzhanova - 1.1.31-29 +- reposync: fix man page formatting. +- Related: bug#1121714 + +* Wed Sep 24 2014 Valentina Mukhamedzhanova - 1.1.31-28 +- needs-restarting: handle RepoError gracefully. +- Resolves: bug#1107658 + +* Wed Sep 24 2014 Valentina Mukhamedzhanova - 1.1.31-27 +- reposync: preserve directory structure. +- Resolves: bug#1139032 +- reposync: check for existing packages when using -u option. +- Resolves: bug#1140864 + +* Thu Sep 4 2014 Valentina Mukhamedzhanova - 1.1.31-26 +- yum-post-transaction-actions: allow colons in command part. +- Resolves: bug#1134989 +- reposync: show urls for all repos when using -u option. +- Resolves: bug#1133125 +- yum-config-manager: fix --save when --setopt contains wildcards. +- Resolves: bug#1129590 +- post-transaction-actions: fix filename matching. +- Resolves: bug#1127782 +- reposync: add missing switches to the manpage. +- Resolves: bug#1121714 +- yumdownloader: print depsolving errors instead of ignoring them. +- Resolves: bug#1113391 +- yumdownloader: make --destdir less of a hack. +- Resolves: bug#1104995 +- needs-restarting: multiple fixes. +- Resolves: bug#1095150 + * Tue Aug 5 2014 Valentina Mukhamedzhanova - 1.1.31-25 - yumdownloader, yum-builddep: do not ignore source repos. - Resolves: bug#1082050