diff --git a/SOURCES/BZ-1510495-yumRepo-migrate-more-prints-to-logging.patch b/SOURCES/BZ-1510495-yumRepo-migrate-more-prints-to-logging.patch new file mode 100644 index 0000000..da1a24b --- /dev/null +++ b/SOURCES/BZ-1510495-yumRepo-migrate-more-prints-to-logging.patch @@ -0,0 +1,64 @@ +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index eeeacab1..1e0e9135 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -836,9 +836,9 @@ class YumRepository(Repository, config.RepoConf): + try: + misc.unlink_f(self.mirrorlist_file) + except (IOError, OSError), e: +- print 'Could not delete bad mirrorlist file: %s - %s' % (self.mirrorlist_file, e) ++ logger.error('Could not delete bad mirrorlist file: %s - %s' % (self.mirrorlist_file, e)) + else: +- print 'removing mirrorlist with no valid mirrors: %s' % self.mirrorlist_file ++ logger.warning('removing mirrorlist with no valid mirrors: %s' % self.mirrorlist_file) + # store them all back in baseurl for compat purposes + self.baseurl = self._urls + self.check() +@@ -868,9 +868,9 @@ class YumRepository(Repository, config.RepoConf): + if skipped is not None: + # Caller cleans up for us. + if goodurls: +- print 'YumRepo Warning: Some mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped) ++ logger.warning('YumRepo Warning: Some mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped)) + else: # And raises in this case +- print 'YumRepo Error: All mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped) ++ logger.error('YumRepo Error: All mirror URLs are not using ftp, http[s] or file.\n Eg. %s' % misc.to_utf8(skipped)) + return goodurls + + def _geturls(self): +@@ -900,7 +900,7 @@ class YumRepository(Repository, config.RepoConf): + raise Errors.RepoError, msg + # Now, we have an old usable metalink, so we can't move to + # a newer repomd.xml ... or checksums won't match. +- print "Could not get metalink %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])) ++ logger.error("Could not get metalink %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))) + self._metadataCurrent = True + + if not self._metadataCurrent: +@@ -909,7 +909,7 @@ class YumRepository(Repository, config.RepoConf): + shutil.move(result, self.metalink_filename) + except metalink.MetaLinkRepoErrorParseFail, e: + # Downloaded file failed to parse, revert (dito. above): +- print "Could not parse metalink %s error was \n%s"%(url, e) ++ logger.error("Could not parse metalink %s error was \n%s" % (url, e)) + self._metadataCurrent = True + misc.unlink_f(result) + +@@ -1966,7 +1966,7 @@ Insufficient space in download directory %s + except Exception, e: + if url is None: # Shouldn't happen + url = "" +- print "Could not read mirrorlist %s, error was \n%s" %(url, e) ++ logger.error("Could not read mirrorlist %s, error was \n%s" % (url, e)) + content = [] + for line in content: + if not re.match('\w+://\S+\s*$', line): +@@ -2003,7 +2003,7 @@ Insufficient space in download directory %s + try: + fo = urlgrabber.grabber.urlopen(url, **ugopts) + except URLGrabError, e: +- print "Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1])) ++ logger.error("Could not retrieve mirrorlist %s error was\n%s: %s" % (url, e.args[0], misc.to_unicode(e.args[1]))) + fo = None + + (returnlist, content) = self._readMirrorList(fo, url) diff --git a/SOURCES/BZ-1564747-gracefully-handle-reinstall-self-conflicts.patch b/SOURCES/BZ-1564747-gracefully-handle-reinstall-self-conflicts.patch new file mode 100644 index 0000000..d6acd19 --- /dev/null +++ b/SOURCES/BZ-1564747-gracefully-handle-reinstall-self-conflicts.patch @@ -0,0 +1,29 @@ +diff --git a/yum/__init__.py b/yum/__init__.py +index 56f8c8c4..cf9b68bd 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -6745,7 +6745,23 @@ much more problems). + # Newer rpm (4.8.0+) has problem objects, older have just strings. + # Should probably move to using the new objects, when we can. For + # now just be compatible. +- results.append(to_str(prob)) ++ msg = to_str(prob) ++ ++ # RPM currently complains about self-conflicts on reinstalls, even ++ # though they are allowed otherwise, so just ignore them. ++ # Unfortunately, we have to parse the problem string in order to ++ # get the provide name (which should be the first token). ++ if prob.type == rpm.RPMPROB_CONFLICT: ++ tokens = msg.split() ++ pkgs = self.rpmdb.returnPackages(patterns=[prob.pkgNEVR]) ++ if tokens and pkgs: ++ name = tokens[0] ++ pkg = pkgs[0] ++ provs = self.rpmdb.getProvides(name).keys() ++ if len(provs) == 1 and provs[0] == pkg: ++ continue ++ ++ results.append(msg) + + return results + diff --git a/SOURCES/BZ-1573154-docs-yum-command-is-not-optional.patch b/SOURCES/BZ-1573154-docs-yum-command-is-not-optional.patch new file mode 100644 index 0000000..998b97f --- /dev/null +++ b/SOURCES/BZ-1573154-docs-yum-command-is-not-optional.patch @@ -0,0 +1,13 @@ +diff --git a/docs/yum.8 b/docs/yum.8 +index 2030cebf..e70aa788 100644 +--- a/docs/yum.8 ++++ b/docs/yum.8 +@@ -3,7 +3,7 @@ + .SH "NAME" + yum \- Yellowdog Updater Modified + .SH "SYNOPSIS" +-\fByum\fP [options] [command] [package ...] ++\fByum\fP [options] command [package ...] + .SH "DESCRIPTION" + .PP + \fByum\fP is an interactive, rpm based, package manager. It can automatically diff --git a/SOURCES/BZ-1645618-updateinfo-suggest-verbose-command.patch b/SOURCES/BZ-1645618-updateinfo-suggest-verbose-command.patch new file mode 100644 index 0000000..f7ba730 --- /dev/null +++ b/SOURCES/BZ-1645618-updateinfo-suggest-verbose-command.patch @@ -0,0 +1,14 @@ +diff --git a/yum/update_md.py b/yum/update_md.py +index 103149a9..5c91232a 100644 +--- a/yum/update_md.py ++++ b/yum/update_md.py +@@ -611,8 +611,7 @@ class UpdateMetadata(object): + msg = _("Update notice %s%s is broken, or a bad duplicate, skipping.") % (un['update_id'], _rid(repoid)) + if not have_dup: + msg += _('\nYou should report this problem to the owner of the %srepository.') % _rid(repoid, "%s ") +- msg += _('\nIf you are the owner, consider re-running the same command with --verbose to see the ' +- 'exact data that caused the conflict.') ++ msg += _('\nTo help pinpoint the issue, please attach the output of "yum updateinfo --verbose" to the report.') + have_dup = True + if self._vlogger: + self._vlogger.warn("%s", msg) diff --git a/SOURCES/BZ-1689025-installonly-do-not-reinstall-local.patch b/SOURCES/BZ-1689025-installonly-do-not-reinstall-local.patch new file mode 100644 index 0000000..2605a61 --- /dev/null +++ b/SOURCES/BZ-1689025-installonly-do-not-reinstall-local.patch @@ -0,0 +1,21 @@ +diff --git a/yum/__init__.py b/yum/__init__.py +index 56f8c8c4..ebec4e92 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -5605,11 +5605,11 @@ much more problems). + + for installed_pkg in installedByKey: + if po.verGT(installed_pkg): # we're newer - this is an update, pass to them +- if installed_pkg.name in self.conf.exactarchlist: +- if po.arch == installed_pkg.arch: +- updatepkgs.append((po, installed_pkg)) +- else: +- donothingpkgs.append(po) ++ if (installed_pkg.name in self.conf.exactarchlist ++ and po.arch != installed_pkg.arch): ++ donothingpkgs.append(po) ++ elif self.allowedMultipleInstalls(po): ++ installpkgs.append(po) + else: + updatepkgs.append((po, installed_pkg)) + elif po.verEQ(installed_pkg): diff --git a/SOURCES/BZ-1690376-gracefully-handle-empty-rpm-error-list.patch b/SOURCES/BZ-1690376-gracefully-handle-empty-rpm-error-list.patch new file mode 100644 index 0000000..1ac7a1e --- /dev/null +++ b/SOURCES/BZ-1690376-gracefully-handle-empty-rpm-error-list.patch @@ -0,0 +1,22 @@ +diff --git a/rpmUtils/transaction.py b/rpmUtils/transaction.py +index 778ed2db..96e0ffc3 100644 +--- a/rpmUtils/transaction.py ++++ b/rpmUtils/transaction.py +@@ -119,11 +119,13 @@ class TransactionWrapper: + tserrors = self.ts.run(cb.callback, '') + self.ts.setFlags(origflags) + ++ if tserrors is None: ++ return [] ++ if not tserrors: ++ return ['Unknown error during transaction test in RPM'] + reserrors = [] +- if tserrors: +- for (descr, (etype, mount, need)) in tserrors: +- reserrors.append(descr) +- ++ for (descr, (etype, mount, need)) in tserrors: ++ reserrors.append(descr) + return reserrors + + diff --git a/SOURCES/BZ-1713649-depsolve-every-provider-conflicts.patch b/SOURCES/BZ-1713649-depsolve-every-provider-conflicts.patch new file mode 100644 index 0000000..8ef5913 --- /dev/null +++ b/SOURCES/BZ-1713649-depsolve-every-provider-conflicts.patch @@ -0,0 +1,61 @@ +diff --git a/yum/depsolve.py b/yum/depsolve.py +index d8e3ecc6..046623d1 100644 +--- a/yum/depsolve.py ++++ b/yum/depsolve.py +@@ -1436,6 +1436,14 @@ class Depsolve(object): + return False + return x.sourcerpm == y.sourcerpm + ++ def _conflict_req(x, y): ++ if y is None: ++ return False ++ for ydep in y.conflicts: ++ if x.checkPrco('provides', ydep): ++ return True ++ return False ++ + def _compare_arch_distance(x, y, req_compare_arch): + # take X and Y package objects + # determine which has a closer archdistance to compare_arch +@@ -1488,15 +1496,9 @@ class Depsolve(object): + continue + unique_nevra_pkgs[pkg.pkgtup] = pkg + pkgs = unique_nevra_pkgs.values() +- +- # Do a conflict filtering; get rid of those pkgs that reqpo conflicts +- # with +- if reqpo is not None: +- pkgs = [pkg for pkg in pkgs +- if not any(pkg.checkPrco('provides', conflict) +- for conflict in reqpo.conflicts)] + + pkgresults = {} ++ penalize = set() + + for pkg in pkgs: + pkgresults[pkg] = 0 +@@ -1602,6 +1604,10 @@ class Depsolve(object): + self.verbose_logger.log(logginglevels.DEBUG_4, + _('common sourcerpm %s and %s' % (po, reqpo))) + pkgresults[po] += 20 ++ if _conflict_req(po, reqpo): ++ self.verbose_logger.log(logginglevels.DEBUG_4, ++ _('conflict req %s and %s' % (po, reqpo))) ++ penalize.add(po) + if self.isPackageInstalled(po.base_package_name): + self.verbose_logger.log(logginglevels.DEBUG_4, + _('base package %s is installed for %s' % (po.base_package_name, po))) +@@ -1686,6 +1692,13 @@ class Depsolve(object): + pkgresults[po] += 1000 + pkgresults[po] += (len(po.name)*-1) + ++ # Bump down any packages that we identified as "last-resort" in such a ++ # way that they all score below the worst overall score whilst keeping ++ # their relative differences. ++ shift = max(pkgresults.values()) - min(pkgresults.values()) + 1 ++ for po in penalize: ++ pkgresults[po] -= shift ++ + bestorder = sorted(pkgresults.items(), + key=lambda x: (x[1], x[0]), reverse=True) + self.verbose_logger.log(logginglevels.DEBUG_4, diff --git a/SOURCES/BZ-1744639-yum-cron-make-sure-output-fully-unicode.patch b/SOURCES/BZ-1744639-yum-cron-make-sure-output-fully-unicode.patch new file mode 100644 index 0000000..23f87c6 --- /dev/null +++ b/SOURCES/BZ-1744639-yum-cron-make-sure-output-fully-unicode.patch @@ -0,0 +1,33 @@ +diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py +index 23f36d38..fd593d62 100755 +--- a/yum-cron/yum-cron.py ++++ b/yum-cron/yum-cron.py +@@ -140,7 +140,11 @@ class UpdateEmitter(object): + overridden by inheriting classes to emit the messages + according to their individual methods. + """ +- pass ++ # Convert any byte strings to unicode objects now (so that we avoid ++ # implicit conversions with the "ascii" codec later when join()-ing the ++ # strings, leading to tracebacks). ++ self.output = [x.decode('utf-8') if isinstance(x, str) else x ++ for x in self.output] + + + class EmailEmitter(UpdateEmitter): +@@ -220,6 +224,7 @@ class EmailEmitter(UpdateEmitter): + """Combine the stored messages that have been stored into a + single email message, and send this message. + """ ++ super(EmailEmitter, self).sendMessages() + # Don't send empty emails + if not self.output: + return +@@ -262,6 +267,7 @@ class StdIOEmitter(UpdateEmitter): + """Combine the stored messages that have been stored into a + single email message, and send this message to standard output. + """ ++ super(StdIOEmitter, self).sendMessages() + # Don't print blank lines + if not self.output: + return diff --git a/SOURCES/BZ-1757613-downloadonly-do-not-reset-localpath.patch b/SOURCES/BZ-1757613-downloadonly-do-not-reset-localpath.patch new file mode 100644 index 0000000..407a5fc --- /dev/null +++ b/SOURCES/BZ-1757613-downloadonly-do-not-reset-localpath.patch @@ -0,0 +1,25 @@ +commit 3da1a101937f62b2e4836346d096d3c745bf34fd +Author: Lukáš Hrázký +Date: Tue Dec 17 15:17:08 2019 +0100 + + Don't reset the package localpath to temporary after download (RhBug:1757613) + + The path is already changed from temporary to final earlier in the + function, as the file is renamed. The removed line seems superfluous and + out of place, the value in po.localpath should already be the correct + one. + + https://bugzilla.redhat.com/show_bug.cgi?id=1757613 + +diff --git a/yum/__init__.py b/yum/__init__.py +index 56f8c8c4..9c158c81 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -2583,7 +2583,6 @@ much more problems). + result, errmsg = self.sigCheckPkg(po) + if result != 0: + self.verbose_logger.warn("%s", errmsg) +- po.localpath = obj.filename + if po in errors: + del errors[po] + diff --git a/SOURCES/yum.conf.centos b/SOURCES/yum.conf.centos deleted file mode 100644 index 367126f..0000000 --- a/SOURCES/yum.conf.centos +++ /dev/null @@ -1,26 +0,0 @@ -[main] -cachedir=/var/cache/yum/$basearch/$releasever -keepcache=0 -debuglevel=2 -logfile=/var/log/yum.log -exactarch=1 -obsoletes=1 -gpgcheck=1 -plugins=1 -installonly_limit=5 -bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum -distroverpkg=centos-release - - -# This is the default, if you make this bigger yum won't see if the metadata -# is newer on the remote and so you'll "gain" the bandwidth of not having to -# download the new metadata and "pay" for it by yum not having correct -# information. -# It is esp. important, to have correct metadata, for distributions like -# Fedora which don't keep old packages around. If you don't like this checking -# interupting your command line usage, it's much better to have something -# manually check the metadata once an hour (yum-updatesd will do this). -# metadata_expire=90m - -# PUT YOUR REPOS HERE OR IN separate files named file.repo -# in /etc/yum.repos.d diff --git a/SPECS/yum.spec b/SPECS/yum.spec index e50b653..98ccd89 100644 --- a/SPECS/yum.spec +++ b/SPECS/yum.spec @@ -32,11 +32,11 @@ Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 163%{?dist} +Release: 167%{?dist} License: GPLv2+ Group: System Environment/Base Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz -Source1: yum.conf.centos +Source1: yum.conf.fedora Source2: yum-updatesd.conf.fedora Patch1: yum-distro-configs.patch Patch5: geode-arch.patch @@ -174,7 +174,16 @@ Patch341: BZ-1645173-clean-all-disk-usage-fixes.patch Patch342: BZ-1600383-save-ts-no-str-concat.patch Patch343: BZ-1510491-fixup-yumdb-validator.patch -Patch1000: centos-branding-yum.patch +# rhel-7.8 +Patch360: BZ-1689025-installonly-do-not-reinstall-local.patch +Patch361: BZ-1713649-depsolve-every-provider-conflicts.patch +Patch362: BZ-1690376-gracefully-handle-empty-rpm-error-list.patch +Patch363: BZ-1564747-gracefully-handle-reinstall-self-conflicts.patch +Patch364: BZ-1510495-yumRepo-migrate-more-prints-to-logging.patch +Patch365: BZ-1744639-yum-cron-make-sure-output-fully-unicode.patch +Patch366: BZ-1573154-docs-yum-command-is-not-optional.patch +Patch367: BZ-1645618-updateinfo-suggest-verbose-command.patch +Patch368: BZ-1757613-downloadonly-do-not-reset-localpath.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -193,7 +202,6 @@ BuildRequires: pygpgme # End of CheckRequires Conflicts: pirut < 1.1.4 Requires: python >= 2.4 -Requires: yum-plugin-fastestmirror Requires: rpm-python, rpm >= 0:4.11.3-22 Requires: python-iniparse Requires: python-sqlite @@ -433,7 +441,16 @@ Install this package if you want auto yum updates nightly via cron. %patch342 -p1 %patch343 -p1 -%patch1000 -p1 +# rhel-7.8 +%patch360 -p1 +%patch361 -p1 +%patch362 -p1 +%patch363 -p1 +%patch364 -p1 +%patch365 -p1 +%patch366 -p1 +%patch367 -p1 +%patch368 -p1 # Do distro config. changes after everything else. %patch1 -p1 @@ -665,14 +682,33 @@ exit 0 %endif %changelog -* Tue Aug 06 2019 CentOS Sources - 3.4.3-163.el7.centos -- CentOS yum config -- use the CentOS bug tracker url -- retain installonly limit of 5 -- ensure distrover is always from centos-release -- Make yum require yum-plugin-fastestmirror - -* Wed May 17 2019 Michal Domonkos - 3.4.3-163 +* Fri Jan 10 2020 Michal Domonkos - 3.4.3-167 +- downloadonly: do not reset localpath +- Resolves: bug#1757613 + +* Mon Sep 09 2019 Michal Domonkos - 3.4.3-166 +- docs: yum command argument is not optional +- Resolves: bug#1573154 +- updateinfo: suggest command for --verbose if bad duplicate +- Resolves: bug#1645618 + +* Mon Aug 26 2019 Michal Domonkos - 3.4.3-165 +- yum-cron: convert output to unicode before emitting +- Resolves: bug#1744639 + +* Fri Aug 23 2019 Michal Domonkos - 3.4.3-164 +- Do not reinstall local installonly packages +- Resolves: bug#1689025 +- Fix traceback when every provider conflicts with requiring package +- Resolves: bug#1713649 +- Gracefully handle empty RPM error list during transaction test +- Resolves: bug#1690376 +- Gracefully handle self-conflicts during reinstall +- Resolves: bug#1564747 +- yumRepo: migrate more prints to logging +- Resolves: bug#1510495 + +* Fri May 17 2019 Michal Domonkos - 3.4.3-163 - Fix from_repo yumdb validator for local pkgs - Resolves: bug#1510491