Skip to content

Commit

Permalink
Add a "--disableincludes" option to yum. BZ 911422
Browse files Browse the repository at this point in the history
  • Loading branch information
Zdenek Pavlas committed Aug 5, 2013
1 parent bfdfefd commit bba27df
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2208,11 +2208,8 @@ def setupYumConfig(self, args=None):
if opts.color != 'auto':
self.base.term.reinit(color=opts.color)

if opts.disableexcludes:
disable_excludes = self._splitArg(opts.disableexcludes)
else:
disable_excludes = []
self.base.conf.disable_excludes = disable_excludes
self.base.conf.disable_excludes = self._splitArg(opts.disableexcludes)
self.base.conf.disable_includes = self._splitArg(opts.disableincludes)

for exclude in self._splitArg(opts.exclude):
try:
Expand Down Expand Up @@ -2375,6 +2372,9 @@ def repo_optcb(optobj, opt, value, parser):
group.add_option("", "--disableexcludes", default=[], action="append",
help=_("disable exclude from main, for a repo or for everything"),
metavar='[repo]')
group.add_option("", "--disableincludes", default=[], action="append",
help=_("disable includepkgs for a repo or for everything"),
metavar='[repo]')
group.add_option("--obsoletes", action="store_true",
help=_("enable obsoletes processing during updates"))
group.add_option("--noplugins", action="store_true",
Expand Down
7 changes: 7 additions & 0 deletions docs/yum.8
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,13 @@ main == disable excludes defined in [main] in yum.conf
.br
repoid == disable excludes defined for that repo
.br
.IP "\fB\-\-disableincludes=[all|repoid]\fP"
Disable the includes defined in your config files. Takes one of two options:
.br
all == disable all includes
.br
repoid == disable includes defined for that repo
.br
.IP "\fB\-\-disableplugin=plugin\fP"
Run with one or more plugins disabled, the argument is a comma separated list
of wildcards to match against plugin names.
Expand Down
3 changes: 3 additions & 0 deletions yum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2079,6 +2079,9 @@ def includePackages(self, repo):
:param repo: the repository to use
"""
for di in getattr(self.conf, 'disable_includes', []):
if di == 'all' or di == repo.id:
return
includelist = repo.getIncludePkgList()

if len(includelist) == 0:
Expand Down

0 comments on commit bba27df

Please sign in to comment.