summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/bdist_rpm.py
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-05-31 23:56:45 (GMT)
committerGreg Ward <gward@python.net>2000-05-31 23:56:45 (GMT)
commit69413da74993ff6728b72be4b4290fc705e9cbc1 (patch)
tree1fd9df7eb89acf4fd0d977fa199c66eebffc15b3 /Lib/distutils/command/bdist_rpm.py
parent46bd9a6191236c07401169ff407914aeacbddc98 (diff)
downloadcpython-69413da74993ff6728b72be4b4290fc705e9cbc1.zip
cpython-69413da74993ff6728b72be4b4290fc705e9cbc1.tar.gz
cpython-69413da74993ff6728b72be4b4290fc705e9cbc1.tar.bz2
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')
Diffstat (limited to 'Lib/distutils/command/bdist_rpm.py')
-rw-r--r--Lib/distutils/command/bdist_rpm.py31
1 files changed, 19 insertions, 12 deletions
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py
index d07f924..e7e4ca7 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'))