Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 926614 Details for
Bug 1129932
Mock should expose yum --enablerepo and --disablerepo
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Add --enablerepo and --disablerepo to mock
0001-Permit-enablerepo-and-disablerepo-to-be-passed-throu.patch (text/plain), 3.43 KB, created by
Craig Ringer
on 2014-08-14 03:09:09 UTC
(
hide
)
Description:
Add --enablerepo and --disablerepo to mock
Filename:
MIME Type:
Creator:
Craig Ringer
Created:
2014-08-14 03:09:09 UTC
Size:
3.43 KB
patch
obsolete
>From d8566486bca0443da0a1efe8a1feb2784f8ec998 Mon Sep 17 00:00:00 2001 >From: Craig Ringer <craig@2ndquadrant.com> >Date: Thu, 14 Aug 2014 11:08:18 +0800 >Subject: [PATCH] Permit --enablerepo and --disablerepo to be passed through to > yum > >--- > py/mock.py | 9 +++++++++ > py/mockbuild/backend.py | 24 ++++++++++++++++++++++++ > 2 files changed, 33 insertions(+) > >diff --git a/py/mock.py b/py/mock.py >index ebc3fd8..a2f7ff3 100755 >--- a/py/mock.py >+++ b/py/mock.py >@@ -111,6 +111,10 @@ def command_parse(config_opts): > parser.add_option("--remove", action="store_const", const="remove", > dest="mode", > help="remove packages using yum") >+ parser.add_option("--enablerepo", action="append", >+ help="Enable a repository in the target file. Maybe specified multiple times.") >+ parser.add_option("--disablerepo", action="append", >+ help="Disable a repository in the target file. Maybe specified multiple times.") > parser.add_option("--orphanskill", action="store_const", const="orphanskill", > dest="mode", > help="Kill all processes using specified buildroot.") >@@ -524,6 +528,11 @@ def main(ret): > log.info("mock.py version %s starting..." % __VERSION__) > chroot = mockbuild.backend.Root(config_opts, uidManager) > >+ if options.enablerepo is not None: >+ chroot.enablerepos(options.enablerepo) >+ if options.disablerepo is not None: >+ chroot.disablerepos(options.disablerepo) >+ > chroot.start("run") > > if options.printrootpath: >diff --git a/py/mockbuild/backend.py b/py/mockbuild/backend.py >index 3e49fe0..f62d873 100644 >--- a/py/mockbuild/backend.py >+++ b/py/mockbuild/backend.py >@@ -143,6 +143,9 @@ class Root(object): > > self.extra_chroot_dirs = config['extra_chroot_dirs'] > >+ self.enabledrepos = [] >+ self.disabledrepos = [] >+ > # ============= > # 'Public' API > # ============= >@@ -918,6 +921,19 @@ class Root(object): > self._callHooks('postbuild') > self.finish("buildsrpm") > >+ def enablerepos(self, repos): >+ if repos is not None: >+ self.enabledrepos.extend(repos) >+ for r in self.disabledrepos: >+ if r in repos: >+ self.disabledrepos.remove(r) >+ >+ def disablerepos(self, repos): >+ if repos is not None: >+ self.disabledrepos.extend(repos) >+ for r in self.enabledrepos: >+ if r in repos: >+ self.enabledrepos.remove(r) > > # ============= > # 'Private' API >@@ -990,6 +1006,13 @@ class Root(object): > if self.yum_builddep_opts: > for eachopt in self.yum_builddep_opts.split(): > yumcmd.insert(1, '%s' % eachopt) >+ # Process options and flags >+ for r in self.enabledrepos: >+ yumcmd.append("--enablerepo") >+ yumcmd.append(r) >+ for r in self.disabledrepos: >+ yumcmd.append("--disablerepo") >+ yumcmd.append(r) > yumcmd.extend(('--installroot', self.makeChrootPath())) > if self.releasever: > yumcmd.extend(('--releasever', self.releasever)) >@@ -998,6 +1021,7 @@ class Root(object): > yumcmd.extend(self.yum_common_opts) > yumcmd.extend(cmd[cmdix:]) > self.root_log.debug(yumcmd) >+ # And run it > output = "" > self._nuke_rpm_db() > try: >-- >1.9.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1129932
: 926614