From 69413da74993ff6728b72be4b4290fc705e9cbc1 Mon Sep 17 00:00:00 2001 From: Greg Ward Date: Wed, 31 May 2000 23:56:45 +0000 Subject: [PATCH] Regularize options a bit: * help strings start with lowercase * added affirmative version of '--no-clean' and '--no-rpm-opt-flags', which are the default (thus the attributes that correspond to the options are now 'clean' and 'use_rpm_opt_flags') --- Lib/distutils/command/bdist_rpm.py | 31 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index d07f9249da..e7e4ca7ef6 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -19,27 +19,34 @@ class bdist_rpm (Command): user_options = [ ('spec-only', None, - "Only regenerate spec file"), + "only regenerate spec file"), ('source-only', None, - "Only generate source RPM"), + "only generate source RPM"), ('binary-only', None, - "Only generate binary RPM"), + "only generate binary RPM"), ('use-bzip2', None, - "Use bzip2 instead of gzip to create source distribution"), + "use bzip2 instead of gzip to create source distribution"), + ('clean', None, + "clean up RPM build directory [default]"), ('no-clean', None, - "Do not clean RPM build directory"), + "don't clean up RPM build directory"), + ('use-rpm-opt-flags', None, + "compile with RPM_OPT_FLAGS when building from source RPM"), ('no-rpm-opt-flags', None, - "Do not pass any RPM CFLAGS to compiler") - ] + "do not pass any RPM CFLAGS to compiler"), + ] + negative_opt = {'no-clean': 'clean', + 'no-rpm-opt-flags': 'use-rpm-opt-flags'} + def initialize_options (self): self.spec_only = None self.binary_only = None self.source_only = None self.use_bzip2 = None - self.no_clean = None - self.no_rpm_opt_flags = None + self.clean = 1 + self.use_rpm_opt_flags = 1 # initialize_options() @@ -54,7 +61,7 @@ class bdist_rpm (Command): "Cannot supply both '--source-only' and '--binary-only'" # don't pass CFLAGS to pure python distributions if not self.distribution.has_ext_modules(): - self.no_rpm_opt_flags = 1 + self.use_rpm_opt_flags = 0 # finalize_options() @@ -120,7 +127,7 @@ class bdist_rpm (Command): topdir = os.getcwd() + 'build/rpm' rpm_args.extend(['--define', '_topdir ' + os.getcwd() + '/build/rpm',]) - if not self.no_clean: + if self.clean: rpm_args.append('--clean') rpm_args.append(spec_path) self.spawn(rpm_args) @@ -168,7 +175,7 @@ class bdist_rpm (Command): self.preun = self._check_string('preun') self.postun = self._check_string('postun') self.prep = self._check_string('prep', '%setup') - if not self.no_rpm_opt_flags: + if self.use_rpm_opt_flags: self.build = (self._check_string( 'build', 'env CFLAGS="$RPM_OPT_FLAGS" python setup.py build')) -- 2.40.0