diff --git a/SOURCES/BZ-1403015-yum-config-manager-select-disabled-repoid-setopts.patch b/SOURCES/BZ-1403015-yum-config-manager-select-disabled-repoid-setopts.patch new file mode 100644 index 0000000..7c9cd11 --- /dev/null +++ b/SOURCES/BZ-1403015-yum-config-manager-select-disabled-repoid-setopts.patch @@ -0,0 +1,109 @@ +diff -up yum-utils-1.1.31/docs/yum-config-manager.1.orig yum-utils-1.1.31/docs/yum-config-manager.1 +--- yum-utils-1.1.31/docs/yum-config-manager.1.orig 2017-02-27 18:04:05.377037276 +0100 ++++ yum-utils-1.1.31/docs/yum-config-manager.1 2017-02-27 18:04:06.648030205 +0100 +@@ -3,20 +3,38 @@ + .SH "NAME" + yum-config-manager \- manage yum configuration options and yum repositories + .SH "SYNOPSIS" +-\fByum-config-manager\fP [options] ++\fByum-config-manager\fP [options] [section ...] + .SH "DESCRIPTION" + .PP + \fByum-config-manager\fP is a program that can manage main yum configuration + options, toggle which repositories are enabled or disabled, and add new + repositories. + .PP ++Unless \-\-add-repo is used, the program will output the current configuration ++of the selected sections, and optionally save it back to the corresponding ++files. ++.PP ++By default, if no positional arguments are specified, the program will select ++the [main] section and each enabled repository. ++You can override this by specifying your own list of sections as arguments ++(these may also include disabled repositories). ++A section can either be main or a repoid. ++.PP + .SH "OPTIONS" + .IP "\fB\-h, \-\-help\fP" + Display a help message, and then quit. ++.IP "\fB\-\-setopt=option=value\fP" ++Set any config option in yum config or repo files. For options in the global ++config just use: \-\-setopt=option=value for repo options use: \-\-setopt=repoid.option=value. ++The latter form accepts wildcards in repoid that will be expanded to the ++selected sections. ++If repoid contains no wildcard, it will automatically be selected; this is ++useful if you are addressing a disabled repo, in which case you don't have to ++additionally pass it as an argument. + .IP "\fB\-\-save\fP" + Save the current options (useful with \-\-setopt). + .IP "\fB\-\-enable\fP" +-Enable the specified repos (automatically saves). To enable all repositories run 'yum-config-manager --enable \\*". ++Enable the specified repos (automatically saves). To enable all repositories run "yum-config-manager --enable \\*". + .IP "\fB\-\-disable\fP" + Disable the specified repos (automatically saves). To disable all repositories run "yum-config-manager --disable \\*". + .IP "\fB\-\-add\-repo=ADDREPO\fP" +@@ -25,6 +43,36 @@ Add (and enable) the repo from the speci + Yum-config-manager inherits all other options from yum. See the yum(8) + man page for more information. + ++.SH "EXAMPLES" ++Show the configuration of [main] and the repos foo and bar: ++.IP ++\fByum-config-manager main foo bar\fP ++.PP ++Enable the repos foo and bar: ++.IP ++\fByum-config-manager --enable foo bar\fP ++.PP ++Change a global option: ++.IP ++\fByum-config-manager --setopt=installonly_limit=5 --save\fP ++.PP ++Change a repo option of the repo foo (works even if foo is disabled): ++.IP ++\fByum-config-manager --setopt=foo.skip_if_unavailable=1 --save\fP ++.PP ++Change a repo option of more repos at once: ++.IP ++\fByum-config-manager --setopt=\\*.skip_if_unavailable=1 --save foo bar baz\fP ++.PP ++Change a repo option of all the enabled repos: ++.IP ++\fByum-config-manager --setopt=\\*.skip_if_unavailable=1 --save\fP ++.PP ++Change a repo option of all the configured (that is, enabled and disabled) ++repos: ++.IP ++\fByum-config-manager --setopt=\\*.skip_if_unavailable=1 --save \\*\fP ++ + .PP + .SH "SEE ALSO" + .nf +diff -up yum-utils-1.1.31/yum-config-manager.py.orig yum-utils-1.1.31/yum-config-manager.py +--- yum-utils-1.1.31/yum-config-manager.py.orig 2017-02-27 18:04:05.367037332 +0100 ++++ yum-utils-1.1.31/yum-config-manager.py 2017-02-27 18:04:40.143843850 +0100 +@@ -107,7 +107,7 @@ def match_repoid(repoid, repo_setopts): + + NAME = 'yum-config-manager' + VERSION = '1.0' +-USAGE = '"yum-config-manager [options] [section]' ++USAGE = 'yum-config-manager [options] [section ...]' + + yum.misc.setup_locale() + +@@ -180,6 +180,15 @@ if args: + else: + repos = yb.repos.listEnabled() + ++# Automatically select repos specified within --setopt (but only for exact ++# matches without wildcards). This way users don't have to specify disabled ++# repos twice on the cmdline. ++if hasattr(yb, 'repo_setopts') and yb.repo_setopts: ++ ids = set(yb.repo_setopts.keys()) & set(yb.repos.repos.keys()) ++ ids -= set([r.id for r in repos]) ++ repos += yb.repos.findRepos(','.join(ids), ++ name_match=True, ignore_case=True) ++ + if not opts.addrepo: + for repo in sorted(repos): + print yb.fmtSection('repo: ' + repo.id) diff --git a/SOURCES/BZ-1406891-verify-exit-status.patch b/SOURCES/BZ-1406891-verify-exit-status.patch new file mode 100644 index 0000000..ec5f7df --- /dev/null +++ b/SOURCES/BZ-1406891-verify-exit-status.patch @@ -0,0 +1,85 @@ +commit f62551849e0f8c5cc3151d78af0975fad831e8ed +Author: Valentina Mukhamedzhanova +Date: Tue Oct 18 10:31:11 2016 +0200 + + yum-plugin-verify: set exit status to 1 in case of problems. + +diff --git a/plugins/verify/verify.py b/plugins/verify/verify.py +index 108f96e..94eca26 100644 +--- a/plugins/verify/verify.py ++++ b/plugins/verify/verify.py +@@ -287,6 +287,7 @@ Verify packages and display data on bad verifications""" + + def show_data(self, base, msg, pkgs, name): + done = False ++ problem_found = False + mcb = lambda x: base.matchcallback(x, []) + for (pkg, results) in self.filter_data(msg, pkgs): + if not done: +@@ -310,11 +311,13 @@ Verify packages and display data on bad verifications""" + (hib, hie) = ("", "") + done_prob = False + for problem in sorted(results[fname]): ++ problem_found = True + if not done_prob and problem.file_types: + tags = ", ".join(problem.file_types) + msg(" Tags: " + hib + tags + hie) + self.show_problem(base, msg, problem, done_prob) + done_prob = True ++ return problem_found + + def doCommand(self, base, basecmd, extcmds): + global _verify_configs +@@ -360,10 +363,10 @@ Verify packages and display data on bad verifications""" + # nevr() match + + ypl = base.returnPkgLists(subgroup + extcmds) +- self.show_data(base, msg, ypl.installed, 'Installed Packages') +- self.show_data(base, msg, ypl.extras, 'Extra Packages') ++ result = (self.show_data(base, msg, ypl.installed, 'Installed Packages') ++ or self.show_data(base, msg, ypl.extras, 'Extra Packages')) + +- return 0, [basecmd + ' done'] ++ return result, [basecmd + ' done'] + + def needTs(self, base, basecmd, extcmds): + if not len(extcmds) or extcmds[0] != 'extras': + +commit 7a94cf4434107bfcb32e60420af2106b993c7381 +Author: Michal Domonkos +Date: Thu Feb 16 17:47:53 2017 +0100 + + docs: verify: fix wording. BZ 1406891 + +diff --git a/docs/yum-verify.1 b/docs/yum-verify.1 +index 5246a1c..1a8cc11 100644 +--- a/docs/yum-verify.1 ++++ b/docs/yum-verify.1 +@@ -6,7 +6,7 @@ yum verify plugin + \fByum\fP [options] verify [package ...] + .SH "DESCRIPTION" + .PP +-This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm \-V. You can change how the verification is done and which files it applies to. ++This plugin extends \fByum\fP with some commands that give verification information on the installed system, much like rpm \-V. You can change how the verification is done and which files it applies to. In case any mismatches are found, the exit status is set to 1. + .PP + added yum \fIcommand\fPs are: + .br +@@ -17,7 +17,7 @@ added yum \fIcommand\fPs are: + .I \fR * verify-all + .br + .PP +-all of which take the same arguments as the list yum command, obviously you can ++all of which take the same arguments as the list yum command. You can + only verify packages that are installed on the system. + .PP + .br +@@ -29,8 +29,7 @@ output. It removes all false matches due to multilib and ignores changes to + configuration files by default. + .IP + .IP "\fBverify-rpm\fP" +-Is meant to be 100% compatible with rpm \-V output, and any differences should be +-considered as bugs. ++Does the same checks as rpm \-V. + .IP + .IP "\fBverify-all\fP" + Is used to list all the differences, including some that rpm itself will ignore. diff --git a/SOURCES/BZ-1429831-yum-copr.patch b/SOURCES/BZ-1429831-yum-copr.patch new file mode 100644 index 0000000..1485c61 --- /dev/null +++ b/SOURCES/BZ-1429831-yum-copr.patch @@ -0,0 +1,473 @@ +diff -N -up -r a/docs/Makefile b/docs/Makefile +--- a/docs/Makefile 2017-03-21 14:21:12.326518685 +0100 ++++ b/docs/Makefile 2017-03-21 14:24:34.711624331 +0100 +@@ -5,7 +5,7 @@ DOCS = repoquery package-cleanup repo-rs + find-repos-of-install needs-restarting repo-graph repoclosure \ + repomanage repotrack verifytree yum-config-manager yum-ovl + DOCS5 = yum-changelog.conf yum-versionlock.conf yum-fs-snapshot.conf +-DOCS8 = yum-complete-transaction yumdb ++DOCS8 = yum-complete-transaction yumdb yum-copr + + all: + echo "Nothing to do" +diff -N -up -r a/docs/yum-copr.8 b/docs/yum-copr.8 +--- a/docs/yum-copr.8 1970-01-01 01:00:00.000000000 +0100 ++++ b/docs/yum-copr.8 2017-03-21 14:23:17.436729456 +0100 +@@ -0,0 +1,120 @@ ++.\" Man page generated from reStructuredText. ++. ++.TH "YUM-COPR" "8" "July 29, 2014" "0.1.1" "yum-plugin-copr" ++.SH NAME ++yum-plugin-copr \- YUM copr Plugin ++. ++.nr rst2man-indent-level 0 ++. ++.de1 rstReportMargin ++\\$1 \\n[an-margin] ++level \\n[rst2man-indent-level] ++level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] ++- ++\\n[rst2man-indent0] ++\\n[rst2man-indent1] ++\\n[rst2man-indent2] ++.. ++.de1 INDENT ++.\" .rstReportMargin pre: ++. RS \\$1 ++. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] ++. nr rst2man-indent-level +1 ++.\" .rstReportMargin post: ++.. ++.de UNINDENT ++. RE ++.\" indent \\n[an-margin] ++.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.nr rst2man-indent-level -1 ++.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.in \\n[rst2man-indent\\n[rst2man-indent-level]]u ++.. ++. ++.nr rst2man-indent-level 0 ++. ++.de1 rstReportMargin ++\\$1 \\n[an-margin] ++level \\n[rst2man-indent-level] ++level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] ++- ++\\n[rst2man-indent0] ++\\n[rst2man-indent1] ++\\n[rst2man-indent2] ++.. ++.de1 INDENT ++.\" .rstReportMargin pre: ++. RS \\$1 ++. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] ++. nr rst2man-indent-level +1 ++.\" .rstReportMargin post: ++.. ++.de UNINDENT ++. RE ++.\" indent \\n[an-margin] ++.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.nr rst2man-indent-level -1 ++.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] ++.in \\n[rst2man-indent\\n[rst2man-indent-level]]u ++.. ++.sp ++Work with Copr & Playground repositories on the local system. ++.INDENT 0.0 ++.IP \(bu 2 ++The \fBcopr\fP command is used to add or remove Copr repositories to the local system ++.IP \(bu 2 ++The \fBplayground\fP is used to enable or disable the Playground repository ++.UNINDENT ++.SH SYNOPSIS ++.sp ++\fByum copr [enable|disable|list|search] \fP ++.sp ++\fByum playground [enable|disable|upgrade]\fP ++.SH ARGUMENTS (COPR) ++.INDENT 0.0 ++.TP ++.B \fBenable name/project [chroot]\fP ++Enable the \fBname/project\fP Copr repository with the optional \fBchroot\fP\&. ++.TP ++.B \fBdisable name/project\fP ++Disable the \fBname/project\fP Copr repository. ++.TP ++.B \fBlist name\fP ++List available Copr repositories for a given \fBname\fP\&. ++.TP ++.B \fBsearch project\fP ++Search for a given \fBproject\fP\&. ++.UNINDENT ++.SH ARGUMENTS (PLAYGROUND) ++.INDENT 0.0 ++.TP ++.B \fBenable\fP ++Enable the Playground repository. ++.TP ++.B \fBdisable\fP ++Disable the Playground repository. ++.TP ++.B \fBupgrade\fP ++Upgrade the Playground repository settings (same as \fBdisable\fP and then \fBenable\fP). ++.UNINDENT ++.SH EXAMPLES ++.INDENT 0.0 ++.TP ++.B \fBcopr enable rhscl/perl516 epel\-6\-x86_64\fP ++Enable the \fBrhscl/perl516\fP Copr repository, using the \fBepel\-6\-x86_64\fP chroot. ++.TP ++.B \fBcopr disable rhscl/perl516\fP ++Disable the \fBrhscl/perl516\fP Copr repository ++.TP ++.B \fBcopr list rita\fP ++List available Copr projects for user \fBrita\fP\&. ++.TP ++.B \fBcopr search tests\fP ++Search for Copr projects named \fBtests\fP\&. ++.UNINDENT ++.SH AUTHOR ++See AUTHORS in the Core DNF Plugins distribution ++.SH COPYRIGHT ++2014, Red Hat, Licensed under GPLv2+ ++.\" Generated by docutils manpage writer. ++. +diff -N -up -r a/plugins/copr/copr.conf b/plugins/copr/copr.conf +--- a/plugins/copr/copr.conf 1970-01-01 01:00:00.000000000 +0100 ++++ b/plugins/copr/copr.conf 2017-03-21 14:22:49.094134790 +0100 +@@ -0,0 +1,2 @@ ++[main] ++enabled=1 +diff -N -up -r a/plugins/copr/copr.py b/plugins/copr/copr.py +--- a/plugins/copr/copr.py 1970-01-01 01:00:00.000000000 +0100 ++++ b/plugins/copr/copr.py 2017-03-21 14:22:49.095134776 +0100 +@@ -0,0 +1,327 @@ ++# supplies the 'copr' command. ++# ++# Copyright (C) 2014 Red Hat, Inc. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions of ++# the GNU General Public License v.2, or (at your option) any later version. ++# This program is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY expressed or implied, including the implied warranties of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General ++# Public License for more details. You should have received a copy of the ++# GNU General Public License along with this program; if not, write to the ++# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the ++# source code or documentation are not subject to the GNU General Public ++# License and may only be used or replicated with the express permission of ++# Red Hat, Inc. ++# ++ ++"""YUM plugin supplying the 'copr' command.""" ++ ++from urlgrabber import grabber ++ ++import yum ++import glob ++import json ++import os ++import platform ++import requests ++import urllib ++ ++from yum.i18n import _ ++from yum.plugins import TYPE_INTERACTIVE ++ ++requires_api_version = '2.5' ++plugin_type = (TYPE_INTERACTIVE,) ++ ++yes = set([_('yes'), _('y')]) ++no = set([_('no'), _('n'), '']) ++ ++YError = yum.Errors.YumBaseError ++YCliError = yum.Errors.MiscError ++ ++def config_hook(conduit): ++ conduit.registerCommand(CoprCommand()) ++ conduit.registerCommand(PlaygroundCommand()) ++ ++class CoprCommand: ++ """ Copr plugin for DNF """ ++ ++ def getNames(self): ++ return [self.aliases[0]] ++ ++ def getUsage(self): ++ return self.usage ++ ++ def getSummary(self): ++ return self.summary[1:] ++ ++ def doCheck(self, base, basecmd, extcmds): ++ self.base = base ++ ++ copr_url = "https://copr.fedoraproject.org" ++ aliases = ("copr",) ++ summary = _("Interact with Copr repositories.") ++ usage = _(""" ++ enable name/project [chroot] ++ disable name/project ++ list name ++ search project ++ ++ Examples: ++ copr enable rhscl/perl516 epel-6-x86_64 ++ copr enable ignatenkobrain/ocltoys ++ copr disable rhscl/perl516 ++ copr list ignatenkobrain ++ copr search tests ++ """) ++ ++ def doCommand(self, base, basecmd, extcmds): ++ try: ++ subcommand = extcmds[0] ++ project_name = extcmds[1] ++ except (ValueError, IndexError): ++ base.logger.critical( ++ _('Error: ') + ++ _('exactly two additional parameters to ' ++ 'copr command are required')) ++ # FIXME ++ # dnf.cli.commands.err_mini_usage(self.cli, self.cli.base.basecmd) ++ raise YCliError( ++ _('exactly two additional parameters to ' ++ 'copr command are required')) ++ try: ++ chroot = extcmds[2] ++ except IndexError: ++ chroot = self._guess_chroot() ++ repo_filename = "/etc/yum.repos.d/_copr_{}.repo" \ ++ .format(project_name.replace("/", "-")) ++ if subcommand == "enable": ++ self._need_root() ++ self._ask_user(""" ++You are about to enable a Copr repository. Please note that this ++repository is not part of the main Fedora distribution, and quality ++may vary. ++ ++The Fedora Project does not exercise any power over the contents of ++this repository beyond the rules outlined in the Copr FAQ at ++, and ++packages are not held to any quality or securty level. ++ ++Please do not file bug reports about these packages in Fedora ++Bugzilla. In case of problems, contact the owner of this repository. ++ ++Do you want to continue? [y/N]: """) ++ self._download_repo(project_name, repo_filename, chroot) ++ base.logger.info(_("Repository successfully enabled.")) ++ elif subcommand == "disable": ++ self._need_root() ++ self._remove_repo(repo_filename) ++ base.logger.info(_("Repository successfully disabled.")) ++ elif subcommand == "list": ++ #http://copr.fedoraproject.org/api/coprs/ignatenkobrain/ ++ api_path = "/api/coprs/{}/".format(project_name) ++ ++ opener = urllib.FancyURLopener({}) ++ res = opener.open(self.copr_url + api_path) ++ try: ++ json_parse = json.loads(res.read()) ++ except ValueError: ++ raise YError( ++ _("Can't parse repositories for username '{}'.") ++ .format(project_name)) ++ section_text = _("List of {} coprs").format(project_name) ++ self._print_match_section(section_text) ++ i = 0 ++ while i < len(json_parse["repos"]): ++ msg = "{0}/{1} : ".format(project_name, ++ json_parse["repos"][i]["name"]) ++ desc = json_parse["repos"][i]["description"] ++ if not desc: ++ desc = _("No description given") ++ msg = self.base.fmtKeyValFill(unicode(msg), desc) ++ print(msg) ++ i += 1 ++ elif subcommand == "search": ++ #http://copr.fedoraproject.org/api/coprs/search/tests/ ++ api_path = "/api/coprs/search/{}/".format(project_name) ++ ++ opener = urllib.FancyURLopener({}) ++ res = opener.open(self.copr_url + api_path) ++ try: ++ json_parse = json.loads(res.read()) ++ except ValueError: ++ raise YError(_("Can't parse search for '{}'.").format(project_name)) ++ section_text = _("Matched: {}").format(project_name) ++ self._print_match_section(section_text) ++ i = 0 ++ while i < len(json_parse["repos"]): ++ msg = "{0}/{1} : ".format(json_parse["repos"][i]["username"], json_parse["repos"][i]["coprname"]) ++ desc = json_parse["repos"][i]["description"] ++ if not desc: ++ desc = _("No description given.") ++ msg = self.base.fmtKeyValFill(unicode(msg), desc) ++ print(msg) ++ i += 1 ++ else: ++ raise YError( ++ _('Unknown subcommand {}.').format(subcommand)) ++ ++ return 0, [basecmd + ' done'] ++ ++ def _print_match_section(self, text): ++ formatted = self.base.fmtSection(text) ++ print(formatted) ++ ++ def _ask_user(self, question): ++ if self.base.conf.assumeyes and not self.base.conf.assumeno: ++ return ++ elif self.base.conf.assumeno and not self.base.conf.assumeyes: ++ raise YError(_('Safe and good answer. Exiting.')) ++ ++ answer = raw_input(question).lower() ++ answer = _(answer) ++ while not ((answer in yes) or (answer in no)): ++ answer = raw_input(question).lower() ++ answer = _(answer) ++ if answer in yes: ++ return ++ else: ++ raise YError(_('Safe and good answer. Exiting.')) ++ ++ @classmethod ++ def _need_root(cls): ++ # FIXME this should do dnf itself (BZ#1062889) ++ if os.geteuid() != 0: ++ raise YError( ++ _('This command has to be run under the root user.')) ++ ++ @classmethod ++ def _guess_chroot(cls): ++ """ Guess which choot is equivalent to this machine """ ++ # FIXME Copr should generate non-specific arch repo ++ dist = platform.linux_distribution() ++ if "Fedora" in dist: ++ # x86_64 because repo-file is same for all arch ++ # ($basearch is used) ++ if "Rawhide" in dist: ++ chroot = ("fedora-rawhide-x86_64") ++ else: ++ chroot = ("fedora-{}-x86_64".format(dist[1])) ++ else: ++ chroot = ("epel-%s-x86_64" % dist[1].split(".", 1)[0]) ++ return chroot ++ ++ @classmethod ++ def _download_repo(cls, project_name, repo_filename, chroot=None): ++ if chroot is None: ++ chroot = cls._guess_chroot() ++ #http://copr.fedoraproject.org/coprs/larsks/rcm/repo/epel-7-x86_64/ ++ api_path = "/coprs/{0}/repo/{1}/".format(project_name, chroot) ++ ug = grabber.URLGrabber() ++ # FIXME when we are full on python2 urllib.parse ++ try: ++ ug.urlgrab(cls.copr_url + api_path, filename=repo_filename) ++ except grabber.URLGrabError as e: ++ cls._remove_repo(repo_filename) ++ raise YError(str(e)) ++ ++ @classmethod ++ def _remove_repo(cls, repo_filename): ++ # FIXME is it Copr repo ? ++ try: ++ os.remove(repo_filename) ++ except OSError as e: ++ raise YError(str(e)) ++ ++ @classmethod ++ def _get_data(cls, req): ++ """ Wrapper around response from server ++ ++ check data and print nice error in case of some error (and return None) ++ otherwise return json object. ++ """ ++ try: ++ output = json.loads(req.text) ++ except ValueError: ++ YCliError(_("Unknown response from server.")) ++ return ++ if req.status_code != 200: ++ YCliError(_( ++ "Something went wrong:\n {0}\n".format(output["error"]))) ++ return ++ return output ++ ++ ++class PlaygroundCommand(CoprCommand): ++ """ Playground plugin for DNF """ ++ ++ aliases = ("playground",) ++ summary = _("Interact with Playground repository.") ++ usage = " [enable|disable|upgrade]" ++ ++ def _cmd_enable(self, chroot): ++ self._need_root() ++ self._ask_user(""" ++You are about to enable a Playground repository. ++ ++Do you want to continue? [y/N]: """) ++ api_url = "{0}/api/playground/list/".format( ++ self.copr_url) ++ req = requests.get(api_url) ++ output = self._get_data(req) ++ if output["output"] != "ok": ++ raise YCliError(_("Unknown response from server.")) ++ for repo in output["repos"]: ++ project_name = "{0}/{1}".format(repo["username"], ++ repo["coprname"]) ++ repo_filename = "/etc/yum.repos.d/_playground_{}.repo" \ ++ .format(project_name.replace("/", "-")) ++ try: ++ # check if that repo exist? but that will result in twice ++ # up calls ++ api_url = "{0}/api/coprs/{1}/detail/{2}/".format( ++ self.copr_url, project_name, chroot) ++ req = requests.get(api_url) ++ output2 = self._get_data(req) ++ if output2 and ("output" in output2) and (output2["output"] == "ok"): ++ self._download_repo(project_name, repo_filename, chroot) ++ except YError: ++ # likely 404 and that repo does not exist ++ pass ++ ++ def _cmd_disable(self): ++ self._need_root() ++ for repo_filename in glob.glob('/etc/yum.repos.d/_playground_*.repo'): ++ self._remove_repo(repo_filename) ++ ++ def doCommand(self, base, basecmd, extcmds): ++ try: ++ subcommand = extcmds[0] ++ except (ValueError, IndexError): ++ base.logger.critical( ++ _('Error: ') + ++ _('exactly one parameter to ' ++ 'playground command are required')) ++ # FIXME: ++ # dnf.cli.commands.err_mini_usage(self.cli, self.cli.base.basecmd) ++ raise YCliError( ++ _('exactly one parameter to ' ++ 'playground command are required')) ++ chroot = self._guess_chroot() ++ if subcommand == "enable": ++ self._cmd_enable(chroot) ++ base.logger.info(_("Playground repositories successfully enabled.")) ++ elif subcommand == "disable": ++ self._cmd_disable() ++ base.logger.info(_("Playground repositories successfully disabled.")) ++ elif subcommand == "upgrade": ++ self._cmd_disable() ++ self._cmd_enable(chroot) ++ base.logger.info(_("Playground repositories successfully updated.")) ++ else: ++ raise YError( ++ _('Unknown subcommand {}.').format(subcommand)) ++ ++ return 0, [basecmd + ' done'] diff --git a/SPECS/yum-utils.spec b/SPECS/yum-utils.spec index 5901efd..52d2722 100644 --- a/SPECS/yum-utils.spec +++ b/SPECS/yum-utils.spec @@ -12,7 +12,7 @@ Summary: Utilities based around the yum package manager Name: yum-utils Version: 1.1.31 -Release: 40%{?dist} +Release: 42%{?dist} License: GPLv2+ Group: Development/Tools Source: http://yum.baseurl.org/download/yum-utils/%{name}-%{version}.tar.gz @@ -57,6 +57,11 @@ Patch129: BZ-1192946-needs-restarting-add-reboothint-opt.patch Patch130: BZ-1335587-needs-restarting-add-services-opt.patch Patch131: BZ-1329649-reposync-download-metadata-manpage.patch +#rhel-7.4 +Patch150: BZ-1403015-yum-config-manager-select-disabled-repoid-setopts.patch +Patch151: BZ-1406891-verify-exit-status.patch +Patch152: BZ-1429831-yum-copr.patch + URL: http://yum.baseurl.org/download/yum-utils/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -408,6 +413,16 @@ Requires: puppet Supplies checksums for files in packages from puppet's state file. %endif +%package -n yum-plugin-copr +Summary: Yum plugin to add copr command +Group: System Environment/Base +Provides: yum-copr = %{version}-%{release} +Requires: yum >= 3.4.3 +Requires: python-requests + +%description -n yum-plugin-copr +This plugin adds the command copr, for adding/listing/searching copr repos. + %package -n yum-plugin-ovl Summary: Yum plugin to work around overlayfs issues Group: System Environment/Base @@ -460,6 +475,11 @@ This plugin touches rpmdb files to work around overlayfs issues. %patch130 -p1 %patch131 -p1 +#rhel-7.4 +%patch150 -p1 +%patch151 -p1 +%patch152 -p1 + %install rm -rf $RPM_BUILD_ROOT make DESTDIR=$RPM_BUILD_ROOT install @@ -492,6 +512,7 @@ plugins="\ fs-snapshot \ ps \ ovl \ + copr \ " %if %{package_puppetverify} plugins="$plugins \ @@ -763,6 +784,13 @@ fi %{pluginhome}/puppetverify.* %endif +%files -n yum-plugin-copr +%defattr(-, root, root) +%doc COPYING +%config(noreplace) %{_sysconfdir}/yum/pluginconf.d/copr.conf +%{pluginhome}/copr.* +%{_mandir}/man8/yum-copr.8.* + %files -n yum-plugin-ovl %defattr(-, root, root) %doc COPYING @@ -771,6 +799,16 @@ fi %{_mandir}/man1/yum-ovl.1.* %changelog +* Tue Mar 21 2017 Valentina Mukhamedzhanova - 1.1.31-42 +- Add yum-plugin-copr. +- Resolves: bug#1429831 + +* Thu Mar 09 2017 Valentina Mukhamedzhanova - 1.1.31-41 +- yum-config-manager: only select exact matches from --setopt. +- Resolves: bug#1403015 +- yum-plugin-verify: set exit status to 1 in case of problems. +- Resolves: bug#1406891 + * Thu Aug 04 2016 Valentina Mukhamedzhanova - 1.1.31-40 - needs-restarting: rework reboothint logic. - Related: bug#1192946