[yum-cvs] cli.py
James Antill
james at linux.duke.edu
Tue Dec 18 17:30:43 UTC 2007
cli.py | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
New commits:
commit 8d85469fa540ab48cbef25fc509acc73cb36d475
Author: James Antill <james at and.org>
Date: Tue Dec 18 12:30:12 2007 -0500
Split arguments at comma and whitespace
diff --git a/cli.py b/cli.py
index 56bf057..36214d2 100644
--- a/cli.py
+++ b/cli.py
@@ -160,7 +160,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
optparser=self.optparser,
debuglevel=opts.debuglevel,
errorlevel=opts.errorlevel,
- disabled_plugins=opts.disableplugins)
+ disabled_plugins=self.optparser._splitArg(opts.disableplugins))
except yum.Errors.ConfigError, e:
self.logger.critical(_('Config Error: %s'), e)
@@ -1167,6 +1167,15 @@ class YumOptionParser(OptionParser):
self.base.usage()
sys.exit(1)
return self.parse_args(args=args)[0]
+
+ @staticmethod
+ def _splitArg(seq):
+ """ Split all strings in seq, at "," and whitespace.
+ Returns a new list. """
+ ret = []
+ for arg in seq:
+ ret.extend(arg.replace(",", " ").split())
+ return ret
def setupYumConfig(self):
# Now parse the command line for real
@@ -1200,11 +1209,12 @@ class YumOptionParser(OptionParser):
self.base.conf.skip_broken = True
if opts.disableexcludes:
- self.base.conf.disable_excludes = opts.disableexcludes
+ disable_excludes = self._splitArg(opts.disableexcludes)
else:
- self.base.conf.disable_excludes = []
-
- for exclude in opts.exclude:
+ disable_excludes = []
+ self.base.conf.disable_excludes = disable_excludes
+
+ for exclude in self._splitArg(opts.exclude):
try:
excludelist = self.base.conf.exclude
excludelist.append(exclude)
More information about the Yum-cvs-commits
mailing list