[Yum-devel] [PATCH] Warn about merged options used in firstParse() (-c, -d, -e, -q, -v).
James Antill
james at and.org
Wed Nov 10 14:14:51 UTC 2010
---
cli.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/cli.py b/cli.py
index e8748f2..0c5d8ed 100644
--- a/cli.py
+++ b/cli.py
@@ -250,6 +250,17 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
# apply some of the options to self.conf
(opts, self.cmds) = self.optparser.setupYumConfig(args=args)
+ # Check that firstParse didn't miss anything, and warn the user if it
+ # did ... because this is really magic, and unexpected.
+ if opts.quiet:
+ opts.debuglevel = 0
+ if opts.verbose:
+ opts.debuglevel = opts.errorlevel = 6
+ if opts.debuglevel != pc.debuglevel or opts.errorlevel != pc.errorlevel:
+ self.logger.warning("Ignored option -q, -v, -d or -e (probably due to merging: -yq != -y -q)")
+ if opts.conffile != pc.fn:
+ self.logger.warning("Ignored option -c (probably due to merging -yc != -y -c)")
+
if opts.version:
self.conf.cache = 1
yum_progs = self.run_with_package_names
--
1.7.2.3
More information about the Yum-devel
mailing list