[Python-checkins] CVS: distutils/distutils/command bdist_rpm.py,1.3,1.4

Greg Ward python-dev@python.org
Wed, 31 May 2000 16:56:48 -0700


Update of /cvsroot/python/distutils/distutils/command
In directory slayer.i.sourceforge.net:/tmp/cvs-serv6640

Modified Files:
	bdist_rpm.py 
Log Message:
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')

Index: bdist_rpm.py
===================================================================
RCS file: /cvsroot/python/distutils/distutils/command/bdist_rpm.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** bdist_rpm.py	2000/05/27 17:27:23	1.3
--- bdist_rpm.py	2000/05/31 23:56:45	1.4
***************
*** 6,10 ****
  # created 2000/04/25, by Harry Henry Gebel
  
! __revision__ = "$Id: bdist_rpm.py,v 1.3 2000/05/27 17:27:23 gward Exp $"
  
  import os, string
--- 6,10 ----
  # created 2000/04/25, by Harry Henry Gebel
  
! __revision__ = "$Id: bdist_rpm.py,v 1.4 2000/05/31 23:56:45 gward Exp $"
  
  import os, string
***************
*** 20,37 ****
      user_options = [
          ('spec-only', None,
!          "Only regenerate spec file"),
          ('source-only', None,
!          "Only generate source RPM"),
          ('binary-only', None,
!          "Only generate binary RPM"),
          ('use-bzip2', None,
!          "Use bzip2 instead of gzip to create source distribution"),
          ('no-clean', None,
!          "Do not clean RPM build directory"),
          ('no-rpm-opt-flags', None,
!          "Do not pass any RPM CFLAGS to compiler")
!         ]
  
  
      def initialize_options (self):
          self.spec_only = None
--- 20,44 ----
      user_options = [
          ('spec-only', None,
!          "only regenerate spec file"),
          ('source-only', None,
!          "only generate source RPM"),
          ('binary-only', None,
!          "only generate binary RPM"),
          ('use-bzip2', None,
!          "use bzip2 instead of gzip to create source distribution"),
!         ('clean', None,
!          "clean up RPM build directory [default]"),
          ('no-clean', None,
!          "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"),
!        ]
  
+     negative_opt = {'no-clean': 'clean',
+                     'no-rpm-opt-flags': 'use-rpm-opt-flags'}
  
+                     
      def initialize_options (self):
          self.spec_only = None
***************
*** 39,44 ****
          self.source_only = None
          self.use_bzip2 = None
!         self.no_clean = None
!         self.no_rpm_opt_flags = None
  
      # initialize_options()
--- 46,51 ----
          self.source_only = None
          self.use_bzip2 = None
!         self.clean = 1
!         self.use_rpm_opt_flags = 1
  
      # initialize_options()
***************
*** 55,59 ****
          # don't pass CFLAGS to pure python distributions
          if not self.distribution.has_ext_modules():
!             self.no_rpm_opt_flags = 1
  
      # finalize_options()
--- 62,66 ----
          # don't pass CFLAGS to pure python distributions
          if not self.distribution.has_ext_modules():
!             self.use_rpm_opt_flags = 0
  
      # finalize_options()
***************
*** 121,125 ****
          rpm_args.extend(['--define',
                           '_topdir ' + os.getcwd() + '/build/rpm',])
!         if not self.no_clean:
              rpm_args.append('--clean')
          rpm_args.append(spec_path)
--- 128,132 ----
          rpm_args.extend(['--define',
                           '_topdir ' + os.getcwd() + '/build/rpm',])
!         if self.clean:
              rpm_args.append('--clean')
          rpm_args.append(spec_path)
***************
*** 169,173 ****
          self.postun = self._check_string('postun')
          self.prep = self._check_string('prep', '%setup')
!         if not self.no_rpm_opt_flags:
              self.build = (self._check_string(
                  'build',
--- 176,180 ----
          self.postun = self._check_string('postun')
          self.prep = self._check_string('prep', '%setup')
!         if self.use_rpm_opt_flags:
              self.build = (self._check_string(
                  'build',