]> granicus.if.org Git - python/commitdiff
Regularize options a bit:
authorGreg Ward <gward@python.net>
Wed, 31 May 2000 23:56:45 +0000 (23:56 +0000)
committerGreg Ward <gward@python.net>
Wed, 31 May 2000 23:56:45 +0000 (23:56 +0000)
  * 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

index d07f9249da2f67c043ef11117211f1d4a7bfc0a2..e7e4ca7ef6dea9f4089ff4bed24c3b11d5c513fe 100644 (file)
@@ -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'))