From a39ea63ae452f614e3f392a3aca89153e44be2bf44f362fa8fceac42a56c5f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= Date: Wed, 13 Jan 2021 11:14:15 +0000 Subject: [PATCH] osc copypac from project:systemsmanagement:saltstack:testing package:salt revision:378 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=182 --- _lastrevision | 2 +- ...-support-for-allow-vendor-change-opt.patch | 109 ++++++++++++++++++ salt.changes | 8 ++ salt.spec | 3 + 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 revert-add-patch-support-for-allow-vendor-change-opt.patch diff --git a/_lastrevision b/_lastrevision index 4f844f6..c48da37 100644 --- a/_lastrevision +++ b/_lastrevision @@ -1 +1 @@ -20d9e2d4f25a30971e2b5294d0f8124ab1205788 \ No newline at end of file +9d85a9b3aa831d4d880baab1e8488d3e3dbbc8f3 \ No newline at end of file diff --git a/revert-add-patch-support-for-allow-vendor-change-opt.patch b/revert-add-patch-support-for-allow-vendor-change-opt.patch new file mode 100644 index 0000000..be684c4 --- /dev/null +++ b/revert-add-patch-support-for-allow-vendor-change-opt.patch @@ -0,0 +1,109 @@ +From 84214c3f48c35af01ca750908a5e2e6009ecc919 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= + +Date: Wed, 13 Jan 2021 09:52:05 +0000 +Subject: [PATCH] Revert "add patch support for allow vendor change + option with zypper" + +This reverts commit cee4cc182b4740c912861c712dea7bc44eb70ffb. +--- + salt/modules/zypperpkg.py | 46 ++++++++++++--------------------------- + 1 file changed, 14 insertions(+), 32 deletions(-) + +diff --git a/salt/modules/zypperpkg.py b/salt/modules/zypperpkg.py +index 4a5cb85e7c..6f22994bf0 100644 +--- a/salt/modules/zypperpkg.py ++++ b/salt/modules/zypperpkg.py +@@ -35,6 +35,7 @@ import salt.utils.versions + from salt.exceptions import CommandExecutionError, MinionError, SaltInvocationError + + # pylint: disable=import-error,redefined-builtin,no-name-in-module ++from salt.ext import six + from salt.ext.six.moves import configparser + from salt.ext.six.moves.urllib.parse import urlparse as _urlparse + from salt.utils.versions import LooseVersion +@@ -1430,7 +1431,6 @@ def install( + no_recommends=False, + root=None, + inclusion_detection=False, +- novendorchange=True, + **kwargs + ): + """ +@@ -1478,10 +1478,6 @@ def install( + skip_verify + Skip the GPG verification check (e.g., ``--no-gpg-checks``) + +- +- novendorchange +- Disallow vendor change +- + version + Can be either a version number, or the combination of a comparison + operator (<, >, <=, >=, =) and a version number (ex. '>1.2.3-4'). +@@ -1642,22 +1638,6 @@ def install( + cmd_install.append( + kwargs.get("resolve_capabilities") and "--capability" or "--name" + ) +- if novendorchange: +- if __grains__["osrelease_info"][0] > 11: +- cmd_install.append("--no-allow-vendor-change") +- log.info("Disabling vendor changes") +- else: +- log.warning( +- "Enabling/Disabling vendor changes is not supported on this Zypper version" +- ) +- else: +- if __grains__["osrelease_info"][0] > 11: +- cmd_install.append("--allow-vendor-change") +- log.info("Enabling vendor changes") +- else: +- log.warning( +- "Enabling/Disabling vendor changes is not supported on this Zypper version" +- ) + + if not refresh: + cmd_install.insert(0, "--no-refresh") +@@ -1669,6 +1649,7 @@ def install( + cmd_install.extend(fromrepoopt) + if no_recommends: + cmd_install.append("--no-recommends") ++ + errors = [] + + # Split the targets into batches of 500 packages each, so that +@@ -1812,18 +1793,19 @@ def upgrade( + cmd_update.extend(["--from" if dist_upgrade else "--repo", repo]) + log.info("Targeting repos: %s", fromrepo) + +- # TODO: Grains validation should be moved to Zypper class +- if __grains__["osrelease_info"][0] > 11: +- if novendorchange: +- cmd_update.append("--no-allow-vendor-change") +- log.info("Disabling vendor changes") ++ if dist_upgrade: ++ # TODO: Grains validation should be moved to Zypper class ++ if __grains__["osrelease_info"][0] > 11: ++ if novendorchange: ++ cmd_update.append("--no-allow-vendor-change") ++ log.info("Disabling vendor changes") ++ else: ++ cmd_update.append("--allow-vendor-change") ++ log.info("Enabling vendor changes") + else: +- cmd_update.append("--allow-vendor-change") +- log.info("Enabling vendor changes") +- else: +- log.warning( +- "Enabling/Disabling vendor changes is not supported on this Zypper version" +- ) ++ log.warning( ++ "Enabling/Disabling vendor changes is not supported on this Zypper version" ++ ) + + if no_recommends: + cmd_update.append("--no-recommends") +-- +2.29.2 + + diff --git a/salt.changes b/salt.changes index ae7bec9..64d4cbc 100644 --- a/salt.changes +++ b/salt.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Jan 13 10:13:13 UTC 2021 - Pablo Suárez Hernández + +- Revert wrong zypper patch to support vendorchanges flags on pkg.install + +- Added: + * revert-add-patch-support-for-allow-vendor-change-opt.patch + ------------------------------------------------------------------- Tue Jan 12 12:09:35 UTC 2021 - Pablo Suárez Hernández diff --git a/salt.spec b/salt.spec index edae7b3..27abd04 100644 --- a/salt.spec +++ b/salt.spec @@ -344,6 +344,8 @@ Patch141: add-pkg.services_need_restart-302.patch Patch142: add-patch-support-for-allow-vendor-change-option-wit.patch # PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/304 Patch143: force-zyppnotify-to-prefer-packages.db-than-packages.patch +# PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/commit/4028fd6e84d882b6dcee695d409c7e1ed6c83bdc +Patch144: revert-add-patch-support-for-allow-vendor-change-opt.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: logrotate @@ -886,6 +888,7 @@ cp %{S:5} ./.travis.yml %patch141 -p1 %patch142 -p1 %patch143 -p1 +%patch144 -p1 %build # Putting /usr/bin at the front of $PATH is needed for RHEL/RES 7. Without this