From eb5f31275219f304669b024f0b1b387a4958583e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:00:26 +0000 Subject: import yum-3.4.3-150.el7 --- diff --git a/SOURCES/BZ-1004853-yum-cron-handle-empty-transaction.patch b/SOURCES/BZ-1004853-yum-cron-handle-empty-transaction.patch new file mode 100644 index 0000000..61f95fd --- /dev/null +++ b/SOURCES/BZ-1004853-yum-cron-handle-empty-transaction.patch @@ -0,0 +1,58 @@ +commit ae22bcdbacc01b12175304e14df59bdda45aa108 +Author: Andreas Fleig +Date: Wed Mar 16 12:35:38 2016 +0100 + + yum-cron: don't fail on empty transaction. BZ 1004853 + + Even if refreshUpdates() returns True, the transaction may still be + empty if some updateinfo filters were applied there and thus a later + call to buildTransaction() would return 0 (success). This wasn't + handled by findDeps() properly, making it emit an error message in such + a case. + + Note that, in the first place, we shouldn't return True from + refreshUpdates() if the transaction becomes empty after applying the + filters. However, we should handle this particular buildTransaction() + outcome in findDeps() regardless and that's sufficient to fix this bug. + + See also: + http://lists.baseurl.org/pipermail/yum/2014-December/024141.html + +diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py +index ccba690..5c3c1f9 100755 +--- a/yum-cron/yum-cron.py ++++ b/yum-cron/yum-cron.py +@@ -513,7 +513,13 @@ class YumCronBase(yum.YumBase, YumOutput): + except yum.Errors.RepoError, e: + self.emitCheckFailed("%s" %(e,)) + sys.exit() +- if res != 2: ++ if res == 0: ++ # success, empty transaction ++ sys.exit(0) ++ elif res == 2: ++ # success, dependencies resolved ++ pass ++ else: + self.emitCheckFailed("Failed to build transaction: %s" %(str.join("\n", resmsg),)) + sys.exit(1) + +commit 485121311f4ff40b939965587db735b05aec6fe0 +Author: Felix Kaiser +Date: Wed Mar 16 13:16:13 2016 +0100 + + yum-cron: fix exit code in findDeps() + +diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py +index 5c3c1f9..12c7720 100755 +--- a/yum-cron/yum-cron.py ++++ b/yum-cron/yum-cron.py +@@ -512,7 +512,7 @@ class YumCronBase(yum.YumBase, YumOutput): + (res, resmsg) = self.buildTransaction() + except yum.Errors.RepoError, e: + self.emitCheckFailed("%s" %(e,)) +- sys.exit() ++ sys.exit(1) + if res == 0: + # success, empty transaction + sys.exit(0) diff --git a/SOURCES/BZ-1065380-updateinfo-strip-respin.patch b/SOURCES/BZ-1065380-updateinfo-strip-respin.patch new file mode 100644 index 0000000..7f7a87c --- /dev/null +++ b/SOURCES/BZ-1065380-updateinfo-strip-respin.patch @@ -0,0 +1,135 @@ +commit 7b92efd65fea5187d295ffc4fcb49dcfbe822623 +Author: Michal Domonkos +Date: Tue May 17 13:04:52 2016 +0200 + + updateinfo: strip respin suffix if present. BZ 1065380 + +diff --git a/docs/yum.8 b/docs/yum.8 +index 9c09c48..efaa061 100644 +--- a/docs/yum.8 ++++ b/docs/yum.8 +@@ -1091,6 +1091,17 @@ To get the information on advisory FEDORA-2707-4567 use: + .IP + yum updateinfo info FEDORA-2707-4567 + .PP ++For Red Hat advisories, respin suffixes are also accepted in the ID, although ++they won't have any effect on the actual respin selected by yum, as it will ++always select the latest one available. For example, if you use: ++.IP ++yum updateinfo info RHSA-2016:1234-2 ++.PP ++while RHSA-2016:1234-3 has been shipped already, yum will select the latter ++(provided your updateinfo.xml is current). The same would happen if you just ++specified RHSA-2016:1234. That said, there's no need for you to specify or ++care about the suffix at all. ++.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 +diff --git a/yum/updateinfo.py b/yum/updateinfo.py +index 2b39330..7abe332 100644 +--- a/yum/updateinfo.py ++++ b/yum/updateinfo.py +@@ -1,5 +1,6 @@ + + import os.path ++import re + + from yum.i18n import _, P_ + +@@ -172,6 +173,40 @@ def _args2filters(args): + filters[T] = filters.get(T, []) + arg1.split(',') + return filters + ++def _ysp_gen_opts(filters, sec_cmds=None): ++ def strip_respin(id_): ++ # Example: RHSA-2016:1234-2 -> RHSA-2016:1234 ++ pattern = r'^(RH[BES]A\-\d+\:\d+)(\-\d+)?$' ++ match = re.match(pattern, id_) ++ if match: ++ return match.group(1) ++ return id_ ++ ++ opts = _updateinfofilter2opts(filters) ++ if sec_cmds is not None: ++ opts.sec_cmds = sec_cmds ++ ++ # If a RH advisory was specified with a respin suffix, strip it out, as we ++ # don't include these suffixes in the notice update_id attribute either (we ++ # use the version attribute for that). Note that there's no ambiguity in ++ # which notice version we should match then, as updateinfo.xml should only ++ # contain one per advisory ID (we give a warning when duplicate IDs are ++ # detected in it). The reason we are handling this is that we sometimes ++ # refer to advisories in this form (e.g. on rhn.redhat.com/errata/...) and ++ # the user may then use it with yum too, in which case we would yield no ++ # matches. ++ # ++ # However, we used to put these suffixes in update_id in the past, so let's ++ # also keep the original (unstripped) form around in opts, just in case we ++ # are dealing with such an old updateinfo.xml. ++ for attr in ['sec_cmds', 'advisory']: ++ oldlist = getattr(opts, attr) ++ stripped = map(strip_respin, oldlist) ++ newlist = list(set(oldlist) | set(stripped)) ++ setattr(opts, attr, newlist) ++ ++ return opts ++ + def _ysp_gen_used_map(opts): + used_map = {'bugzilla' : {}, 'cve' : {}, 'id' : {}, 'cmd' : {}, 'sev' : {}} + if True: +@@ -308,7 +343,7 @@ def remove_txmbrs(base, filters=None): + + if filters is None: + filters = base.updateinfo_filters +- opts = _updateinfofilter2opts(filters) ++ opts = _ysp_gen_opts(filters) + + if _no_options(opts): + return 0, 0, 0 +@@ -392,7 +427,7 @@ def exclude_updates(base, filters=None): + + if filters is None: + filters = base.updateinfo_filters +- opts = _updateinfofilter2opts(filters) ++ opts = _ysp_gen_opts(filters) + + if _no_options(opts): + return 0, 0 +@@ -446,7 +481,7 @@ def exclude_all(base, filters=None): + + if filters is None: + filters = base.updateinfo_filters +- opts = _updateinfofilter2opts(filters) ++ opts = _ysp_gen_opts(filters) + + if _no_options(opts): + return 0, 0 +@@ -487,7 +522,7 @@ def update_minimal(base, extcmds=[]): + txmbrs = [] + + used_map = _ysp_gen_used_map(base.updateinfo_filters) +- opts = _updateinfofilter2opts(base.updateinfo_filters) ++ opts = _ysp_gen_opts(base.updateinfo_filters) + ndata = _no_options(opts) + + # NOTE: Not doing obsoletes processing atm. ... maybe we should? -- +--- yum-3.4.3/yumcommands.py.orig 2016-05-19 12:58:38.354630030 +0200 ++++ yum-3.4.3/yumcommands.py 2016-05-19 12:59:37.385260152 +0200 +@@ -4071,7 +4071,6 @@ + # or -q deletes everything. + print x + +- opts = _upi._updateinfofilter2opts(base.updateinfo_filters) + extcmds, show_type, filt_type = self._parse_extcmds(extcmds) + + list_type = "available" +@@ -4081,7 +4080,7 @@ + if filt_type is None: + extcmds, show_type, filt_type = self._parse_extcmds(extcmds) + +- opts.sec_cmds = extcmds ++ opts = _upi._ysp_gen_opts(base.updateinfo_filters, extcmds) + used_map = _upi._ysp_gen_used_map(base.updateinfo_filters) + iname2tup = {} + if False: pass diff --git a/SOURCES/BZ-1168121-fssnapshot-manpage-fix.patch b/SOURCES/BZ-1168121-fssnapshot-manpage-fix.patch new file mode 100644 index 0000000..e3490df --- /dev/null +++ b/SOURCES/BZ-1168121-fssnapshot-manpage-fix.patch @@ -0,0 +1,38 @@ +commit 07fc9f374b8f069be28c353d1a0949f41da7adf2 +Author: Michal Domonkos +Date: Thu Feb 18 14:00:09 2016 +0100 + + docs: fix fssnapshot section in the manpage. BZ 1168121 + + - Include both aliases in the hanging tag + - Only use one alias throughout the text + - Fix a typo + +diff --git a/docs/yum.8 b/docs/yum.8 +index e428148..8569943 100644 +--- a/docs/yum.8 ++++ b/docs/yum.8 +@@ -718,9 +718,9 @@ updateinfo data: + .br + + .IP +-.IP "\fBfssnapshot\fP" ++.IP "\fBfssnapshot\fP or \fBfssnap\fP" + This command has a few sub-commands to act on the LVM data of the host, to list +-snapshots and the create and remove them. The simplest commands, to display ++snapshots and to create and remove them. The simplest commands, to display + information about the configured LVM snapshotable devices, are: + + .br +@@ -734,9 +734,9 @@ information about the configured LVM snapshotable devices, are: + then you can create and delete snapshots using: + + .br +-.I \fR yum fssnap create ++.I \fR yum fssnapshot create + .br +-.I \fR yum fssnap delete ++.I \fR yum fssnapshot delete + .br + + .br diff --git a/SOURCES/BZ-1175309-enable-repos-instruction.patch b/SOURCES/BZ-1175309-enable-repos-instruction.patch new file mode 100644 index 0000000..3046d09 --- /dev/null +++ b/SOURCES/BZ-1175309-enable-repos-instruction.patch @@ -0,0 +1,22 @@ +commit 6c9e839ab7ebee6357bbac8ab8ec143fc8ead461 +Author: Valentina Mukhamedzhanova +Date: Fri May 13 13:50:14 2016 +0200 + + Mention subscription-manager for enabling repos. + +diff --git a/yumcommands.py b/yumcommands.py +index 1d0f5ac..2c8cecd 100644 +--- a/yumcommands.py ++++ b/yumcommands.py +@@ -262,7 +262,10 @@ def checkEnabledRepo(base, possible_local_files=[]): + + msg = _('There are no enabled repos.\n' + ' Run "yum repolist all" to see the repos you have.\n' +- ' You can enable repos with yum-config-manager --enable ') ++ ' To enable Red Hat Subscription Management repositories:\n' ++ ' subscription-manager repos --enable \n' ++ ' To enable custom repositories:\n' ++ ' yum-config-manager --enable ') + base.logger.critical(msg) + raise cli.CliError + diff --git a/SOURCES/BZ-1183669-corrupt-cache.patch b/SOURCES/BZ-1183669-corrupt-cache.patch new file mode 100644 index 0000000..a1a71d0 --- /dev/null +++ b/SOURCES/BZ-1183669-corrupt-cache.patch @@ -0,0 +1,21 @@ +commit fb107337b2490d314a4f31562427cdebe9eca4e4 +Author: Valentina Mukhamedzhanova +Date: Thu Mar 17 16:35:29 2016 +0100 + + Disable repo with skip_if_unavailable=True if repomd.xml can't be retrieved. + +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index fc5d538..3f7e975 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -1460,6 +1460,10 @@ Insufficient space in download directory %s + else: + result = self._getFileRepoXML(local, text) + if result is None: ++ if self.skip_if_unavailable and self._metadata_cache_req in ('write', 'read-only:future'): ++ # Since skip_if_unavailable=True, we can just disable this repo ++ raise Errors.RepoError, "Can't download repomd.xml for %s" % self.ui_id ++ + # Ignore this as we have a copy + self._revertOldRepoXML() + return False diff --git a/SOURCES/BZ-1186690-compare_providers_priorities.patch b/SOURCES/BZ-1186690-compare_providers_priorities.patch new file mode 100644 index 0000000..eba7b46 --- /dev/null +++ b/SOURCES/BZ-1186690-compare_providers_priorities.patch @@ -0,0 +1,66 @@ +commit 9fb7032802a0f56cc85cf301478b48b3c72449e7 +Author: Valentina Mukhamedzhanova +Date: Tue May 10 16:42:01 2016 +0200 + + Add compare_providers_priority repository option. + +diff --git a/test/testbase.py b/test/testbase.py +index 467f8fb..73c97a1 100644 +--- a/test/testbase.py ++++ b/test/testbase.py +@@ -89,6 +89,7 @@ class FakeRepo(object): + sack = self.__fake_sack + self.sack = sack + self.cost = 1000 ++ self.compare_providers_priority = 80 + + def __cmp__(self, other): + """ Sort base class repos. by alphanumeric on their id, also +diff --git a/yum/config.py b/yum/config.py +index cae914d..1ee6dd3 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -1032,6 +1032,8 @@ class RepoConf(BaseConfig): + + check_config_file_age = Inherit(YumConf.check_config_file_age) + ++ compare_providers_priority = IntOption(80, range_min=1, range_max=99) ++ + + class VersionGroupConf(BaseConfig): + """Option definitions for version groups.""" +diff --git a/yum/depsolve.py b/yum/depsolve.py +index b482115..3453456 100644 +--- a/yum/depsolve.py ++++ b/yum/depsolve.py +@@ -1653,6 +1653,12 @@ class Depsolve(object): + pkgresults[po] += 5 + + # End of O(N*N): for nextpo in pkgs: ++ ++ # Respect the repository priority for each provider, the default is 80 ++ pkgresults[po] += (100 - po.repo.compare_providers_priority) * 10 ++ self.verbose_logger.log(logginglevels.DEBUG_4, ++ _('compare_providers_priority for %s is %s' % (po, po.repo.compare_providers_priority))) ++ + if _common_sourcerpm(po, reqpo): + self.verbose_logger.log(logginglevels.DEBUG_4, + _('common sourcerpm %s and %s' % (po, reqpo))) +diff -up yum-3.4.3/docs/yum.conf.5.old yum-3.4.3/docs/yum.conf.5 +--- yum-3.4.3/docs/yum.conf.5.old 2016-05-10 17:00:13.406111903 +0200 ++++ yum-3.4.3/docs/yum.conf.5 2016-05-10 17:01:03.302427161 +0200 +@@ -1229,6 +1229,14 @@ parallel, if possible. Defaults to True + Overrides the \fBui_repoid_vars\fR option from the [main] section for this + repository. + ++.IP ++\fBcompare_providers_priority \fR ++During depsolving, when choosing the best provider among several, yum will respect ++the priority of each provider's repository (note that there are other factors ++which yum considers, which may overweigh the repository priority). The value is ++an integer from 1 to 99, 1 being the most preferred repository, and 99 being ++the least preferred one. By default all repositories have the priority of 80. ++ + .SH "URL INCLUDE SYNTAX" + .LP + The inclusion of external configuration files is supported for /etc/yum.conf diff --git a/SOURCES/BZ-1195745-failed-repo-message.patch b/SOURCES/BZ-1195745-failed-repo-message.patch new file mode 100644 index 0000000..76ebaa8 --- /dev/null +++ b/SOURCES/BZ-1195745-failed-repo-message.patch @@ -0,0 +1,33 @@ +commit d83aab7e518f77a0de1e938fc4a7e7c4c55f1a17 +Author: Valentina Mukhamedzhanova +Date: Fri May 6 14:47:55 2016 +0200 + + Recommend --disablerepo and subscription-manager when a repo fails. BZ 1195745 + +diff --git a/yummain.py b/yummain.py +index 32680a8..b1666a2 100755 +--- a/yummain.py ++++ b/yummain.py +@@ -85,13 +85,18 @@ def main(args): + distribution release than is supported by the repository (and the + packages for the previous distribution release still work). + +- 3. Disable the repository, so yum won't use it by default. Yum will then +- just ignore the repository until you permanently enable it again or use +- --enablerepo for temporary usage: ++ 3. Run the command with the repository temporarily disabled ++ yum --disablerepo=%(repoid)s ... ++ ++ 4. Disable the repository permanently, so yum won't use it by default. Yum ++ will then just ignore the repository until you permanently enable it ++ again or use --enablerepo for temporary usage: + + yum-config-manager --disable %(repoid)s ++ or ++ subscription-manager repos --disable=%(repoid)s + +- 4. Configure the failing repository to be skipped, if it is unavailable. ++ 5. Configure the failing repository to be skipped, if it is unavailable. + Note that yum will try to contact the repo. when it runs most commands, + so will have to try and fail each time (and thus. yum will be be much + slower). If it is a very temporary problem though, this is often a nice diff --git a/SOURCES/BZ-1202680-handle-non-ascii-email.patch b/SOURCES/BZ-1202680-handle-non-ascii-email.patch new file mode 100644 index 0000000..2a5e241 --- /dev/null +++ b/SOURCES/BZ-1202680-handle-non-ascii-email.patch @@ -0,0 +1,42 @@ +commit 4e1de20b61ae3227d9fc973193a60cf7997e8606 +Author: Michal Domonkos +Date: Fri Feb 19 11:05:23 2016 +0100 + + yum-cron: don't crash with non-ascii email. BZ 1202680 + + Previously, we constructed our MIMEText object with the default us-ascii + charset, which caused it to encode the unicode string (self.output) with + the us-ascii codec. This worked fine as long as the string contained + ascii-only chars. However, if yum-cron was run with a language which + makes use of non-ascii chars, this would fail and MIMEText would crash. + + To fix that, we need to tell MIMEText to encode the message with utf-8 + instead. However, that also causes the message to be transfer-encoded + to base64 which is heavier and uglier, so let's limit that to non-ascii + email only. + +diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py +index 039f537..ccba690 100755 +--- a/yum-cron/yum-cron.py ++++ b/yum-cron/yum-cron.py +@@ -223,8 +223,18 @@ class EmailEmitter(UpdateEmitter): + # Don't send empty emails + if not self.output: + return +- # Build up the email to be sent +- msg = MIMEText(''.join(self.output)) ++ # Build up the email to be sent. Encode it with us-ascii instead of ++ # utf-8 if possible. This ensures the email package will not ++ # transfer-encode it to base64 in such a case (it decides based on the ++ # charset passed to the MIMEText constructor). ++ output = ''.join(self.output) ++ try: ++ output.encode('us-ascii') ++ except UnicodeEncodeError: ++ charset = 'utf-8' ++ else: ++ charset = 'us-ascii' ++ msg = MIMEText(output, 'plain', charset) + msg['Subject'] = self.subject + msg['From'] = self.opts.email_from + msg['To'] = ",".join(self.opts.email_to) diff --git a/SOURCES/BZ-1208803-autosavets.patch b/SOURCES/BZ-1208803-autosavets.patch new file mode 100644 index 0000000..53c724f --- /dev/null +++ b/SOURCES/BZ-1208803-autosavets.patch @@ -0,0 +1,60 @@ +commit 8d5248c4ab3e8efab00537da8f35a77b86f3c333 +Author: Valentina Mukhamedzhanova +Date: Fri May 6 11:30:56 2016 +0200 + + Add autosavets option allowing to avoid autosaving transactions. BZ 1208803 + +diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 +index efc6765..4d53c8e 100644 +--- a/docs/yum.conf.5 ++++ b/docs/yum.conf.5 +@@ -897,6 +897,12 @@ Note that if loadts_ignorerpm is True, this option does nothing. + Boolean (1, 0, True, False, yes, no) Defaults to False + + .IP ++\fBautosavets\fR ++Should yum automatically save a transaction to a file when the transaction is ++solved but not run. ++Boolean (1, 0, True, False, yes, no) Defaults to True ++ ++.IP + \fBfssnap_automatic_pre\fR + Should yum try to automatically create a snapshot before it runs a transaction. + Boolean (1, 0, True, False, yes, no) Defaults to False +diff --git a/yum/__init__.py b/yum/__init__.py +index c896fff..764e97d 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -1355,7 +1355,8 @@ much more problems). + self._depsolving_failed = False + + if rescode == 2: +- self.save_ts(auto=True) ++ if self.conf.autosavets: ++ self.save_ts(auto=True) + + # Make sure we don't fail in rpm if we're installing a package that is + # allowed multiple installs but has a newer version already installed. +diff --git a/yum/config.py b/yum/config.py +index 84be564..cae914d 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -893,6 +893,7 @@ class YumConf(StartupConf): + loadts_ignoremissing = BoolOption(False) + loadts_ignorerpm = BoolOption(False) + loadts_ignorenewrpm = BoolOption(False) ++ autosavets = BoolOption(True) + + clean_requirements_on_remove = BoolOption(False) + +diff -up yum-3.4.3/test/testbase.py.old yum-3.4.3/test/testbase.py +--- yum-3.4.3/test/testbase.py.old 2016-05-10 16:58:02.812286775 +0200 ++++ yum-3.4.3/test/testbase.py 2016-05-10 16:58:43.590544423 +0200 +@@ -69,6 +69,7 @@ class FakeConf(object): + self.diskspacecheck = True + self.depsolve_loop_limit = 10 + self.override_install_langs = '' ++ self.autosavets = True + + class FakeSack: + """ Fake PackageSack to use with FakeRepository""" diff --git a/SOURCES/BZ-1234967-handle-invalid-yumdb.patch b/SOURCES/BZ-1234967-handle-invalid-yumdb.patch new file mode 100644 index 0000000..831336c --- /dev/null +++ b/SOURCES/BZ-1234967-handle-invalid-yumdb.patch @@ -0,0 +1,155 @@ +commit f5c953e2b8c49187f8e874a53f1bb6ed89e4d810 +Author: Michal Domonkos +Date: Tue Feb 16 13:42:20 2016 +0100 + + Allow for validating attributes read from yumdb + + Make sure we don't expose corrupted attributes read from the yumdb to + the consumers. There's at least one report of such a corruption: BZ + 1234967. Instead, make requesting a malformed yumdb attribute + equivalent to requesting a non-existent one -- which is a valid + scenario, already handled by the consumers. + + Note that the actual validator function that fixes the above bug will be + committed separately. + +diff --git a/yum/rpmsack.py b/yum/rpmsack.py +index 229e1a1..270ade9 100644 +--- a/yum/rpmsack.py ++++ b/yum/rpmsack.py +@@ -1755,6 +1755,9 @@ class RPMDBAdditionalDataPackage(object): + 'group_member', + 'command_line']) + ++ # Validate these attributes when they are read from a file ++ _validators = {} ++ + def __init__(self, conf, pkgdir, yumdb_cache=None): + self._conf = conf + self._mydir = pkgdir +@@ -1903,6 +1906,15 @@ class RPMDBAdditionalDataPackage(object): + fo.close() + del fo + ++ # Validate the attribute we just read from the file. Some attributes ++ # may require being in a specific format and we can't guarantee the ++ # file has not been tampered with outside of yum. ++ if attr in self._validators: ++ valid = self._validators[attr] ++ if not valid(value): ++ raise AttributeError, \ ++ "Invalid value of attribute %s on %s" % (attr, self) ++ + if info.st_nlink > 1 and self._yumdb_cache is not None: + self._yumdb_cache[key] = value + self._auto_cache(attr, value, fn, info) +commit 6972a28059790177ab95e0bce92311aa882ae465 +Author: Michal Domonkos +Date: Tue Feb 16 13:53:04 2016 +0100 + + Don't crash on invalid from_repo in yumdb. BZ 1234967 + + Implement a yumdb validator function for the from_repo attribute. This + prevents yum from crashing if an implicit conversion to unicode takes + place somewhere and the attribute contains non-ascii chars due to some + yumdb corruption. + + Reproducers: + + $ yum install foo + $ yumdb set from_repo foo + $ yum list foo # crash + $ yum --disablerepo= reinstall foo # crash + $ yum --verbose version installed # crash + +diff --git a/yum/__init__.py b/yum/__init__.py +index 84bea3e..1f6ce16 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -95,7 +95,6 @@ from yum.rpmtrans import RPMTransaction,SimpleCliCallBack + from yum.i18n import to_unicode, to_str, exception2msg + from yum.drpm import DeltaInfo, DeltaPackage + +-import string + import StringIO + + from weakref import proxy as weakref +@@ -476,17 +475,7 @@ class YumBase(depsolve.Depsolve): + continue + + # Check the repo.id against the valid chars +- bad = None +- for byte in section: +- if byte in string.ascii_letters: +- continue +- if byte in string.digits: +- continue +- if byte in "-_.:": +- continue +- +- bad = byte +- break ++ bad = misc.validate_repoid(section) + + if bad: + self.logger.warning("Bad id for repo: %s, byte = %s %d" % +diff --git a/yum/misc.py b/yum/misc.py +index f72f028..345934b 100644 +--- a/yum/misc.py ++++ b/yum/misc.py +@@ -24,6 +24,7 @@ import bz2 + import gzip + import shutil + import urllib ++import string + _available_compression = ['gz', 'bz2'] + try: + import lzma +@@ -1248,3 +1249,12 @@ def filter_pkgs_repoid(pkgs, repoid): + continue + ret.append(pkg) + return ret ++ ++def validate_repoid(repoid): ++ """Return the first invalid char found in the repoid, or None.""" ++ allowed_chars = string.ascii_letters + string.digits + '-_.:' ++ for char in repoid: ++ if char not in allowed_chars: ++ return char ++ else: ++ return None +diff --git a/yum/rpmsack.py b/yum/rpmsack.py +index 270ade9..11814f1 100644 +--- a/yum/rpmsack.py ++++ b/yum/rpmsack.py +@@ -1756,7 +1756,10 @@ class RPMDBAdditionalDataPackage(object): + 'command_line']) + + # Validate these attributes when they are read from a file +- _validators = {} ++ _validators = { ++ # Fixes BZ 1234967 ++ 'from_repo': lambda repoid: misc.validate_repoid(repoid) is None, ++ } + + def __init__(self, conf, pkgdir, yumdb_cache=None): + self._conf = conf +commit c02805ed3b23f97843931e0784d2823b8024e441 +Author: Michal Domonkos +Date: Tue Feb 16 17:20:26 2016 +0100 + + docs: mention special case for unknown from_repo + +diff --git a/docs/yum.8 b/docs/yum.8 +index e428148..eb52fb7 100644 +--- a/docs/yum.8 ++++ b/docs/yum.8 +@@ -964,6 +964,8 @@ The format of the output of yum list is: + + name.arch [epoch:]version-release repo or @installed-from-repo + ++Note that if the repo cannot be determined, "installed" is printed instead. ++ + .IP "\fByum list [all | glob_exp1] [glob_exp2] [\&.\&.\&.]\fP" + List all available and installed packages\&. + .IP "\fByum list available [glob_exp1] [\&.\&.\&.]\fP" diff --git a/SOURCES/BZ-1235623-new-provides-realpath-file-search.patch b/SOURCES/BZ-1235623-new-provides-realpath-file-search.patch new file mode 100644 index 0000000..f837bf0 --- /dev/null +++ b/SOURCES/BZ-1235623-new-provides-realpath-file-search.patch @@ -0,0 +1,19 @@ +diff -up yum-3.4.3/yum/depsolve.py.old yum-3.4.3/yum/depsolve.py +--- yum-3.4.3/yum/depsolve.py.old 2016-03-21 15:27:30.107670469 +0100 ++++ yum-3.4.3/yum/depsolve.py 2016-03-21 15:32:38.931701401 +0100 +@@ -1271,7 +1271,14 @@ class Depsolve(object): + nprov = self.tsInfo.getNewProvides(filename) + if nprov: + iFP.setdefault(filename, []).extend([po.pkgtup for po in nprov]) +- continue ++ continue ++ ++ if filename != os.path.realpath(filename): ++ realpath = os.path.realpath(filename) ++ nprov = self.tsInfo.getNewProvides(realpath) ++ if nprov: ++ iFP.setdefault(realpath, []).extend([po.pkgtup for po in nprov]) ++ continue + + for pkgtup in reverselookup[filename]: + po = self.tsInfo.getMembersWithState(pkgtup, TS_INSTALL_STATES) diff --git a/SOURCES/BZ-1267234-groupinstall-fail-on-non-existent.patch b/SOURCES/BZ-1267234-groupinstall-fail-on-non-existent.patch new file mode 100644 index 0000000..aa508d2 --- /dev/null +++ b/SOURCES/BZ-1267234-groupinstall-fail-on-non-existent.patch @@ -0,0 +1,146 @@ +commit 7e7f374c1ac6984fc50726dd649c4f4c2f56266c +Author: Valentina Mukhamedzhanova +Date: Wed Jan 29 12:08:30 2014 -0500 + + Make 'yum install @group' give an error when trying to install a + non-existent group. + +diff --git a/cli.py b/cli.py +index c8884ae..eed63a2 100755 +--- a/cli.py ++++ b/cli.py +@@ -964,6 +964,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + else: + assert basecmd == 'install', basecmd + txmbrs = self.install(pattern=arg) ++ except yum.Errors.GroupInstallError, e: ++ self.verbose_logger.log(yum.logginglevels.INFO_2, e) + except yum.Errors.InstallError: + self.verbose_logger.log(yum.logginglevels.INFO_2, + _('No package %s%s%s available.'), +@@ -1922,6 +1924,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + for igrp in self.igroups.groups: + pkgs_used.extend(self._at_groupupgrade('@' + igrp)) + ++ done = False + for group_string in grouplist: + + grp_grp = True +@@ -1966,11 +1969,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + if not group_matched: + self.logger.error(_('Warning: group %s does not exist.'), group_string) + continue ++ done = True + + if not pkgs_used: + if self.conf.group_command == 'objects': + self.logger.critical(_("Maybe run: yum groups mark install (see man yum)")) +- return 0, [_('No packages in any requested group available to install or update')] ++ exit_status = 1 ++ if upgrade: ++ # upgrades don't fail ++ exit_status = 0 ++ if done: ++ # at least one group_string was a valid group ++ exit_status = 0 ++ return exit_status, [_('No packages in any requested group available to install or update')] + else: + return 2, [P_('%d package to Install', '%d packages to Install', len(pkgs_used)) % len(pkgs_used)] + +diff --git a/yum/Errors.py b/yum/Errors.py +index 70de539..2c2f022 100644 +--- a/yum/Errors.py ++++ b/yum/Errors.py +@@ -105,6 +105,9 @@ class GroupsError(YumBaseError): + class InstallError(YumBaseError): + pass + ++class GroupInstallError(InstallError): ++ pass ++ + class UpdateError(YumBaseError): + pass + +diff --git a/yum/__init__.py b/yum/__init__.py +index bbd20f3..b40c7e4 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -1158,8 +1158,7 @@ class YumBase(depsolve.Depsolve): + if hasattr(self, 'term'): + hibeg, hiend = self.term.MODE['bold'], self.term.MODE['normal'] + +- func(_("The program %s%s%s is found in the yum-utils package.") % +- (hibeg, prog, hiend)) ++ func(_("The program %s is found in the yum-utils package.") % self._try_bold(prog)) + + def buildTransaction(self, unfinished_transactions_check=True): + """Go through the packages in the transaction set, find them +@@ -4451,6 +4450,12 @@ much more problems). + if node == slow: + return None + ++ def _try_bold(self, string_): ++ """Attempt to make the string look bold in terminal.""" ++ if hasattr(self, 'term'): ++ return '%s%s%s' % (self.term.MODE['bold'], string_, self.term.MODE['normal']) ++ return string_ ++ + def _at_groupinstall(self, pattern, upgrade=False): + " Do groupinstall via. leading @ on the cmd line, for install." + assert pattern[0] == '@' +@@ -4464,42 +4469,31 @@ much more problems). + self.logger.warning(e) + return tx_return + ++ found = False + if group_string and group_string[0] == '^': + group_string = group_string[1:] + # Actually dealing with "environment groups". +- found = False + for env_grp in comps.return_environments(group_string): + found = True +- try: +- txmbrs = self.selectEnvironment(env_grp.environmentid, +- upgrade=upgrade) +- tx_return.extend(txmbrs) +- except yum.Errors.GroupsError: +- assert False, "Checked in for loop." +- continue +- if not found: +- self.logger.error(_('Warning: Environment group %s does not exist.'), +- group_string) +- return tx_return +- +- found = False +- for group in comps.return_groups(group_string): +- found = True +- try: ++ txmbrs = self.selectEnvironment(env_grp.environmentid, ++ upgrade=upgrade) ++ tx_return.extend(txmbrs) ++ else: ++ for group in comps.return_groups(group_string): ++ found = True + txmbrs = self.selectGroup(group.groupid, upgrade=upgrade) + tx_return.extend(txmbrs) +- except yum.Errors.GroupsError: +- assert False, "Checked in for loop." +- continue + if not found: +- self.logger.error(_('Warning: Package group %s does not exist.'), +- group_string) +- ++ raise Errors.GroupInstallError, _('Group %s does not exist.') % self._try_bold(group_string) + return tx_return + + def _at_groupupgrade(self, pattern): + " Do group upgrade via. leading @ on the cmd line, for update." +- return self._at_groupinstall(pattern, upgrade=True) ++ try: ++ return self._at_groupinstall(pattern, upgrade=True) ++ except Errors.GroupInstallError, e: ++ self.logger.warning(_('Warning: %s'), e) ++ return [] + + def _at_groupremove(self, pattern): + " Do groupremove via. leading @ on the cmd line, for remove." diff --git a/SOURCES/BZ-1267897-exclude-dups-from-security-updates.patch b/SOURCES/BZ-1267897-exclude-dups-from-security-updates.patch new file mode 100644 index 0000000..0039190 --- /dev/null +++ b/SOURCES/BZ-1267897-exclude-dups-from-security-updates.patch @@ -0,0 +1,22 @@ +diff -up yum-3.4.3/yum/updateinfo.py.old yum-3.4.3/yum/updateinfo.py +--- yum-3.4.3/yum/updateinfo.py.old 2016-03-22 12:12:51.413858074 +0100 ++++ yum-3.4.3/yum/updateinfo.py 2016-03-22 12:14:56.392798309 +0100 +@@ -411,13 +411,17 @@ def exclude_updates(base, filters=None): + name2tup = _get_name2oldpkgtup(base) + + cnt = 0 ++ pkgs_to_del = [] + for pkg in pkgs: + 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) ++ pkgs_to_del.append(pkg.name) + continue + cnt += 1 ++ if pkgs_to_del: ++ for p in base.doPackageLists(pkgnarrow='available', patterns=pkgs_to_del, showdups=True).available: ++ ysp_del_pkg(p) + + _ysp_chk_used_map(used_map, lambda x: base.verbose_logger.warn("%s", x)) + diff --git a/SOURCES/BZ-1272058-arches.patch b/SOURCES/BZ-1272058-arches.patch new file mode 100644 index 0000000..cb198b0 --- /dev/null +++ b/SOURCES/BZ-1272058-arches.patch @@ -0,0 +1,70 @@ +commit 13a1fddf27dd16a70b639630d209c0f16bd5097e +Author: Dennis Gilmore +Date: Wed Feb 12 18:12:54 2014 -0500 + + ppc64le is its own arch treat it as such. + + ppc64le is ppc64 little endian, it is a completely incompatable arch + to all other 64 bit power builds and can not be multilibbed with ppc. + While it works okay in the default Fedora setup its because Fedora + patches _ppc64_native_is_best to True as soon as its False you get + unexpected results. + This patch covers things in both setups and makes it clear how it + works. + + Signed-off-by: Dennis Gilmore + +diff --git a/rpmUtils/arch.py b/rpmUtils/arch.py +index 6172b1a..54fa189 100644 +--- a/rpmUtils/arch.py ++++ b/rpmUtils/arch.py +@@ -31,7 +31,10 @@ arches = { + "x86_64": "athlon", + "amd64": "x86_64", + "ia32e": "x86_64", +- ++ ++ #ppc64le ++ "ppc64le": "noarch", ++ + # ppc + "ppc64p7": "ppc64", + "ppc64pseries": "ppc64", +@@ -412,7 +415,7 @@ def getBestArch(myarch=None): + if arch.startswith("sparc64"): + arch = multilibArches[arch][1] + +- if arch.startswith("ppc64") and not _ppc64_native_is_best: ++ if arch.startswith("ppc64") and not _ppc64_native_is_best and arch != "ppc64le": + arch = 'ppc' + + return arch +@@ -430,6 +433,8 @@ def getBaseArch(myarch=None): + + if myarch.startswith("sparc64"): + return "sparc" ++ elif myarch == "ppc64le": ++ return "ppc64le" + elif myarch.startswith("ppc64") and not _ppc64_native_is_best: + return "ppc" + elif myarch.startswith("arm64"): +commit 1a1a33f195a6fb6e8738e48fcb6142c53a539b6d +Author: Valentina Mukhamedzhanova +Date: Tue Apr 5 14:54:05 2016 +0200 + + Add aarch64 to rpmUtils.arch.arches. + +diff --git a/rpmUtils/arch.py b/rpmUtils/arch.py +index a3bade5..d63ec25 100644 +--- a/rpmUtils/arch.py ++++ b/rpmUtils/arch.py +@@ -80,6 +80,9 @@ arches = { + # arm64 + "arm64": "noarch", + ++ # aarch64 ++ "aarch64": "noarch", ++ + # super-h + "sh4a": "sh4", + "sh4": "noarch", diff --git a/SOURCES/BZ-1274211-skip-missing-names.patch b/SOURCES/BZ-1274211-skip-missing-names.patch new file mode 100644 index 0000000..bf0ff88 --- /dev/null +++ b/SOURCES/BZ-1274211-skip-missing-names.patch @@ -0,0 +1,173 @@ +commit d4ff5427368977f74a8ba7b0be51752023592025 +Author: Valentina Mukhamedzhanova +Date: Wed Mar 16 16:22:34 2016 +0100 + + Add config options skip_missing_names_on_install and skip_missing_names_on_update. BZ#1274211 + +diff --git a/cli.py b/cli.py +index fd6e715..54a2e81 100755 +--- a/cli.py ++++ b/cli.py +@@ -982,6 +982,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + except: + self.verbose_logger.warning(_('Bad %s argument %s.'), + basecmd, arg) ++ if not self.conf.skip_missing_names_on_install: ++ return 1, [_('Not tolerating missing names on install, stopping.')] + continue + txmbrs = self.install(name=n, arch=a) + elif basecmd == 'install-nevra': +@@ -992,6 +994,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + except: + self.verbose_logger.warning(_('Bad %s argument %s.'), + basecmd, arg) ++ if not self.conf.skip_missing_names_on_install: ++ return 1, [_('Not tolerating missing names on install, stopping.')] + continue + txmbrs = self.install(name=n, + epoch=e, version=v, release=r, arch=a) +@@ -1000,12 +1004,16 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + txmbrs = self.install(pattern=arg) + except yum.Errors.GroupInstallError, e: + self.verbose_logger.log(yum.logginglevels.INFO_2, e) ++ if not self.conf.skip_missing_names_on_install: ++ return 1, [_('Not tolerating missing names on install, stopping.')] + except yum.Errors.InstallError: + self.verbose_logger.log(yum.logginglevels.INFO_2, + _('No package %s%s%s available.'), + self.term.MODE['bold'], arg, + self.term.MODE['normal']) + self._maybeYouMeant(arg) ++ if not self.conf.skip_missing_names_on_install: ++ return 1, [_('Not tolerating missing names on install, stopping.')] + else: + done = True + self._install_upgraded_requires(txmbrs) +@@ -1057,10 +1065,19 @@ class YumBaseCli(yum.YumBase, output.YumOutput): + self._install_upgraded_requires(txmbrs) + continue + +- txmbrs = self.update(pattern=item, update_to=update_to) ++ try: ++ txmbrs = self.update(pattern=item, update_to=update_to) ++ except (yum.Errors.UpdateMissingNameError, yum.Errors.GroupInstallError): ++ self._checkMaybeYouMeant(item) ++ return 1, [_('Not tolerating missing names on update, stopping.')] ++ + self._install_upgraded_requires(txmbrs) + if not txmbrs: + self._checkMaybeYouMeant(item) ++ if not self.conf.skip_missing_names_on_update: ++ matches = self.doPackageLists(pkgnarrow='all', patterns=[item], ignore_case=False) ++ if matches.available and not matches.installed: ++ return 1, [_('Not tolerating missing names on update, stopping.')] + + if len(self.tsInfo) > oldcount: + change = len(self.tsInfo) - oldcount +diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 +index 116829a..f823c6f 100644 +--- a/docs/yum.conf.5 ++++ b/docs/yum.conf.5 +@@ -945,6 +945,17 @@ Either `0' or `1'. Set this to `0' to disable the checking for writability on + /usr in the installroot (when going into the depsolving stage). Default is `1' + (perform the check). + ++.IP ++\fBskip_missing_names_on_install\fR ++If set to False, 'yum install' will fail if it can't find any of the provided ++names (package, group, rpm file). Boolean (1, 0, True, False, yes, no). Defaults to True. ++ ++.IP ++\fBskip_missing_names_on_update\fR ++If set to False, 'yum update' will fail if it can't find any of the provided ++names (package, group, rpm file). It will also fail if the provided name is a package ++which is available, but not installed. Boolean (1, 0, True, False, yes, no). Defaults to True. ++ + .SH "[repository] OPTIONS" + .LP + The repository section(s) take the following form: +diff --git a/test/testbase.py b/test/testbase.py +index 6d240b0..b303356 100644 +--- a/test/testbase.py ++++ b/test/testbase.py +@@ -46,6 +46,8 @@ class FakeConf(object): + self.tsflags = [] + self.installonly_limit = 0 + self.skip_broken = False ++ self.skip_missing_names_on_install = True ++ self.skip_missing_names_on_update = True + self.disable_excludes = [] + self.multilib_policy = 'best' + self.persistdir = '/should-not-exist-bad-test!' +diff --git a/yum/Errors.py b/yum/Errors.py +index f69c061..3f87b0b 100644 +--- a/yum/Errors.py ++++ b/yum/Errors.py +@@ -117,6 +117,9 @@ class GroupInstallError(InstallError): + + class UpdateError(YumBaseError): + pass ++ ++class UpdateMissingNameError(UpdateError): ++ pass + + class RemoveError(YumBaseError): + pass +diff --git a/yum/__init__.py b/yum/__init__.py +index 1f6ce16..acaa973 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -4581,7 +4581,10 @@ much more problems). + return self._at_groupinstall(pattern, upgrade=True) + except Errors.GroupInstallError, e: + self.logger.warning(_('Warning: %s'), e) +- return [] ++ if self.conf.skip_missing_names_on_update: ++ return [] ++ else: ++ raise + + def _at_groupremove(self, pattern): + " Do groupremove via. leading @ on the cmd line, for remove." +@@ -5185,6 +5188,8 @@ much more problems). + + if not availpkgs and not instpkgs: + self.logger.critical(_('No Match for argument: %s') % to_unicode(arg)) ++ if not self.conf.skip_missing_names_on_update: ++ raise Errors.UpdateMissingNameError, _('Not tolerating missing names on update, stopping.') + + else: # we have kwargs, sort them out. + nevra_dict = self._nevra_kwarg_parse(kwargs) +diff --git a/yum/config.py b/yum/config.py +index 6bd8d24..954700b 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -729,6 +729,8 @@ class StartupConf(BaseConfig): + syslog_facility = Option('LOG_USER') + syslog_device = Option('/dev/log') + persistdir = Option('/var/lib/yum') ++ skip_missing_names_on_install = BoolOption(True) ++ skip_missing_names_on_update = BoolOption(True) + + class YumConf(StartupConf): + """Configuration option definitions for yum.conf's [main] section. +commit be18ab78927522db11cfae5e4f270b073ed1df0b +Author: Valentina Mukhamedzhanova +Date: Wed Mar 16 16:16:49 2016 +0100 + + Fix returnPackages() to respect ignore_case. + +diff --git a/yum/rpmsack.py b/yum/rpmsack.py +index 11814f1..0990edd 100644 +--- a/yum/rpmsack.py ++++ b/yum/rpmsack.py +@@ -607,6 +607,9 @@ class RPMDBPackageSack(PackageSackBase): + # will pick up any loads :) + pkgs = self.searchNames([pat]) + if not pkgs: ++ # We could be given gliBc or mysql ++ if ignore_case: ++ break + # We need to do a big search for 'pkg*' + if misc.re_glob(pat): + break diff --git a/SOURCES/BZ-1279483-hidden-groups-manpage.patch b/SOURCES/BZ-1279483-hidden-groups-manpage.patch new file mode 100644 index 0000000..1ba61ba --- /dev/null +++ b/SOURCES/BZ-1279483-hidden-groups-manpage.patch @@ -0,0 +1,19 @@ +commit 4690124107fa99ff18bb77a1f19665edbfedd588 +Author: Valentina Mukhamedzhanova +Date: Tue Apr 5 15:05:27 2016 +0200 + + Clarify using 'group list' command for hidden groups in the man page. + +diff --git a/docs/yum.8 b/docs/yum.8 +index b837f9f..9c09c48 100644 +--- a/docs/yum.8 ++++ b/docs/yum.8 +@@ -283,6 +283,8 @@ default package are installed (when not in group_command=objects mode). + You can pass optional arguments to the list/summary commands: installed, + available, environment, language, packages, hidden and ids (or any of those + prefixed by "no" to turn them off again). ++Note that groups that are available but hidden will not be listed unless ++\'hidden\' keyword is passed to the command. + If you pass the \-v option, to enable verbose mode, then the groupids are + displayed by default (but "yum group list ids" is often easier to read). + diff --git a/SOURCES/BZ-1281593-yum-fs-vars.patch b/SOURCES/BZ-1281593-yum-fs-vars.patch new file mode 100644 index 0000000..94f2df7 --- /dev/null +++ b/SOURCES/BZ-1281593-yum-fs-vars.patch @@ -0,0 +1,143 @@ +commit 22271bf34e71bbfc75d0a59354fc0108e004f36c +Author: James Antill +Date: Mon Jun 9 16:09:32 2014 -0400 + + Read FS yumvars before yum.conf setup, and reread if installroot changed. + +diff --git a/yum/config.py b/yum/config.py +index 6e0ecdc..1b5a11d 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -1022,6 +1022,23 @@ class VersionGroupConf(BaseConfig): + pkglist = ListOption() + run_with_packages = BoolOption(False) + ++def _read_yumvars(yumvars, root): ++ # Read the FS yumvars ++ try: ++ dir_fsvars = root + "/etc/yum/vars/" ++ fsvars = os.listdir(dir_fsvars) ++ except OSError: ++ fsvars = [] ++ for fsvar in fsvars: ++ if os.path.islink(dir_fsvars + fsvar): ++ continue ++ try: ++ val = open(dir_fsvars + fsvar).readline() ++ if val and val[-1] == '\n': ++ val = val[:-1] ++ except (OSError, IOError): ++ continue ++ yumvars[fsvar] = val + + def readStartupConfig(configfile, root, releasever=None): + """Parse Yum's main configuration file and return a +@@ -1044,6 +1061,7 @@ def readStartupConfig(configfile, root, releasever=None): + confpp_obj = ConfigPreProcessor(configfile) + + yumvars = _getEnvVar() ++ _read_yumvars(yumvars, yumconf.installroot) + confpp_obj._vars = yumvars + startupconf.yumvars = yumvars + +@@ -1102,22 +1120,12 @@ def readMainConfig(startupconf): + ir_path = varReplace(ir_path, yumvars) + setattr(yumconf, option, ir_path) + +- # Read the FS yumvars +- try: +- dir_fsvars = yumconf.installroot + "/etc/yum/vars/" +- fsvars = os.listdir(dir_fsvars) +- except OSError: +- fsvars = [] +- for fsvar in fsvars: +- if os.path.islink(dir_fsvars + fsvar): +- continue +- try: +- val = open(dir_fsvars + fsvar).readline() +- if val and val[-1] == '\n': +- val = val[:-1] +- except (OSError, IOError): +- continue +- yumvars[fsvar] = val ++ if StartupConf.installroot.default != yumconf.installroot: ++ # Note that this isn't perfect, in that if the initial installroot has ++ # X=Y, and X doesn't exist in the new installroot ... then we'll still ++ # have X afterwards (but if the new installroot has X=Z, that will be ++ # the value after this). ++ _read_yumvars(yumvars, yumconf.installroot) + + # These can use the above FS yumvars + for option in ('cachedir', 'logfile', 'persistdir'): +commit 1ccd91f4b195737d6bb1bdfabcbf3714de1d9b85 +Author: James Antill +Date: Mon Jun 16 15:16:25 2014 -0400 + + Fix merge typo. with FS vars. before yum.conf + +diff --git a/yum/config.py b/yum/config.py +index 1b5a11d..8eab5bc 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -1061,7 +1061,7 @@ def readStartupConfig(configfile, root, releasever=None): + confpp_obj = ConfigPreProcessor(configfile) + + yumvars = _getEnvVar() +- _read_yumvars(yumvars, yumconf.installroot) ++ _read_yumvars(yumvars, startupconf.installroot) + confpp_obj._vars = yumvars + startupconf.yumvars = yumvars + +commit 6148c8a10b22763592c141ce9ee6d85dce5816f7 +Author: Michal Domonkos +Date: Thu Apr 21 16:08:19 2016 +0200 + + Honor FS yumvars over defaults for special vars. BZ 1327561 + + This fixes up commit 22271bf, which caused FS yumvars like $releasever + to be unintentionally replaced by the default values (unless the + installroot was redefined by yumconf, which caused us to reread them). + +diff --git a/yum/config.py b/yum/config.py +index 954700b..2ef5fa4 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -1114,12 +1114,12 @@ def readMainConfig(startupconf): + + # ' xemacs syntax hack + +- # Set up substitution vars ++ # Set up substitution vars but make sure we always prefer FS yumvars + yumvars = startupconf.yumvars +- yumvars['basearch'] = startupconf.basearch +- yumvars['arch'] = startupconf.arch +- yumvars['releasever'] = startupconf.releasever +- yumvars['uuid'] = startupconf.uuid ++ yumvars.setdefault('basearch', startupconf.basearch) ++ yumvars.setdefault('arch', startupconf.arch) ++ yumvars.setdefault('releasever', startupconf.releasever) ++ yumvars.setdefault('uuid', startupconf.uuid) + # Note: We don't setup the FS yumvars here, because we want to be able to + # use the core yumvars in persistdir. Which is the base of FS yumvars. + +commit 1897df3c1477afd8f221833120092f35c26f5a9d +Author: Michal Domonkos +Date: Thu Apr 21 16:23:47 2016 +0200 + + Cosmetic: remove outdated comment + + It was no longer true after commit ade6d16. + +diff --git a/yum/config.py b/yum/config.py +index 2ef5fa4..84be564 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -1120,8 +1120,6 @@ def readMainConfig(startupconf): + yumvars.setdefault('arch', startupconf.arch) + yumvars.setdefault('releasever', startupconf.releasever) + yumvars.setdefault('uuid', startupconf.uuid) +- # Note: We don't setup the FS yumvars here, because we want to be able to +- # use the core yumvars in persistdir. Which is the base of FS yumvars. + + # Read [main] section + yumconf = YumConf() diff --git a/SOURCES/BZ-1291745-query-install-excludes.patch b/SOURCES/BZ-1291745-query-install-excludes.patch new file mode 100644 index 0000000..610c1c3 --- /dev/null +++ b/SOURCES/BZ-1291745-query-install-excludes.patch @@ -0,0 +1,32 @@ +commit cc08cae08365d473d2ab5b29cd1ab4fedc8d0f75 +Author: Valentina Mukhamedzhanova +Date: Tue Dec 15 15:01:23 2015 +0100 + + Fix the default value for query_install_excludes config option. + +diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 +index 0548860..27620b8 100644 +--- a/docs/yum.conf.5 ++++ b/docs/yum.conf.5 +@@ -174,7 +174,7 @@ A way to permanently set the --disableexcludes command line option. + \fBquery_install_excludes\fR + This applies the command line exclude option (only, not the configuration + exclude above) to installed packages being shown in some query commands +-(currently: list/info/search/provides). ++(currently: list/info/search/provides). Default is '0'. + + .IP + \fBinstallonlypkgs \fR +diff --git a/yum/config.py b/yum/config.py +index 0dcbc6a..77a1003 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -826,7 +826,7 @@ class YumConf(StartupConf): + # XXX rpm_check_debug is unused, left around for API compatibility for now + rpm_check_debug = BoolOption(True) + disable_excludes = ListOption() +- query_install_excludes = BoolOption(True) ++ query_install_excludes = BoolOption(False) + skip_broken = BoolOption(False) + # Note that "instant" is the old behaviour, but group:primary is very + # similar but better :). diff --git a/SOURCES/BZ-1292087-history-hash-crash.patch b/SOURCES/BZ-1292087-history-hash-crash.patch new file mode 100644 index 0000000..3c6b838 --- /dev/null +++ b/SOURCES/BZ-1292087-history-hash-crash.patch @@ -0,0 +1,23 @@ +commit 8ae3ad9a8bb297c39bc287802b3220e497dfbbcc +Author: Michal Domonkos +Date: Thu Apr 14 13:36:02 2016 +0200 + + Make YumHistoryRpmdbProblem objects hashable. BZ 1292087 + + Let's use rpid for that to ensure we get the same hash value for objects + that compare equal (which is iff their rpid's match, see __cmp__). + +diff --git a/yum/history.py b/yum/history.py +index d08837c..f1295de 100644 +--- a/yum/history.py ++++ b/yum/history.py +@@ -244,6 +244,9 @@ class YumHistoryRpmdbProblem: + ret = cmp(self.rpid, other.rpid) + return ret + ++ def __hash__(self): ++ return hash(self.rpid) ++ + def _getProbPkgs(self): + if self._loaded_P is None: + self._loaded_P = sorted(self._history._old_prob_pkgs(self.rpid)) diff --git a/SOURCES/BZ-1292150-updateinfo-list-available.patch b/SOURCES/BZ-1292150-updateinfo-list-available.patch new file mode 100644 index 0000000..16bcf34 --- /dev/null +++ b/SOURCES/BZ-1292150-updateinfo-list-available.patch @@ -0,0 +1,82 @@ +commit 8ccc79d82bf0894def61cd2643d63e4adf3dcd02 +Author: Valentina Mukhamedzhanova +Date: Wed Dec 16 15:31:15 2015 +0100 + + Fix 'updateinfo list available' logic and make 'updates' the default + +diff --git a/docs/yum.8 b/docs/yum.8 +index 99862fa..e428148 100644 +--- a/docs/yum.8 ++++ b/docs/yum.8 +@@ -630,20 +630,19 @@ to your machine (including anything installed, if you supply "all"). + .br + + .br +-.I \fR "\fB* all\fP" +-Is used to display information about both install and available advisories. +-.br +-.I \fR "\fB* available\fP" +-Is used to display information about just available advisories. This is the +-default. ++.I \fR "\fB* updates\fP" ++Is used to display information about advisories for packages that can be ++updated. This is the default. + .br + .I \fR "\fB* installed\fP" +-Is used to display information about just install advisories. ++Is used to display information only about installed advisories. + .br +-.I \fR "\fB* updates\fP" +-This is mostly the same as "available" but it only shows advisory information +-for packages that can be updated to. +- ++.I \fR "\fB* available\fP" ++Is used to display information about advisories for packages available ++for updating or installation. ++.br ++.I \fR "\fB* all\fP" ++Is used to display information about both installed and available advisories. + + .br + They all take as arguments: +diff -up yum-3.4.3/yumcommands.py.old yum-3.4.3/yumcommands.py +--- yum-3.4.3/yumcommands.py.old 2016-03-22 12:22:54.398569730 +0100 ++++ yum-3.4.3/yumcommands.py 2016-03-22 12:27:30.261523615 +0100 +@@ -4072,6 +4072,7 @@ class UpdateinfoCommand(YumCommand): + extcmds, show_type, filt_type = self._parse_extcmds(extcmds) + + list_type = "available" ++ list_type = "updates" + if extcmds and extcmds[0] in ("updates","available","installed", "all"): + list_type = extcmds.pop(0) + if filt_type is None: +@@ -4087,13 +4088,15 @@ class UpdateinfoCommand(YumCommand): + used_map = _upi._ysp_gen_used_map(base.updateinfo_filters) + iname2tup = {} + if False: pass +- elif list_type in ('installed', 'all'): ++ elif list_type == 'installed': + name2tup = _upi._get_name2allpkgtup(base) + iname2tup = _upi._get_name2instpkgtup(base) + elif list_type == 'updates': + name2tup = _upi._get_name2oldpkgtup(base) +- elif list_type == 'available': +- name2tup = _upi._get_name2instpkgtup(base) ++ elif list_type in ('available', 'all'): ++ name2tup = _upi._get_name2aallpkgtup(base) ++ iname2tup = _upi._get_name2instpkgtup(base) ++ + + def _show_pkgtup(pkgtup): + name = pkgtup[0] +@@ -4106,6 +4109,10 @@ class UpdateinfoCommand(YumCommand): + # Remove any that are newer than what we have installed + if _upi._rpm_tup_vercmp(iname2tup[name], pkgtup) < 0: + continue ++ if list_type == 'available': ++ # Remove any that are installed ++ if name in iname2tup and _upi._rpm_tup_vercmp(iname2tup[name], pkgtup) >= 0: ++ continue + + if _upi._ysp_should_filter_pkg(opts, name, notice, used_map): + yield (pkgtup, notice) diff --git a/SOURCES/BZ-1292160-security-lists-wrong-arch-updates.patch b/SOURCES/BZ-1292160-security-lists-wrong-arch-updates.patch new file mode 100644 index 0000000..58974a8 --- /dev/null +++ b/SOURCES/BZ-1292160-security-lists-wrong-arch-updates.patch @@ -0,0 +1,38 @@ +commit 6b25184fcd5634d0abcdda0ed77e75a38a0d5186 +Author: Valentina Mukhamedzhanova +Date: Wed Dec 16 16:28:48 2015 +0100 + + Fix updateinfo to exclude wrong arch updates + +diff --git a/yum/updateinfo.py b/yum/updateinfo.py +index 59374af..3e6395e 100644 +--- a/yum/updateinfo.py ++++ b/yum/updateinfo.py +@@ -401,24 +401,17 @@ def exclude_updates(base, filters=None): + + used_map = _ysp_gen_used_map(opts) + +- # In theory the official API is: +- # +- # pkgs = base.pkgSack.returnPackages() +- # +- # ...however that is _extremely_ slow, deleting all packages. So we ask +- # for the list of update packages, which is all we care about. + upds = base.doPackageLists(pkgnarrow='updates') +- pkgs = upds.updates ++ tot = len(upds.updates) + # In theory we don't need to do this in some cases, but meh. + upds = base.doPackageLists(pkgnarrow='obsoletes') +- pkgs += upds.obsoletes ++ tot += len(upds.obsoletes) + ++ pkgs = conduit.getPackages() + name2tup = _get_name2oldpkgtup(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)): diff --git a/SOURCES/BZ-1293378-ftp-disable-epsv.patch b/SOURCES/BZ-1293378-ftp-disable-epsv.patch new file mode 100644 index 0000000..ed6e3c2 --- /dev/null +++ b/SOURCES/BZ-1293378-ftp-disable-epsv.patch @@ -0,0 +1,66 @@ +commit 8b41b097716abde0b4ad9af4e813da9e3ed6620b +Author: Valentina Mukhamedzhanova +Date: Mon Dec 21 16:29:34 2015 +0100 + + Add ftp_disable_epsv config option + +diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 +index 27620b8..116829a 100644 +--- a/docs/yum.conf.5 ++++ b/docs/yum.conf.5 +@@ -439,6 +439,11 @@ default of 5 connections. Note that there are also implicit per-mirror limits + and the downloader honors these too. + + .IP ++\fBftp_disable_epsv \fR ++This options disables Extended Passive Mode (the EPSV command) which does not ++work correctly on some buggy ftp servers. Default is `0' (EPSV enabled). ++ ++.IP + \fBdeltarpm\fR + + When non-zero, delta-RPM files are used if available. The value specifies +@@ -1114,6 +1119,11 @@ Overrides the \fBip_resolve\fR option from the [main] section for this + repository. + + .IP ++\fBftp_disable_epsv\fR ++Overrides the \fBftp_disable_epsv\fR option from the [main] section ++for this repository. ++ ++.IP + \fBdeltarpm_percentage\fR + Overrides the \fBdeltarpm_percentage\fR option from the [main] section + for this repository. +diff --git a/yum/config.py b/yum/config.py +index 77a1003..6bd8d24 100644 +--- a/yum/config.py ++++ b/yum/config.py +@@ -811,6 +811,7 @@ class YumConf(StartupConf): + allowed = ('ipv4', 'ipv6', 'whatever'), + mapper = {'4': 'ipv4', '6': 'ipv6'}) + max_connections = IntOption(0, range_min=0) ++ ftp_disable_epsv = BoolOption(False) + deltarpm = IntOption(2, range_min=-16, range_max=128) + deltarpm_percentage = IntOption(75, range_min=0, range_max=100) + deltarpm_metadata_percentage = IntOption(100, range_min=0) +@@ -1003,6 +1004,7 @@ class RepoConf(BaseConfig): + # Rely on the above config. to do automatic disabling, and thus. no hack + # needed here. + deltarpm_metadata_percentage = Inherit(YumConf.deltarpm_metadata_percentage) ++ ftp_disable_epsv = Inherit(YumConf.ftp_disable_epsv) + + http_caching = Inherit(YumConf.http_caching) + metadata_expire = Inherit(YumConf.metadata_expire) +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index 3dd0646..fc5d538 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -675,6 +675,7 @@ class YumRepository(Repository, config.RepoConf): + 'user_agent': default_grabber.opts.user_agent, + 'username': self.username, + 'password': self.password, ++ 'ftp_disable_epsv': self.ftp_disable_epsv, + } + if self.proxy == 'libproxy': + opts['libproxy'] = True diff --git a/SOURCES/BZ-1293513-compdir.patch b/SOURCES/BZ-1293513-compdir.patch new file mode 100644 index 0000000..4b1c705 --- /dev/null +++ b/SOURCES/BZ-1293513-compdir.patch @@ -0,0 +1,11 @@ +diff -up yum-3.4.3/etc/Makefile.old yum-3.4.3/etc/Makefile +--- yum-3.4.3/etc/Makefile.old 2016-05-11 15:13:20.615716472 +0200 ++++ yum-3.4.3/etc/Makefile 2016-05-11 15:13:35.308778357 +0200 +@@ -1,6 +1,5 @@ + YUMETC=$(DESTDIR)/etc/yum +-compdir = $(shell pkg-config --variable=completionsdir bash-completion) +-compdir := $(or $(compdir), "/etc/bash_completion.d") ++compdir := $(or $(COMPDIR), "/etc/bash_completion.d") + + all: + echo "Nothing to do" diff --git a/SOURCES/BZ-1293670-proxy.patch b/SOURCES/BZ-1293670-proxy.patch new file mode 100644 index 0000000..737d65d --- /dev/null +++ b/SOURCES/BZ-1293670-proxy.patch @@ -0,0 +1,24 @@ +diff -up yum-3.2.29/yum/config.py.old yum-3.2.29/yum/config.py +--- yum-3.2.29/yum/config.py.old 2015-12-22 16:33:42.907483221 +0100 ++++ yum-3.2.29/yum/config.py 2015-12-22 16:34:15.329584138 +0100 +@@ -202,7 +202,7 @@ class UrlOption(Option): + # Handle the "_none_" special case + if url.lower() == '_none_': + if self.allow_none: +- return None ++ return '_none_' + else: + raise ValueError('"_none_" is not a valid value') + +diff -up yum-3.2.29/yum/yumRepo.py.old yum-3.2.29/yum/yumRepo.py +--- yum-3.2.29/yum/yumRepo.py.old 2015-12-22 16:35:08.330749108 +0100 ++++ yum-3.2.29/yum/yumRepo.py 2015-12-22 16:36:37.668027178 +0100 +@@ -432,7 +432,7 @@ class YumRepository(Repository, config.R + self._proxy_dict = {} # zap it + proxy_string = None + empty = (None, '_none_', '') +- if self.proxy is None: # got 'proxy=_none_' ++ if self.proxy in empty: # got 'proxy=_none_' + proxy_string = '' # this disables default proxies + elif self.proxy: + proxy_string = '%s' % self.proxy diff --git a/SOURCES/BZ-1294789-yum-cron-fix-update_cmd.patch b/SOURCES/BZ-1294789-yum-cron-fix-update_cmd.patch new file mode 100644 index 0000000..b3bc7f0 --- /dev/null +++ b/SOURCES/BZ-1294789-yum-cron-fix-update_cmd.patch @@ -0,0 +1,49 @@ +From ec2269ad7cbdbbd674d4fdbf5c670e43c937c2a6 Mon Sep 17 00:00:00 2001 +From: Michal Domonkos +Date: Tue, 2 Feb 2016 10:44:04 +0100 +Subject: [PATCH] yum-cron: fix the parsing of update_cmd. BZ 1294789 + +This fixes the case when {minimal-}security-severity is used as +update_cmd in the conf file. Previously, the method would incorrectly +handle those two cases the same way as "default". +--- + yum-cron/yum-cron.py | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py +index 20911af..039f537 100755 +--- a/yum-cron/yum-cron.py ++++ b/yum-cron/yum-cron.py +@@ -427,24 +427,23 @@ class YumCronBase(yum.YumBase, YumOutput): + self.updateinfo_filters['sevs'] = sevs.split(",") + + +- if self.opts.update_cmd in ('minimal', 'minimal-security'): ++ if update_cmd in ('minimal', 'minimal-security'): + if not yum.updateinfo.update_minimal(self): + return False + self.updateinfo_filters['bugfix'] = True +- elif self.opts.update_cmd in ('default', 'security', +- 'default-security'): ++ elif update_cmd in ('default', 'security', 'default-security'): + if not self.update(): + return False + else: + # return False ? +- self.opts.update_cmd = 'default' ++ update_cmd = 'default' + if not self.update(): + return False + +- if self.opts.update_cmd.endswith("security"): ++ if update_cmd.endswith("security"): + self.updateinfo_filters['security'] = True + yum.updateinfo.remove_txmbrs(self) +- elif self.opts.update_cmd == 'minimal': ++ elif update_cmd == 'minimal': + self.updateinfo_filters['bugfix'] = True + yum.updateinfo.remove_txmbrs(self) + +-- +2.5.0 + diff --git a/SOURCES/BZ-1306142-allow-older-installonly-deps.patch b/SOURCES/BZ-1306142-allow-older-installonly-deps.patch new file mode 100644 index 0000000..32126f6 --- /dev/null +++ b/SOURCES/BZ-1306142-allow-older-installonly-deps.patch @@ -0,0 +1,86 @@ +commit afac6a760b97b7dd71c06c00a4716d3212f6884c +Author: Masahiro Matsuya +Date: Wed Apr 20 10:16:10 2016 +0200 + + Cope with older installonly packages from deps. BZ 1306142 + + We have been doing this with explicitly installed packages but not for + their dependencies, so let's do it after depsolving again to cover those + too. + +diff --git a/test/operationstests.py b/test/operationstests.py +index 5a50439..bd999e6 100644 +--- a/test/operationstests.py ++++ b/test/operationstests.py +@@ -1,3 +1,4 @@ ++import rpm + from testbase import * + import simpleobsoletestests + +@@ -142,6 +143,17 @@ class KernelTests(OperationsTests): + res, msg = self.runOperation(['install','kernel-2.6.23.8'], p.inst, p.avail) + self.assertResult(p.inst) + ++ def testRequireOlderKernel(self): ++ p = self.pkgs ++ ++ foo = FakePackage('foo', '1.0', '1', arch='i686') ++ foo.addRequires('kernel', 'EQ', (None, '2.6.23.5', '1')) ++ navail = [foo, FakePackage('kernel', '2.6.23.5', '1',arch='i686')] ++ ++ res, msg = self.runOperation(['install', 'foo'], p.inst, navail) ++ self.assertResult(p.inst + navail) ++ self.assertEquals(self.tsInfo.probFilterFlags, [rpm.RPMPROB_FILTER_OLDPACKAGE]) ++ + class MultiLibTests(OperationsTests): + + @staticmethod +diff --git a/yum/__init__.py b/yum/__init__.py +index acaa973..c896fff 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -1356,6 +1356,17 @@ much more problems). + + if rescode == 2: + self.save_ts(auto=True) ++ ++ # Make sure we don't fail in rpm if we're installing a package that is ++ # allowed multiple installs but has a newer version already installed. ++ # Note that we already have a similar check in install(), but here we ++ # do it to cover anything that was pulled in as a dependency. ++ if rpm.RPMPROB_FILTER_OLDPACKAGE not in self.tsInfo.probFilterFlags: ++ for m in self.tsInfo.getMembers(): ++ if m.ts_state == 'i' and self.allowedMultipleInstalls(m.po): ++ if self._enable_oldpackage_flag(m.po): ++ break ++ + self.verbose_logger.debug('Depsolve time: %0.3f' % (time.time() - ds_st)) + return rescode, restring + +@@ -4674,6 +4685,14 @@ much more problems). + if flag not in self.tsInfo.probFilterFlags: + self.tsInfo.probFilterFlags.append(flag) + ++ def _enable_oldpackage_flag(self, po): ++ """Add RPMPROB_FILTER_OLDPACKAGE if the package requires it.""" ++ for ipkg in self.rpmdb.searchNevra(name=po.name): ++ if ipkg.verGT(po) and not canCoinstall(ipkg.arch, po.arch): ++ self._add_prob_flags(rpm.RPMPROB_FILTER_OLDPACKAGE) ++ return True ++ return False ++ + def _install_is_upgrade(self, po, ipkgs): + """ See if po is an upgradeable version of an installed pkg. + Non-compat. arch differences mean no. """ +@@ -4969,10 +4988,7 @@ much more problems). + # and a remove, which also tries to remove the old version. + self.tsInfo.remove(ipkg.pkgtup) + break +- for ipkg in self.rpmdb.searchNevra(name=po.name): +- if ipkg.verGT(po) and not canCoinstall(ipkg.arch, po.arch): +- self._add_prob_flags(rpm.RPMPROB_FILTER_OLDPACKAGE) +- break ++ self._enable_oldpackage_flag(po) + + # it doesn't obsolete anything. If it does, mark that in the tsInfo, too + obs_pkgs = list(self._find_obsoletees_direct(po)) diff --git a/SOURCES/BZ-1309676-fs-command-help-fix.patch b/SOURCES/BZ-1309676-fs-command-help-fix.patch new file mode 100644 index 0000000..b694ebc --- /dev/null +++ b/SOURCES/BZ-1309676-fs-command-help-fix.patch @@ -0,0 +1,19 @@ +commit f1766901d3192df6af77de0d0aee027cd9ebae3b +Author: James Antill +Date: Fri Apr 11 01:23:31 2014 -0400 + + Fix summary for yum fs command. BZ 1086461. + +diff --git a/yumcommands.py b/yumcommands.py +index 8ee2650..74e4d86 100644 +--- a/yumcommands.py ++++ b/yumcommands.py +@@ -4324,7 +4324,7 @@ class FSCommand(YumCommand): + return "[]" + + def getSummary(self): +- return _("Creates filesystem snapshots, or lists/deletes current snapshots.") ++ return _("Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts.") + + def doCheck(self, base, basecmd, extcmds): + """Verify that conditions are met so that this command can run. diff --git a/SOURCES/BZ-1321651-repoinfo-add-metadata-expire-filter.patch b/SOURCES/BZ-1321651-repoinfo-add-metadata-expire-filter.patch new file mode 100644 index 0000000..035d95a --- /dev/null +++ b/SOURCES/BZ-1321651-repoinfo-add-metadata-expire-filter.patch @@ -0,0 +1,47 @@ +commit 36a49290d73951bd92dd0b2db877d11db2a3276f +Author: Michal Domonkos +Date: Mon Apr 25 17:09:25 2016 +0200 + + Add metadata_expire_filter to repoinfo output. BZ 1321651 + +diff --git a/yumcommands.py b/yumcommands.py +index 7118f3b..618ae5c 100644 +--- a/yumcommands.py ++++ b/yumcommands.py +@@ -2325,7 +2325,10 @@ class RepoListCommand(YumCommand): + num = _num2ui_num(repo.metadata_expire) + num = _("%s second(s) (last: %s)") % (num, last) + +- out += [base.fmtKeyValFill(_("Repo-expire : "), num)] ++ out += [base.fmtKeyValFill(_("Repo-expire : "), num), ++ base.fmtKeyValFill(_(" Filter : "), ++ repo.metadata_expire_filter), ++ ] + + if repo.exclude: + out += [base.fmtKeyValFill(_("Repo-exclude : "), + +commit e2db41de3d19cbd8c94a1c3824b541dbd4b706bb +Author: Michal Domonkos +Date: Mon Apr 25 15:12:23 2016 +0200 + + docs: add a freshness note for metadata_expire_filter + +diff --git a/docs/yum.conf.5 b/docs/yum.conf.5 +index f823c6f..efc6765 100644 +--- a/docs/yum.conf.5 ++++ b/docs/yum.conf.5 +@@ -646,7 +646,12 @@ Eg. yum list yum + `read-only:future' - Commands that are likely to result in running other + commands which will require the latest metadata. Eg. yum check-update + +-Note that this option does not override "yum clean expire-cache". ++Note that this option requires that all the enabled repositories be roughly the ++same freshness (meaning the cache age difference from one another is at most 5 ++days). Failing that, metadata_expire will always be obeyed, just like with ++`never'. ++ ++Also note that this option does not override "yum clean expire-cache". + + .IP + \fBmirrorlist_expire \fR diff --git a/SOURCES/BZ-1327962-conduit-typo.patch b/SOURCES/BZ-1327962-conduit-typo.patch new file mode 100644 index 0000000..0528255 --- /dev/null +++ b/SOURCES/BZ-1327962-conduit-typo.patch @@ -0,0 +1,19 @@ +commit 4474b17efc7acaa57217389cccdc36d706fdfae9 +Author: Valentina Mukhamedzhanova +Date: Fri May 6 11:08:14 2016 +0200 + + Fix a typo in exclude_updates(). + +diff --git a/yum/updateinfo.py b/yum/updateinfo.py +index dad6996..2b39330 100644 +--- a/yum/updateinfo.py ++++ b/yum/updateinfo.py +@@ -407,7 +407,7 @@ def exclude_updates(base, filters=None): + upds = base.doPackageLists(pkgnarrow='obsoletes') + tot += len(upds.obsoletes) + +- pkgs = conduit.getPackages() ++ pkgs = base.pkgSack.returnPackages() + name2tup = _get_name2oldpkgtup(base) + + cnt = 0 diff --git a/SOURCES/BZ-1328023-updateinfo-traceback.patch b/SOURCES/BZ-1328023-updateinfo-traceback.patch new file mode 100644 index 0000000..c168c77 --- /dev/null +++ b/SOURCES/BZ-1328023-updateinfo-traceback.patch @@ -0,0 +1,75 @@ +commit f2fc1ef96b0de995e2a61bf219b5d2c1d5a09503 +Author: Valentina Mukhamedzhanova +Date: Wed Mar 5 17:49:02 2014 +0100 + + Fix 'yum updateinfo list all new-packages' traceback. BZ 1072945 + + And make 'list' and 'info' indicate if the package is installed. + +diff --git a/yumcommands.py b/yumcommands.py +index 74e4333..4e72a71 100644 +--- a/yumcommands.py ++++ b/yumcommands.py +@@ -3840,7 +3840,7 @@ class UpdateinfoCommand(YumCommand): + mark = '' + if list_type == 'all': + mark = ' ' +- if _upi._rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: ++ if pkgtup[0] in iname2tup and _upi._rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: + mark = 'i ' + tn = notice['type'] + if tn == 'security' and notice['severity']: +@@ -3879,7 +3879,7 @@ class UpdateinfoCommand(YumCommand): + obj = notice.__str__() + + if list_type == 'all': +- if _upi._rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: ++ if pkgtup[0] in iname2tup and _upi._rpm_tup_vercmp(iname2tup[pkgtup[0]], pkgtup) >= 0: + obj = obj + "\n Installed : true" + else: + obj = obj + "\n Installed : false" +@@ -4029,7 +4029,7 @@ class UpdateinfoCommand(YumCommand): + return 0, [basecmd + ' ' + subcommand + ' done'] + + def doCommand_li_new(self, base, list_type, extcmds, md_info, msg, +- show_pkgs): ++ show_pkgs, iname2tup): + done_pkgs = set() + data = [] + for (notice, pkgtup) in sorted(self._get_new_pkgs(md_info), +@@ -4055,7 +4055,7 @@ class UpdateinfoCommand(YumCommand): + continue + done_pkgs.add(n) + data.append((notice, pkgtup, pkgs[0])) +- show_pkgs(base, md_info, list_type, None, {}, data, msg) ++ show_pkgs(base, md_info, list_type, None, iname2tup, data, msg) + + def _parse_extcmds(self, extcmds): + filt_type = None +@@ -4086,12 +4086,6 @@ class UpdateinfoCommand(YumCommand): + if filt_type is None: + extcmds, show_type, filt_type = self._parse_extcmds(extcmds) + +- 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 = _upi._ysp_gen_used_map(base.updateinfo_filters) + iname2tup = {} +diff -up yum-3.4.3/yumcommands.py.old yum-3.4.3/yumcommands.py +--- yum-3.4.3/yumcommands.py.old 2016-05-10 17:19:04.007269059 +0200 ++++ yum-3.4.3/yumcommands.py 2016-05-10 17:20:11.320698042 +0200 +@@ -4094,6 +4094,10 @@ class UpdateinfoCommand(YumCommand): + name2tup = _upi._get_name2aallpkgtup(base) + iname2tup = _upi._get_name2instpkgtup(base) + ++ if filt_type == "newpackage": ++ self.doCommand_li_new(base, list_type, extcmds, md_info, msg, ++ show_pkgs, iname2tup) ++ return 0, [basecmd + ' new done'] + + def _show_pkgtup(pkgtup): + name = pkgtup[0] diff --git a/SOURCES/BZ-1330423-skipbroken-installonly-limit-fix.patch b/SOURCES/BZ-1330423-skipbroken-installonly-limit-fix.patch new file mode 100644 index 0000000..a923551 --- /dev/null +++ b/SOURCES/BZ-1330423-skipbroken-installonly-limit-fix.patch @@ -0,0 +1,59 @@ +commit 3c89608a67ee9fd35d1860c183951dde76464cd0 +Author: Michal Domonkos +Date: Fri May 6 13:25:25 2016 +0200 + + skipbroken: don't installonly_limit if new pkg fails. BZ 1330423 + + This is a fix up for commit f8c1528. + - Add po instead of txmbr to txmbr.depends_on + - Make sure the depending po is not whatever was last stored in m + +diff --git a/yum/__init__.py b/yum/__init__.py +index 764e97d..cd66396 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -6459,15 +6459,15 @@ much more problems). + continue + + if m.name not in found: +- found[m.name] = 1 ++ found[m.name] = [m.po] + else: +- found[m.name] += 1 ++ found[m.name].append(m.po) + + for name in found: + installed = self.rpmdb.searchNevra(name=name) + installed = _sort_and_filter_installonly(installed) + +- total = len(installed) + found[name] ++ total = len(installed) + len(found[name]) + if total <= self.conf.installonly_limit: + continue # Not adding enough to trigger. + +@@ -6479,14 +6479,20 @@ much more problems). + continue + if numleft == 0: + break +- toremove.append((po,m)) ++ toremove.append((po, found[name])) + numleft -= 1 + +- for po,rel in toremove: ++ for po, newpos in toremove: + txmbr = self.tsInfo.addErase(po) +- # Add a dep relation to the new version of the package, causing this one to be erased +- # this way skipbroken, should clean out the old one, if the new one is skipped +- txmbr.depends_on.append(rel) ++ # Add a dep relation to the new version of the package that causes ++ # this one to be erased. This way skipbroken should drop the old ++ # one from the transaction if the new one is skipped. Note that we ++ # can only do this for one new version, as skipbroken won't drop ++ # deps that are shared with some other packages. For consistency, ++ # let's give up completely if we are installing multiple new ++ # versions (which is rather uncommon anyway). ++ if len(newpos) == 1: ++ txmbr.depends_on.append(newpos[0]) + + def processTransaction(self, callback=None,rpmTestDisplay=None, rpmDisplay=None): + """Process the current transaction. This involves the diff --git a/SOURCES/BZ-1330670-system-name-email-from-cron.patch b/SOURCES/BZ-1330670-system-name-email-from-cron.patch new file mode 100644 index 0000000..255326c --- /dev/null +++ b/SOURCES/BZ-1330670-system-name-email-from-cron.patch @@ -0,0 +1,46 @@ +commit 8bc82519a96a26025afcfdb05e5624739440b21c +Author: Valentina Mukhamedzhanova +Date: Thu Jun 30 17:13:47 2016 +0200 + + yum-cron: replace 'localhost' with system_name value in email_from. BZ 1330670 + +diff --git a/etc/yum-cron-hourly.conf b/etc/yum-cron-hourly.conf +index 63c0bb6..5265d03 100644 +--- a/etc/yum-cron-hourly.conf ++++ b/etc/yum-cron-hourly.conf +@@ -47,6 +47,7 @@ output_width = 80 + + [email] + # The address to send email messages from. ++# NOTE: 'localhost' will be replaced with the value of system_name. + email_from = root + + # List of addresses to send messages to. +diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf +index 7ab4d04..6a3d5ca 100644 +--- a/etc/yum-cron.conf ++++ b/etc/yum-cron.conf +@@ -49,6 +49,7 @@ output_width = 80 + + [email] + # The address to send email messages from. ++# NOTE: 'localhost' will be replaced with the value of system_name. + email_from = root@localhost + + # List of addresses to send messages to. +diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py +index 12c7720..23f36d3 100755 +--- a/yum-cron/yum-cron.py ++++ b/yum-cron/yum-cron.py +@@ -236,7 +236,10 @@ class EmailEmitter(UpdateEmitter): + charset = 'us-ascii' + msg = MIMEText(output, 'plain', charset) + msg['Subject'] = self.subject +- msg['From'] = self.opts.email_from ++ username, at, domain = self.opts.email_from.rpartition('@') ++ if domain == 'localhost': ++ domain = self.opts.system_name ++ msg['From'] = '%s@%s' % (username, domain) + msg['To'] = ",".join(self.opts.email_to) + + # Send the email diff --git a/SOURCES/BZ-1335250-fssnapshot-handle-lvm-errors.patch b/SOURCES/BZ-1335250-fssnapshot-handle-lvm-errors.patch new file mode 100644 index 0000000..49ba7ba --- /dev/null +++ b/SOURCES/BZ-1335250-fssnapshot-handle-lvm-errors.patch @@ -0,0 +1,408 @@ +diff -up yum-3.4.3/yumcommands.py.orig yum-3.4.3/yumcommands.py +--- yum-3.4.3/yumcommands.py.orig 2016-07-21 11:39:40.422379800 +0200 ++++ yum-3.4.3/yumcommands.py 2016-07-21 11:40:42.144992126 +0200 +@@ -42,6 +42,7 @@ import errno + import yum.config + from yum import updateinfo + from yum.packages import parsePackages ++from yum.fssnapshots import LibLVMError, lvmerr2str + + def _err_mini_usage(base, basecmd): + if basecmd not in base.yum_cli_commands: +@@ -4266,12 +4267,19 @@ class FSSnapshotCommand(YumCommand): + return 1, [basecmd + ' ' + subcommand + ' done'] + + if subcommand == 'list': +- snaps = base.fssnap.old_snapshots() ++ try: ++ snaps = base.fssnap.old_snapshots() ++ except LibLVMError as e: ++ return 1, [_("Failed to list snapshots: ") + lvmerr2str(e)] + print _("List of %u snapshosts:") % len(snaps) + self._li_snaps(base, snaps) + + if subcommand == 'delete': +- snaps = base.fssnap.old_snapshots() ++ msg = _("Failed to delete snapshots: ") ++ try: ++ snaps = base.fssnap.old_snapshots() ++ except LibLVMError as e: ++ return 1, [msg + lvmerr2str(e)] + devs = [x['dev'] for x in snaps] + snaps = set() + for dev in devs: +@@ -4282,13 +4290,20 @@ class FSSnapshotCommand(YumCommand): + if dev == extcmd or fnmatch.fnmatch(dev, extcmd): + snaps.add(dev) + break +- snaps = base.fssnap.del_snapshots(devices=snaps) ++ try: ++ snaps = base.fssnap.del_snapshots(devices=snaps) ++ except LibLVMError as e: ++ return 1, [msg + lvmerr2str(e)] + print _("Deleted %u snapshosts:") % len(snaps) + self._li_snaps(base, snaps) + + if subcommand in ('have-space', 'has-space'): + pc = base.conf.fssnap_percentage +- if base.fssnap.has_space(pc): ++ try: ++ has_space = base.fssnap.has_space(pc) ++ except LibLVMError as e: ++ return 1, [_("Could not determine free space on logical volumes: ") + lvmerr2str(e)] ++ if has_space: + print _("Space available to take a snapshot.") + else: + print _("Not enough space available on logical volumes to take a snapshot.") +@@ -4296,14 +4311,22 @@ class FSSnapshotCommand(YumCommand): + if subcommand == 'create': + tags = {'*': ['reason=manual']} + pc = base.conf.fssnap_percentage +- snaps = base.fssnap.snapshot(pc, tags=tags) ++ msg = _("Failed to create snapshots") ++ try: ++ snaps = base.fssnap.snapshot(pc, tags=tags) ++ except LibLVMError as e: ++ msg += ": " + lvmerr2str(e) ++ snaps = [] + if not snaps: +- print _("Failed to create snapshots") ++ print msg + for (odev, ndev) in snaps: + print _("Created snapshot from %s, results is: %s") %(odev,ndev) + + if subcommand == 'summary': +- snaps = base.fssnap.old_snapshots() ++ try: ++ snaps = base.fssnap.old_snapshots() ++ except LibLVMError as e: ++ return 1, [_("Failed to list snapshots: ") + lvmerr2str(e)] + if not snaps: + print _("No snapshots, LVM version:"), base.fssnap.version + return 0, [basecmd + ' ' + subcommand + ' done'] +diff -up yum-3.4.3/yum/fssnapshots.py.orig yum-3.4.3/yum/fssnapshots.py +--- yum-3.4.3/yum/fssnapshots.py.orig 2016-07-21 11:39:40.351380246 +0200 ++++ yum-3.4.3/yum/fssnapshots.py 2016-07-21 11:40:02.211242946 +0200 +@@ -6,6 +6,7 @@ import time + from datetime import datetime + + import subprocess ++from yum import _ + + try: + import lvm +@@ -24,6 +25,14 @@ except: + lvm = None + _ver = None + ++if lvm is not None: ++ from lvm import LibLVMError ++ class _ResultError(LibLVMError): ++ """Exception raised for LVM calls resulting in bad return values.""" ++ pass ++else: ++ LibLVMError = None ++ + + def _is_origin(lv): + snap = lv.getAttr() +@@ -53,14 +62,18 @@ def _vg_name2lv(vg, lvname): + return None + + def _list_vg_names(): +- names = lvm.listVgNames() ++ try: ++ names = lvm.listVgNames() ++ except LibLVMError: ++ # Try to use the lvm binary instead ++ names = [] + + if not names: # Could be just broken... + p = subprocess.Popen(["/sbin/lvm", "vgs", "-o", "vg_name"], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + err = p.wait() + if err: +- return [] # Meh. ++ raise _ResultError(_("Failed to obtain volume group names")) + + output = p.communicate()[0] + output = output.split('\n') +@@ -132,6 +145,25 @@ def _lv_data(vg, lv): + + return data + ++def _log_traceback(func): ++ """Decorator for _FSSnap methods that logs LVM tracebacks.""" ++ def wrap(self, *args, **kwargs): ++ try: ++ return func(self, *args, **kwargs) ++ except LibLVMError as e: ++ if self._logger is not None: ++ self._logger.exception(e) ++ raise ++ return wrap ++ ++def lvmerr2str(exc): ++ """Convert a LibLVMError instance to a readable error message.""" ++ if type(exc) == LibLVMError and len(exc.args) == 2: ++ # args[0] is the error number so ignore that ++ return exc.args[1] ++ else: ++ return str(exc) ++ + + class _FSSnap(object): + +@@ -139,7 +171,7 @@ class _FSSnap(object): + # New style is: fedora/root fedora/swap + # New style is: redhat/root redhat/swap + def __init__(self, root="/", lookup_mounts=True, +- devices=('!*/swap', '!*/lv_swap')): ++ devices=('!*/swap', '!*/lv_swap'), logger=None): + if not lvm or os.geteuid(): + devices = [] + +@@ -150,12 +182,18 @@ class _FSSnap(object): + self._postfix = None + self._root = root + self._devs = devices +- self._vgnames = [] ++ self._vgname_list = None ++ # Logger object to be used for LVM traceback logging ++ self._logger = logger + + if not self._devs: + return + +- self._vgnames = _list_vg_names() if self.available else [] ++ @property ++ def _vgnames(self): ++ if self._vgname_list is None: ++ self._vgname_list = _list_vg_names() if self.available else [] ++ return self._vgname_list + + def _use_dev(self, vgname, lv=None): + +@@ -196,6 +234,7 @@ class _FSSnap(object): + + return found_neg + ++ @_log_traceback + def has_space(self, percentage=100): + """ See if we have enough space to try a snapshot. """ + +@@ -207,7 +246,8 @@ class _FSSnap(object): + + vg = lvm.vgOpen(vgname, 'r') + if not vg: +- return False ++ raise _ResultError( ++ _("Unknown error when opening volume group ") + vgname) + + vgfsize = vg.getFreeSize() + lvssize = 0 +@@ -230,6 +270,7 @@ class _FSSnap(object): + return ret + + ++ @_log_traceback + def snapshot(self, percentage=100, prefix='', postfix=None, tags={}): + """ Attempt to take a snapshot, note that errors can happen after + this function succeeds. """ +@@ -245,7 +286,8 @@ class _FSSnap(object): + + vg = lvm.vgOpen(vgname, 'w') + if not vg: +- return False ++ raise _ResultError( ++ _("Unknown error when opening volume group ") + vgname) + + for lv in vg.listLVs(): + lvname = lv.getName() +@@ -257,7 +299,8 @@ class _FSSnap(object): + nlv = lv.snapshot(nlvname, (lv.getSize() * percentage) / 100) + if not nlv: # Failed here ... continuing seems bad. + vg.close() +- return None ++ raise _ResultError( ++ _("Unknown error when creating snapshot ") + nlvname) + + odev = "%s/%s" % (vgname, lvname) + ndev = "%s/%s" % (vgname, nlvname) +@@ -280,6 +323,7 @@ class _FSSnap(object): + + return ret + ++ @_log_traceback + def old_snapshots(self): + """ List data for old snapshots. """ + +@@ -289,6 +333,9 @@ class _FSSnap(object): + # see stuff after changing config. options. + + vg = lvm.vgOpen(vgname, 'w') ++ if not vg: ++ raise _ResultError( ++ _("Unknown error when opening volume group ") + vgname) + + for lv in vg.listLVs(): + +@@ -300,6 +347,7 @@ class _FSSnap(object): + + return ret + ++ @_log_traceback + def del_snapshots(self, devices=[]): + """ Remove snapshots. """ + +@@ -318,6 +366,9 @@ class _FSSnap(object): + + for vgname in togo: + vg = lvm.vgOpen(vgname, 'w') ++ if not vg: ++ raise _ResultError( ++ _("Unknown error when opening volume group ") + vgname) + + for lvname in togo[vgname]: + lv = _vg_name2lv(vg, lvname) +diff -up yum-3.4.3/yum/__init__.py.orig yum-3.4.3/yum/__init__.py +--- yum-3.4.3/yum/__init__.py.orig 2016-07-21 11:39:40.425379782 +0200 ++++ yum-3.4.3/yum/__init__.py 2016-07-21 11:40:02.211242946 +0200 +@@ -81,6 +81,7 @@ import yumRepo + import callbacks + import yum.history + import yum.fssnapshots ++from yum.fssnapshots import LibLVMError, lvmerr2str + import yum.igroups + import update_md + +@@ -204,6 +205,7 @@ class YumBase(depsolve.Depsolve): + self._not_found_i = {} + self.logger = logging.getLogger("yum.YumBase") + self.verbose_logger = logging.getLogger("yum.verbose.YumBase") ++ self.file_logger = logging.getLogger("yum.filelogging.YumBase") + self._override_sigchecks = False + self._repos = RepoStorage(self) + self.repo_setopts = {} # since we have to use repo_setopts in base and +@@ -1048,7 +1050,8 @@ class YumBase(depsolve.Depsolve): + if self._fssnap is None: + devices = self.conf.fssnap_devices + self._fssnap = yum.fssnapshots._FSSnap(root=self.conf.installroot, +- devices=devices) ++ devices=devices, ++ logger=self.file_logger) + + return self._fssnap + +@@ -1726,6 +1729,37 @@ much more problems). + :raises: :class:`yum.Errors.YumRPMTransError` if there is a + transaction cannot be completed + """ ++ ++ def create_snapshot(post=False): ++ """Create the pre or post trans snapshot if we have free space.""" ++ msg = _("Not enough space on logical volumes to create %s FS snapshot." % ++ ("post trans" if post else "pre.")) ++ try: ++ has_space = self.fssnap.has_space(self.conf.fssnap_percentage) ++ except LibLVMError as e: ++ msg = _("Could not determine free space on logical volumes: ") + lvmerr2str(e) ++ has_space = False ++ if not has_space: ++ if not post and self.conf.fssnap_abort_on_errors in ('snapshot-failure', 'any'): ++ raise Errors.YumRPMTransError(msg="Aborting transaction", errors=msg) ++ else: ++ self.verbose_logger.critical(msg) ++ else: ++ tags = {'*': ['reason=automatic']} # FIXME: pre. and post tags ++ msg = _("Failed to create snapshot") ++ try: ++ snaps = self.fssnap.snapshot(self.conf.fssnap_percentage, tags=tags) ++ except LibLVMError as e: ++ msg += ": " + lvmerr2str(e) ++ snaps = [] ++ if not snaps: ++ if not post and self.conf.fssnap_abort_on_errors in ('snapshot-failure', 'any'): ++ raise Errors.YumRPMTransError(msg="Aborting transaction", errors=msg) ++ else: ++ self.verbose_logger.critical(msg) ++ for (odev, ndev) in snaps: ++ self.verbose_logger.info(_("Created snapshot from %s, results is: %s") % (odev, ndev)) ++ + if (self.conf.fssnap_automatic_pre or self.conf.fssnap_automatic_post) and not self.fssnap.available: + msg = _("Snapshot support not available.") + if self.conf.fssnap_abort_on_errors in ('broken-setup', 'any'): +@@ -1737,7 +1771,13 @@ much more problems). + self.conf.fssnap_automatic_post) and + self.conf.fssnap_automatic_keep): + # Automatically kill old snapshots... +- snaps = self.fssnap.old_snapshots() ++ cleanup_fail = False ++ try: ++ snaps = self.fssnap.old_snapshots() ++ except LibLVMError as e: ++ self.verbose_logger.debug(lvmerr2str(e)) ++ cleanup_fail = True ++ snaps = [] + snaps = sorted(snaps, key=lambda x: (x['ctime'], x['origin_dev']), + reverse=True) + last = '' +@@ -1754,30 +1794,22 @@ much more problems). + if num > self.conf.fssnap_automatic_keep: + todel.append(snap['dev']) + # Display something to the user? +- snaps = self.fssnap.del_snapshots(devices=todel) ++ try: ++ snaps = self.fssnap.del_snapshots(devices=todel) ++ except LibLVMError as e: ++ self.verbose_logger.debug(lvmerr2str(e)) ++ cleanup_fail = True ++ snaps = [] + if len(snaps): + self.verbose_logger.info(_("Deleted %u snapshots.") % len(snaps)) ++ elif cleanup_fail: ++ self.verbose_logger.warning(_("Skipping the cleanup of old " ++ "snapshots due to errors")) + + if (self.fssnap.available and + (not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST) and + self.conf.fssnap_automatic_pre)): +- if not self.fssnap.has_space(self.conf.fssnap_percentage): +- msg = _("Not enough space on logical volumes to create pre. FS snapshot.") +- if self.conf.fssnap_abort_on_errors in ('snapshot-failure', 'any'): +- raise Errors.YumRPMTransError(msg="Aborting transaction", errors=msg) +- else: +- self.verbose_logger.critical(msg) +- else: +- tags = {'*': ['reason=automatic']} # FIXME: pre. tags +- snaps = self.fssnap.snapshot(self.conf.fssnap_percentage, tags=tags) +- if not snaps: +- msg = _("Failed to create snapshot") +- if self.conf.fssnap_abort_on_errors in ('snapshot-failure', 'any'): +- raise Errors.YumRPMTransError(msg="Aborting transaction", errors=msg) +- else: +- self.verbose_logger.critical(msg) +- for (odev, ndev) in snaps: +- self.verbose_logger.info(_("Created snapshot from %s, results is: %s") % (odev, ndev)) ++ create_snapshot() + + self.plugins.run('pretrans') + +@@ -1912,16 +1944,7 @@ much more problems). + if (self.fssnap.available and + (not self.ts.isTsFlagSet(rpm.RPMTRANS_FLAG_TEST) and + self.conf.fssnap_automatic_post)): +- if not self.fssnap.has_space(self.conf.fssnap_percentage): +- msg = _("Not enough space on logical volumes to create post trans FS snapshot.") +- self.verbose_logger.critical(msg) +- else: +- tags = {'*': ['reason=automatic']} # FIXME: post tags +- snaps = self.fssnap.snapshot(self.conf.fssnap_percentage, tags=tags) +- if not snaps: +- self.verbose_logger.critical(_("Failed to create snapshot")) +- for (odev, ndev) in snaps: +- self.verbose_logger.info(_("Created snapshot from %s, results is: %s") % (odev, ndev)) ++ create_snapshot(post=True) + return resultobject + + def verifyTransaction(self, resultobject=None, txmbr_cb=None): diff --git a/SOURCES/BZ-1337105-add-lazy-packages-caching-opt.patch b/SOURCES/BZ-1337105-add-lazy-packages-caching-opt.patch new file mode 100644 index 0000000..50aca42 --- /dev/null +++ b/SOURCES/BZ-1337105-add-lazy-packages-caching-opt.patch @@ -0,0 +1,128 @@ +diff -up yum-3.4.3/docs/yum.conf.5.orig yum-3.4.3/docs/yum.conf.5 +--- yum-3.4.3/docs/yum.conf.5.orig 2016-08-02 15:08:10.160947580 +0200 ++++ yum-3.4.3/docs/yum.conf.5 2016-08-02 15:08:30.046853379 +0200 +@@ -381,6 +381,13 @@ that Yum does. This option can take the + `packages' means that only RPM package downloads should be cached (but not + repository metadata downloads). + ++`lazy:packages' means that act like `packages' unless package verification ++fails (e.g. the package download doesn't match the expected checksum), in which ++case try re-downloading the package as if `none' was set. This value is a good ++compromise if you want to avoid issues caused by stale proxy cache after remote ++RPMs change contents without changing filenames (e.g. are pushed unsigned and ++later signed) but still want the benefits of package caching whenever possible. ++ + `none' means that no HTTP downloads should be cached. + + The default is `all'. This is recommended unless you are experiencing caching +diff -up yum-3.4.3/output.py.orig yum-3.4.3/output.py +--- yum-3.4.3/output.py.orig 2016-08-02 15:08:10.074947988 +0200 ++++ yum-3.4.3/output.py 2016-08-02 15:08:30.053853346 +0200 +@@ -472,6 +472,13 @@ class YumOutput: + :raises: *errobj*.exception + """ + self.logger.error('%s: %s', errobj.url, errobj.exception) ++ if hasattr(errobj, 'retry_no_cache') and errobj.retry_no_cache and \ ++ errobj.exception.errno < 0: ++ self.logger.error(_('Trying again, now avoiding proxy cache.')) ++ # Raising an exception would cause urlgrabber to jump to the next ++ # mirror and what we want here is to retry with the same, so just ++ # return. ++ return + self.logger.error(_('Trying other mirror.')) + self.suggestKBaseArticle(errobj) + raise errobj.exception +diff -up yum-3.4.3/yum/config.py.orig yum-3.4.3/yum/config.py +--- yum-3.4.3/yum/config.py.orig 2016-08-02 15:08:10.159947585 +0200 ++++ yum-3.4.3/yum/config.py 2016-08-02 15:08:30.048853370 +0200 +@@ -810,7 +810,8 @@ class YumConf(StartupConf): + deltarpm_percentage = IntOption(75, range_min=0, range_max=100) + deltarpm_metadata_percentage = IntOption(100, range_min=0) + +- http_caching = SelectionOption('all', ('none', 'packages', 'all')) ++ http_caching = SelectionOption('all', ('none', 'packages', 'all', ++ 'lazy:packages')) + metadata_expire = SecondsOption(60 * 60 * 6) # Time in seconds (6h). + metadata_expire_filter = SelectionOption('read-only:present', + ('never', 'read-only:future', +diff -up yum-3.4.3/yum/__init__.py.orig yum-3.4.3/yum/__init__.py +diff -up yum-3.4.3/yum.spec.orig yum-3.4.3/yum.spec +--- yum-3.4.3/yum.spec.orig 2016-08-02 15:08:10.150947628 +0200 ++++ yum-3.4.3/yum.spec 2016-08-02 15:08:30.047853374 +0200 +@@ -63,7 +63,7 @@ BuildRequires: python >= 2.4 + BuildRequires: rpm-python, rpm >= 0:4.4.2 + BuildRequires: python-iniparse + BuildRequires: python-sqlite +-BuildRequires: python-urlgrabber >= 3.9.0-8 ++BuildRequires: python-urlgrabber >= 3.10-8 + BuildRequires: yum-metadata-parser >= 1.1.0 + BuildRequires: pygpgme + # End of CheckRequires +@@ -72,7 +72,7 @@ Requires: python >= 2.4 + Requires: rpm-python, rpm >= 0:4.4.2 + Requires: python-iniparse + Requires: python-sqlite +-Requires: python-urlgrabber >= 3.9.0-8 ++Requires: python-urlgrabber >= 3.10-8 + Requires: yum-metadata-parser >= 1.1.0 + Requires: pygpgme + # rawhide is >= 0.5.3-7.fc18 ... as this is added. +diff -up yum-3.4.3/yum/yumRepo.py.orig yum-3.4.3/yum/yumRepo.py +--- yum-3.4.3/yum/yumRepo.py.orig 2016-08-02 15:08:10.104947846 +0200 ++++ yum-3.4.3/yum/yumRepo.py 2016-08-02 15:08:30.052853351 +0200 +@@ -336,6 +336,7 @@ class YumRepository(Repository, config.R + self._repoXML = None + self._oldRepoMDData = {} + self.cache = 0 ++ self._retry_no_cache = False + self.mirrorlistparsed = 0 + self.yumvar = {} # empty dict of yumvariables for $string replacement + self._proxy_dict = {} +@@ -993,6 +994,7 @@ Insufficient space in download directory + interrupt_callback=self.interrupt_callback, + checkfunc=checkfunc, + size=size, ++ retry_no_cache=self._retry_no_cache, + **ugopts) + + remote = url + '/' + relative +@@ -1020,6 +1022,7 @@ Insufficient space in download directory + checkfunc=checkfunc, + http_headers=headers, + size=size, ++ retry_no_cache=self._retry_no_cache, + **kwargs + ) + except URLGrabError, e: +@@ -1049,15 +1052,22 @@ Insufficient space in download directory + misc.unlink_f(local) + raise URLGrabError(-1, _('Package does not match intended download.')) + +- ret = self._getFile(url=basepath, +- relative=remote, +- local=local, +- checkfunc=checkfunc, +- text=text, +- cache=cache, +- size=package.size, +- **kwargs +- ) ++ # We would normally pass this to _getFile() directly but that could ++ # break backward compatibility with plugins that override _getFile() ++ # (BZ 1360532). ++ self._retry_no_cache = self.http_caching == 'lazy:packages' ++ try: ++ ret = self._getFile(url=basepath, ++ relative=remote, ++ local=local, ++ checkfunc=checkfunc, ++ text=text, ++ cache=cache, ++ size=package.size, ++ **kwargs ++ ) ++ finally: ++ self._retry_no_cache = False + + if not kwargs.get('async') and not package.verifyLocalPkg(): + # Don't return as "success" when bad. diff --git a/SOURCES/BZ-1339168-yum-cron-conf-typo.patch b/SOURCES/BZ-1339168-yum-cron-conf-typo.patch new file mode 100644 index 0000000..40eb3bd --- /dev/null +++ b/SOURCES/BZ-1339168-yum-cron-conf-typo.patch @@ -0,0 +1,58 @@ +commit 4596a105fefc769d1d6df547f3bd172a53bf7a53 +Author: Ville Skyttä +Date: Fri Jan 24 16:34:35 2014 +0200 + + s/ouput/output/ typo fixes + +diff --git a/docs/sphinxdocs/rstgenerator.py b/docs/sphinxdocs/rstgenerator.py +index ad24788..4a0bca0 100755 +--- a/docs/sphinxdocs/rstgenerator.py ++++ b/docs/sphinxdocs/rstgenerator.py +@@ -12,7 +12,7 @@ def generateFile(input_directory, file_name, output_directory, + source code file + :param file_name: the name of the python source code file to generate + a sphinx rst file describing +- :param ouput_directory: a string specifying the directory where ++ :param output_directory: a string specifying the directory where + the generated rst file should be placed. If *output_directory* does + not already exist, it will be created + :param package_heirarchy: a list of strings, where each name is +diff --git a/etc/yum-cron-hourly.conf b/etc/yum-cron-hourly.conf +index 7871a46..2a588cd 100644 +--- a/etc/yum-cron-hourly.conf ++++ b/etc/yum-cron-hourly.conf +@@ -42,7 +42,7 @@ emit_via = stdio + + # The width, in characters, that messages that are emitted should be + # formatted to. +-ouput_width = 80 ++output_width = 80 + + + [email] +diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf +index b0f7839..7314fae 100644 +--- a/etc/yum-cron.conf ++++ b/etc/yum-cron.conf +@@ -42,7 +42,7 @@ emit_via = stdio + + # The width, in characters, that messages that are emitted should be + # formatted to. +-ouput_width = 80 ++output_width = 80 + + + [email] +diff --git a/shell.py b/shell.py +index 2232b03..00b6896 100644 +--- a/shell.py ++++ b/shell.py +@@ -171,7 +171,7 @@ class YumShell(cmd.Cmd): + def do_help(self, arg): + """Output help information. + +- :param arg: the command to ouput help information about. If ++ :param arg: the command to output help information about. If + *arg* is an empty string, general help will be output. + """ + msg = """ diff --git a/SOURCES/BZ-1347813-security-updates-count.patch b/SOURCES/BZ-1347813-security-updates-count.patch new file mode 100644 index 0000000..0e73967 --- /dev/null +++ b/SOURCES/BZ-1347813-security-updates-count.patch @@ -0,0 +1,33 @@ +commit 5820dcdc3e6f9bf16e2c42d2bf37d4cbd16064dc +Author: Valentina Mukhamedzhanova +Date: Thu Jul 21 20:38:28 2016 +0200 + + Fix count of applicable security updates. BZ 1347813 + +diff --git a/yum/updateinfo.py b/yum/updateinfo.py +index 7abe332..5dcd7df 100644 +--- a/yum/updateinfo.py ++++ b/yum/updateinfo.py +@@ -445,7 +445,6 @@ def exclude_updates(base, filters=None): + pkgs = base.pkgSack.returnPackages() + name2tup = _get_name2oldpkgtup(base) + +- cnt = 0 + pkgs_to_del = [] + for pkg in pkgs: + name = pkg.name +@@ -453,11 +452,13 @@ def exclude_updates(base, filters=None): + not _ysp_should_keep_pkg(opts, name2tup[name], md_info, used_map)): + pkgs_to_del.append(pkg.name) + continue +- cnt += 1 + if pkgs_to_del: + for p in base.doPackageLists(pkgnarrow='available', patterns=pkgs_to_del, showdups=True).available: + ysp_del_pkg(p) + ++ cnt = len(base.doPackageLists(pkgnarrow='updates').updates) + \ ++ len(base.doPackageLists(pkgnarrow='obsoletes').obsoletes) ++ + _ysp_chk_used_map(used_map, lambda x: base.verbose_logger.warn("%s", x)) + + if cnt: diff --git a/SOURCES/BZ-1348995-ship-comps-rng-schema.patch b/SOURCES/BZ-1348995-ship-comps-rng-schema.patch new file mode 100644 index 0000000..151eae1 --- /dev/null +++ b/SOURCES/BZ-1348995-ship-comps-rng-schema.patch @@ -0,0 +1,220 @@ +diff -up yum-3.4.3/docs/comps.rng.orig yum-3.4.3/docs/comps.rng +--- yum-3.4.3/docs/comps.rng.orig 2011-06-28 22:27:22.000000000 +0200 ++++ yum-3.4.3/docs/comps.rng 2016-06-30 14:30:03.980476903 +0200 +@@ -21,14 +21,22 @@ + + + ++ ++ ++ + + +- +- ++ ++ + ++ ++ + +- +- ++ ++ ++ ++ ++ + + + +@@ -37,14 +45,18 @@ + This defines a package group. + + +- +- Should the group be enabled by default? +- +- +- +- Should the group be visible to users? +- +- ++ ++ ++ Should the group be enabled by default? ++ ++ ++ ++ ++ ++ Should the group be visible to users? ++ ++ ++ + + + +@@ -72,6 +84,9 @@ + + + ++ ++ ++ + + + +@@ -79,23 +94,39 @@ + + + ++ ++ ++ ++ ++ ++ ++ mandatory ++ default ++ optional ++ ++ ++ ++ ++ + + +- ++ + +- ++ + + + + + +- +- +- mandatory +- default +- optional +- +- ++ ++ ++ ++ mandatory ++ default ++ optional ++ ++ ++ + + + +@@ -112,9 +143,30 @@ + + + ++ ++ ++ ++ ++ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + +@@ -135,9 +187,21 @@ + + + ++ ++ ++ ++ ++ ++ ++ + + + ++ ++ ++ ++ ++ + + + +@@ -182,6 +246,29 @@ + + + ++ ++ ++ The "langpacks" item is a list of package-to-langpack mappings used ++ by the yum-langpacks plugin. ++ ++ An example is: ++ <match name="foo" install="foo-lang-%s"> ++ When the 'foo' package is installed, the 'foo-lang-(language code)' package ++ will be installed for any configured languages. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + + The "blacklist" is a list of packages that will be *removed* if found +@@ -257,7 +344,7 @@ + + + +- ++ + + + +diff -up yum-3.4.3/yum.spec.orig yum-3.4.3/yum.spec +--- yum-3.4.3/yum.spec.orig 2016-06-30 14:30:03.980476903 +0200 ++++ yum-3.4.3/yum.spec 2016-06-30 14:30:35.545325463 +0200 +@@ -347,7 +347,7 @@ exit 0 + + %files -f %{name}.lang + %defattr(-, root, root, -) +-%doc README AUTHORS COPYING TODO INSTALL ChangeLog PLUGINS ++%doc README AUTHORS COPYING TODO INSTALL ChangeLog PLUGINS docs/comps.rng + %if %{move_yum_conf_back} + %config(noreplace) %{_sysconfdir}/yum.conf + %dir %{_sysconfdir}/yum.repos.d diff --git a/SOURCES/BZ-1356797-silent-exception.patch b/SOURCES/BZ-1356797-silent-exception.patch new file mode 100644 index 0000000..1672469 --- /dev/null +++ b/SOURCES/BZ-1356797-silent-exception.patch @@ -0,0 +1,78 @@ +commit c8c4065931bec55e9b2eb0f16a97376e8650846b +Author: Radek Vykydal +Date: Wed Aug 10 11:10:58 2016 +0200 + + Report __del__ RepoError exceptions into log instead of stderr (#1356797) + + Resolves: rhbz#1356797 + + So it does not clutter text UI of clients like Anaconda. + +diff --git a/yum/__init__.py b/yum/__init__.py +index 57e1dfe..9e38320 100644 +--- a/yum/__init__.py ++++ b/yum/__init__.py +@@ -234,11 +234,14 @@ class YumBase(depsolve.Depsolve): + self.updateinfo_filters = {} + + def __del__(self): +- self.close() +- self.closeRpmDB() +- self.doUnlock() +- # call cleanup callbacks +- for cb in self._cleanup: cb() ++ try: ++ self.close() ++ self.closeRpmDB() ++ self.doUnlock() ++ # call cleanup callbacks ++ for cb in self._cleanup: cb() ++ except Errors.RepoError, e: ++ self.verbose_logger.debug("Exception %s %s in %s ignored" % (repr(e), str(e), self.__del__)) + + def close(self): + """Close the history and repo objects.""" +diff --git a/yum/repos.py b/yum/repos.py +index a0ef28c..017527a 100644 +--- a/yum/repos.py ++++ b/yum/repos.py +@@ -161,7 +161,10 @@ class RepoStorage: + return str(self.repos.keys()) + + def __del__(self): +- self.close() ++ try: ++ self.close() ++ except Errors.RepoError, e: ++ self.logger.debug("Exception %s %s in %s ignored" % (repr(e), str(e), self.__del__)) + + def close(self): + for repo in self.repos.values(): +@@ -423,7 +426,10 @@ class Repository: + return hash(self.id) + + def __del__(self): +- self.close() ++ try: ++ self.close() ++ except Errors.RepoError, e: ++ self.logger.debug("Exception %s %s in %s ignored" % (repr(e), str(e), self.__del__)) + + def _ui_id(self): + """ Show self.id, so we can use it and override it. """ +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index 9c3d274..2db8faf 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -114,7 +114,10 @@ class YumPackageSack(packageSack.PackageSack): + self.added = {} + + def __del__(self): +- self.close() ++ try: ++ self.close() ++ except Errors.RepoError, e: ++ verbose_logger.debug("Exception %s %s in %s ignored" % (repr(e), str(e), self.__del__)) + + def close(self): + self.added = {} diff --git a/SOURCES/BZ-1377328-_metadata_cache_req.patch b/SOURCES/BZ-1377328-_metadata_cache_req.patch new file mode 100644 index 0000000..6884d03 --- /dev/null +++ b/SOURCES/BZ-1377328-_metadata_cache_req.patch @@ -0,0 +1,20 @@ +commit 673ceee5f3d32fc6397e9a280ac18926e82ac152 +Author: Valentina Mukhamedzhanova +Date: Mon Sep 19 17:38:08 2016 +0200 + + Check for _metadata_cache_req properly. + +diff --git a/yum/yumRepo.py b/yum/yumRepo.py +index 2db8faf..47f950b 100644 +--- a/yum/yumRepo.py ++++ b/yum/yumRepo.py +@@ -1473,7 +1473,8 @@ Insufficient space in download directory %s + else: + result = self._getFileRepoXML(local, text) + if result is None: +- if self.skip_if_unavailable and self._metadata_cache_req in ('write', 'read-only:future'): ++ if (self.skip_if_unavailable and hasattr(self, '_metadata_cache_req') ++ and self._metadata_cache_req in ('write', 'read-only:future')): + # Since skip_if_unavailable=True, we can just disable this repo + raise Errors.RepoError, "Can't download repomd.xml for %s" % self.ui_id + diff --git a/SOURCES/centos-branding-yum.patch b/SOURCES/centos-branding-yum.patch deleted file mode 100644 index 6cfdcbb..0000000 --- a/SOURCES/centos-branding-yum.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -uNrp yum-3.4.3.orig/yum/constants.py yum-3.4.3/yum/constants.py ---- yum-3.4.3.orig/yum/constants.py 2015-12-03 09:06:24.365442687 -0600 -+++ yum-3.4.3/yum/constants.py 2015-12-03 09:17:09.268462350 -0600 -@@ -127,18 +127,18 @@ ERRORS_TO_KBASE_ARTICLES = { - - https://access.redhat.com/articles/1320623 - --If above article doesn't help to resolve this issue please open a ticket with Red Hat Support. -+If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/ - """, - 403: """To address this issue please refer to the below knowledge base article - - https://access.redhat.com/solutions/69319 - --If above article doesn't help to resolve this issue please open a ticket with Red Hat Support. -+If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/ - """, -- 60: """It was impossible to connect to the Red Hat servers. -+ 60: """It was impossible to connect to the CentOS servers. - This could mean a connectivity issue in your environment, such as the requirement to configure a proxy, - or a transparent proxy that tampers with TLS security, or an incorrect system clock. - Please collect information about the specific failure that occurs in your environment, --using the instructions in: https://access.redhat.com/solutions/1527033 and open a ticket with Red Hat Support. -+using the instructions in: https://access.redhat.com/solutions/1527033 and create a bug on https://bugs.centos.org/ - """ --} -\ No newline at end of file -+} 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 5bc47c9..ac9384e 100644 --- a/SPECS/yum.spec +++ b/SPECS/yum.spec @@ -9,11 +9,6 @@ %define yum_cron_systemd 0 %endif -%if ! 0%{?rhel} -# we don't have this in rhel yet... -BuildRequires: bash-completion -%endif - %if %{auto_sitelib} %{!?python_sitelib: %define python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -28,19 +23,20 @@ BuildRequires: bash-completion # disable broken /usr/lib/rpm/brp-python-bytecompile %define __os_install_post %{nil} -%define compdir %(pkg-config --variable=completionsdir bash-completion) -%if "%{compdir}" == "" -%define compdir "/etc/bash_completion.d" +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 +%define compdir %{_datadir}/bash-completion/completions +%else +%define compdir %{_sysconfdir}/bash_completion.d %endif Summary: RPM package installer/updater/manager Name: yum Version: 3.4.3 -Release: 132%{?dist}.0.1 +Release: 150%{?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 @@ -96,7 +92,46 @@ Patch164: BZ-1233152-pvm-api-lv_attr.patch Patch165: BZ-1244119-fssnapshot-automatic-percentage-manpage.patch Patch166: BZ-1259837-igroups-empty-lines.patch -Patch1000: centos-branding-yum.patch +# rhel-7.3 +Patch200: BZ-1267234-groupinstall-fail-on-non-existent.patch +Patch201: BZ-1274211-skip-missing-names.patch +Patch202: BZ-1183669-corrupt-cache.patch +Patch203: BZ-1235623-new-provides-realpath-file-search.patch +Patch204: BZ-1292160-security-lists-wrong-arch-updates.patch +Patch205: BZ-1267897-exclude-dups-from-security-updates.patch +Patch206: BZ-1292150-updateinfo-list-available.patch +Patch207: BZ-1293670-proxy.patch +Patch208: BZ-1291745-query-install-excludes.patch +Patch209: BZ-1293378-ftp-disable-epsv.patch +Patch210: BZ-1272058-arches.patch +Patch211: BZ-1279483-hidden-groups-manpage.patch +Patch212: BZ-1281593-yum-fs-vars.patch +Patch213: BZ-1306142-allow-older-installonly-deps.patch +Patch214: BZ-1321651-repoinfo-add-metadata-expire-filter.patch +Patch215: BZ-1202680-handle-non-ascii-email.patch +Patch216: BZ-1168121-fssnapshot-manpage-fix.patch +Patch217: BZ-1004853-yum-cron-handle-empty-transaction.patch +Patch218: BZ-1309676-fs-command-help-fix.patch +Patch219: BZ-1294789-yum-cron-fix-update_cmd.patch +Patch220: BZ-1292087-history-hash-crash.patch +Patch221: BZ-1234967-handle-invalid-yumdb.patch +Patch222: BZ-1208803-autosavets.patch +Patch223: BZ-1186690-compare_providers_priorities.patch +Patch224: BZ-1330423-skipbroken-installonly-limit-fix.patch +Patch225: BZ-1195745-failed-repo-message.patch +Patch226: BZ-1327962-conduit-typo.patch +Patch227: BZ-1328023-updateinfo-traceback.patch +Patch228: BZ-1293513-compdir.patch +Patch229: BZ-1065380-updateinfo-strip-respin.patch +Patch230: BZ-1175309-enable-repos-instruction.patch +Patch231: BZ-1337105-add-lazy-packages-caching-opt.patch +Patch232: BZ-1348995-ship-comps-rng-schema.patch +Patch233: BZ-1339168-yum-cron-conf-typo.patch +Patch234: BZ-1330670-system-name-email-from-cron.patch +Patch235: BZ-1347813-security-updates-count.patch +Patch236: BZ-1335250-fssnapshot-handle-lvm-errors.patch +Patch237: BZ-1356797-silent-exception.patch +Patch238: BZ-1377328-_metadata_cache_req.patch URL: http://yum.baseurl.org/ BuildArchitectures: noarch @@ -109,17 +144,16 @@ BuildRequires: python >= 2.4 BuildRequires: rpm-python, rpm >= 0:4.4.2 BuildRequires: python-iniparse BuildRequires: python-sqlite -BuildRequires: python-urlgrabber >= 3.9.0-8 +BuildRequires: python-urlgrabber >= 3.10-8 BuildRequires: yum-metadata-parser >= 1.1.0 BuildRequires: pygpgme # End of CheckRequires Conflicts: pirut < 1.1.4 Requires: python >= 2.4 -Requires: yum-plugin-fastestmirror Requires: rpm-python, rpm >= 0:4.4.2 Requires: python-iniparse Requires: python-sqlite -Requires: python-urlgrabber >= 3.9.0-8 +Requires: python-urlgrabber >= 3.10-8 Requires: yum-metadata-parser >= 1.1.0 Requires: pygpgme # rawhide is >= 0.5.3-7.fc18 ... as this is added. @@ -273,7 +307,46 @@ Install this package if you want auto yum updates nightly via cron. %patch165 -p1 %patch166 -p1 -%patch1000 -p1 +# rhel-7.3 +%patch200 -p1 +%patch201 -p1 +%patch202 -p1 +%patch203 -p1 +%patch204 -p1 +%patch205 -p1 +%patch206 -p1 +%patch207 -p1 +%patch208 -p1 +%patch209 -p1 +%patch210 -p1 +%patch211 -p1 +%patch212 -p1 +%patch213 -p1 +%patch214 -p1 +%patch215 -p1 +%patch216 -p1 +%patch217 -p1 +%patch218 -p1 +%patch219 -p1 +%patch220 -p1 +%patch221 -p1 +%patch222 -p1 +%patch223 -p1 +%patch224 -p1 +%patch225 -p1 +%patch226 -p1 +%patch227 -p1 +%patch228 -p1 +%patch229 -p1 +%patch230 -p1 +%patch231 -p1 +%patch232 -p1 +%patch233 -p1 +%patch234 -p1 +%patch235 -p1 +%patch236 -p1 +%patch237 -p1 +%patch238 -p1 # Do distro config. changes after everything else. %patch1 -p1 @@ -296,7 +369,7 @@ INIT=systemd INIT=sysv %endif -make DESTDIR=$RPM_BUILD_ROOT UNITDIR=%{_unitdir} INIT=$INIT install +make DESTDIR=$RPM_BUILD_ROOT UNITDIR=%{_unitdir} INIT=$INIT COMPDIR=%{compdir} install install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/yum.conf mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/yum/pluginconf.d $RPM_BUILD_ROOT/%{yum_pluginslib} @@ -437,7 +510,7 @@ exit 0 %files -f %{name}.lang %defattr(-, root, root, -) -%doc README AUTHORS COPYING TODO INSTALL ChangeLog PLUGINS +%doc README AUTHORS COPYING TODO INSTALL ChangeLog PLUGINS docs/comps.rng %if %{move_yum_conf_back} %config(noreplace) %{_sysconfdir}/yum.conf %dir %{_sysconfdir}/yum.repos.d @@ -451,7 +524,11 @@ exit 0 %dir %{_sysconfdir}/yum/fssnap.d %dir %{_sysconfdir}/yum/vars %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 %(dirname %{compdir}) +%else +%{compdir} +%endif %dir %{_datadir}/yum-cli %{_datadir}/yum-cli/* %exclude %{_datadir}/yum-cli/completion-helper.py? @@ -501,15 +578,131 @@ exit 0 %endif %changelog -* Thu Dec 3 2015 Johnny Hughes - 3.4.3-132.el7.centos.0.1 -- Roll in Manual Branding Change to constants.py - -* Thu Nov 19 2015 CentOS Sources - 3.4.3-132.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 +* Mon Sep 19 2016 Valentina Mukhamedzhanova - 3.4.3-150 +- Check for _metadata_cache_req properly. +- Resolves: bug#1377328 + +* Mon Aug 29 2016 Valentina Mukhamedzhanova - 3.4.3-149 +- Report __del__ RepoError exceptions into log instead of stderr. +- Resolves: bug#1356797 + +* Thu Aug 04 2016 Valentina Mukhamedzhanova - 3.4.3-148 +- Don't change method signature for lazy:packages. +- Related: bug#1337105 + +* Fri Jul 22 2016 Valentina Mukhamedzhanova - 3.4.3-147 +- Better exception handling in fssnap. +- Resolves: bug#1335250 + +* Thu Jul 21 2016 Valentina Mukhamedzhanova - 3.4.3-146 +- Fix count of applicable security updates. +- Related: bug#1292160 +- Update the docs for compare_providers_priority. +- Related: bug#1186690 + +* Mon Jul 18 2016 Valentina Mukhamedzhanova - 3.4.3-145 +- yum-cron: properly replace 'localhost' with system_name value in email_from. +- Related: bug#1330670 + +* Fri Jul 01 2016 Valentina Mukhamedzhanova - 3.4.3-144 +- Fixed the required python-urlgrabber version. +- Related: bug#1337105 + +* Thu Jun 30 2016 Valentina Mukhamedzhanova - 3.4.3-143 +- Add lazy:packages caching option. +- Resolves: bug#1337105 +- Install comps.rng on the system. +- Resolves: bug#1348995 +- Typo fixes. +- Resolves: bug#1339168 +- yum-cron: replace 'localhost' with system_name value in email_from. +- Resolves: bug#1330670 + +* Thu May 19 2016 Valentina Mukhamedzhanova - 3.4.3-142 +- Reworked the respin suffix patch. +- Related: bug#1065380 + +* Thu May 19 2016 Valentina Mukhamedzhanova - 3.4.3-141 +- updateinfo: strip respin suffix if present. +- Resolves: bug#1065380 +- Mention subscription-manager for enabling repos. +- Resolves: bug#1175309 + +* Wed May 11 2016 Valentina Mukhamedzhanova - 3.4.3-140 +- Fix bash-completion dir in Makefile. +- Related: bug#1293513 + +* Tue May 10 2016 Valentina Mukhamedzhanova - 3.4.3-139 +- Add autosavets option allowing to avoid autosaving transactions. +- Resolves: bug#1208803 +- Add compare_providers_priority repository option. +- Resolves: bug#1186690 +- skipbroken: don't installonly_limit if new pkg fails. +- Resolves: bug#1330423 +- Recommend --disablerepo and subscription-manager when a repo fails. +- Resolves: bug#1195745 +- Fix a typo in exclude_updates(). +- Resolves: bug#1327962 +- Fix 'updateinfo list all' traceback and indicate if the package is installed. +- Resolves: bug#1328023 +- Explicitly list the bash completions directory. +- Resolves: bug#1293513 + +* Fri Apr 29 2016 Valentina Mukhamedzhanova - 3.4.3-138 +- Read FS yumvars before yum.conf setup, and reread if installroot changed. +- Resolves: bug#1281593 +- Cope with older installonly packages from deps. +- Resolves: bug#1306142 +- Add metadata_expire_filter to repoinfo output. +- Resolves: bug#1321651 +- yum-cron: don't crash with non-ascii email. +- Resolves: bug#1202680 +- Fix fssnapshot section in the manpage. +- Resolves: bug#1168121 +- yum-cron: don't fail on empty transaction. +- Resolves: bug#1004853 +- Fix summary for yum fs command. +- Resolves: bug#1309676 +- yum-cron: fix the parsing of update_cmd. +- Resolves: bug#1294789 +- Make YumHistoryRpmdbProblem objects hashable. +- Resolves: bug#1292087 +- Allow for validating attributes read from yumdb. +- Resolves: bug#1234967 + +* Tue Apr 05 2016 Valentina Mukhamedzhanova - 3.4.3-137 +- Honor proxy=_none_ set in yum.conf. +- Resolves: bug#1293670 +- Fix the default value for query_install_excludes config option. +- Resolves: bug#1291745 +- Add ftp_disable_epsv config option. +- Resolves: bug#1293378 +- Add ppc64le and aarch64 to rpmUtils.arch.arches. +- Resolves: bug#1272058 +- Clarify using 'group list' command for hidden groups in the man page. +- Resolves: bug#1279483 + +* Tue Mar 22 2016 Valentina Mukhamedzhanova - 3.4.3-136 +- Fix updateinfo to exclude wrong arch updates. +- Resolves: bug#1292160 +- Exclude duplicates from the list of security updates. +- Resolves: bug#1267897 +- Fix 'updateinfo list available' logic and make 'updates' the default. +- Resolves: bug#1292150 + +* Mon Mar 21 2016 Valentina Mukhamedzhanova - 3.4.3-135 +- Search new providers for realpath filenames. +- Resolves: bug#1235623 + +* Thu Mar 17 2016 Valentina Mukhamedzhanova - 3.4.3-134 +- Disable repo with skip_if_unavailable=True if repomd.xml can't be retrieved. +- Resolves: bug#1183669 + +* Wed Mar 16 2016 Valentina Mukhamedzhanova - 3.4.3-133 +- Fail on attempting to install a non-existent group. +- Resolves: bug#1267234 +- Add config options skip_missing_names_on_install and skip_missing_names_on_update. +- Resolves: bug#1274211 * Wed Sep 09 2015 Valentina Mukhamedzhanova - 3.4.3-132 - Don't fail on empty lines in group files.