include correct patch

Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
This commit is contained in:
Igor Gnatenko 2016-08-18 16:56:12 +02:00
parent 774430fd0f
commit 7b3d04d00a
3 changed files with 60 additions and 27 deletions

View File

@ -1,26 +0,0 @@
From 45f1dd636cb14cd45049393eb17238f518694455 Mon Sep 17 00:00:00 2001
From: Jaroslav Mracek <jmracek@redhat.com>
Date: Wed, 20 Jul 2016 16:44:07 +0200
Subject: [PATCH] Change name of def valid()
The change is required by privatization of non-API functions.
---
tests/support.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/support.py b/tests/support.py
index 31fb91f..3dbc4bd 100644
--- a/tests/support.py
+++ b/tests/support.py
@@ -161,7 +161,7 @@ class RepoStub(object):
self.priority = 99
self.cost = 1000
- def valid(self):
+ def _valid(self):
"""Return a message if the repository is not valid."""
def enable(self):
--
2.7.4

View File

@ -0,0 +1,59 @@
From 3809fe6889eeb884e78685fd940c81dedbb6df4f Mon Sep 17 00:00:00 2001
From: Michael Goodwin <xenithorb@users.noreply.github.com>
Date: Thu, 28 Jul 2016 14:54:53 -0400
Subject: [PATCH] cls.chroot_config inside _guess_chroot returns None (RhBug:
1361003)
---
plugins/copr.py | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/plugins/copr.py b/plugins/copr.py
index f24c202..3994f23 100644
--- a/plugins/copr.py
+++ b/plugins/copr.py
@@ -136,7 +136,7 @@ class CoprCommand(dnf.cli.Command):
try:
chroot = extcmds[2]
except IndexError:
- chroot = self._guess_chroot()
+ chroot = self._guess_chroot(self.chroot_config)
# commands without defined copr_username/copr_projectname
if subcommand == "list":
@@ -261,11 +261,11 @@ Do you want to continue? [y/N]: """)
raise dnf.exceptions.Error(
_('This command has to be run under the root user.'))
- @classmethod
- def _guess_chroot(cls):
+ @staticmethod
+ def _guess_chroot(chroot_config):
""" Guess which chroot is equivalent to this machine """
# FIXME Copr should generate non-specific arch repo
- dist = cls.chroot_config
+ dist = chroot_config
if dist is None or (dist[0] is False) or (dist[1] is False):
dist = platform.linux_distribution()
if "Fedora" in dist:
@@ -289,7 +289,7 @@ Do you want to continue? [y/N]: """)
def _download_repo(self, project_name, repo_filename, chroot=None):
if chroot is None:
- chroot = self._guess_chroot()
+ chroot = self._guess_chroot(self.chroot_config)
short_chroot = '-'.join(chroot.split('-')[:2])
#http://copr.fedorainfracloud.org/coprs/larsks/rcm/repo/epel-7-x86_64/
api_path = "/coprs/{0}/repo/{1}/".format(project_name, short_chroot)
@@ -434,7 +434,7 @@ Do you want to continue? [y/N]: """)
raise dnf.cli.CliError(
_('exactly one parameter to '
'playground command is required'))
- chroot = self._guess_chroot()
+ chroot = self._guess_chroot(self.chroot_config)
if subcommand == "enable":
self._cmd_enable(chroot)
logger.info(_("Playground repositories successfully enabled."))
--
2.7.4

View File

@ -15,7 +15,7 @@ Summary: Core Plugins for DNF
License: GPLv2+
URL: https://github.com/rpm-software-management/dnf-plugins-core
Source0: %{url}/archive/%{name}-%{version}/%{name}-%{version}.tar.gz
Patch0001: 0001-Change-name-of-def-valid.patch
Patch0001: 0001-cls.chroot_config-inside-_guess_chroot-returns-None-.patch
BuildArch: noarch
BuildRequires: cmake
BuildRequires: gettext