[Python-checkins] r70096 - in python/branches/py3k: Lib/distutils/command/bdist_rpm.py Lib/distutils/tests/test_bdist_rpm.py

tarek.ziade python-checkins at python.org
Mon Mar 2 06:41:25 CET 2009


Author: tarek.ziade
Date: Mon Mar  2 06:41:25 2009
New Revision: 70096

Log:
Merged revisions 70094 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70094 | tarek.ziade | 2009-03-02 06:38:44 +0100 (Mon, 02 Mar 2009) | 1 line
  
  removing the force-optimized option as discussed in #1533164
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/distutils/command/bdist_rpm.py
   python/branches/py3k/Lib/distutils/tests/test_bdist_rpm.py

Modified: python/branches/py3k/Lib/distutils/command/bdist_rpm.py
==============================================================================
--- python/branches/py3k/Lib/distutils/command/bdist_rpm.py	(original)
+++ python/branches/py3k/Lib/distutils/command/bdist_rpm.py	Mon Mar  2 06:41:25 2009
@@ -125,18 +125,10 @@
 
         ('quiet', 'q',
          "Run the INSTALL phase of RPM building in quiet mode"),
-
-        # Forces the -O1 option when calling the install command,
-        # so the rpm contains all files needed for proper operation under
-        # SELinux. Some systems checks for this on build-time and will
-        # fail without this.
-        ('force-optimize', None,
-         "Forces the -O1 option when calling the install command"),
-
         ]
 
     boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode',
-                       'no-autoreq', 'quiet', 'force-optimize']
+                       'no-autoreq', 'quiet']
 
     negative_opt = {'no-keep-temp': 'keep-temp',
                     'no-rpm-opt-flags': 'use-rpm-opt-flags',
@@ -187,7 +179,6 @@
 
         self.force_arch = None
         self.quiet = 0
-        self.force_optimize = 1
 
     def finalize_options(self):
         self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
@@ -492,14 +483,8 @@
         # that we open and interpolate into the spec file, but the defaults
         # are just text that we drop in as-is.  Hmmm.
 
-        # forcing -O1 if force-optimize
-        if self.force_optimize:
-            optimize = ' -O1'
-        else:
-            optimize = ''
-
-        install_cmd = ('%s install%s --root=$RPM_BUILD_ROOT '
-                       '--record=INSTALLED_FILES') % (def_setup_call, optimize)
+        install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
+                       '--record=INSTALLED_FILES') % def_setup_call
 
         script_options = [
             ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),

Modified: python/branches/py3k/Lib/distutils/tests/test_bdist_rpm.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_bdist_rpm.py	(original)
+++ python/branches/py3k/Lib/distutils/tests/test_bdist_rpm.py	Mon Mar  2 06:41:25 2009
@@ -109,8 +109,6 @@
         cmd = bdist_rpm(dist)
         cmd.fix_python = True
 
-        # running with force-optimize = 1
-        # and quiet = 1
         cmd.quiet = 1
         cmd.ensure_finalized()
         cmd.run()
@@ -119,29 +117,6 @@
         self.assert_('foo-0.1-1.noarch.rpm' in dist_created)
         os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
 
-        # XXX I am unable yet to make this test work without
-        # spurious stderr output
-        # so returning until distutils.spawn acts better
-        return
-
-        # running with force-optimize = 0
-        cmd.force_optimize = 0
-        try:
-            # XXX How to prevent the spawned
-            # rpmbuild command to display errors ?
-            # this can be a problem for buildbots
-            cmd.ensure_finalized()
-            cmd.run()
-        except DistutilsExecError:
-            # happens only under Fedora/RedHat
-            # and some flavors of Linux
-            # otherwise it's a bug
-            if sys.platform == 'linux2':
-                return
-
-        dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
-        self.assert_('foo-0.1-1.noarch.rpm' in dist_created)
-
 def test_suite():
     return unittest.makeSuite(BuildRpmTestCase)
 


More information about the Python-checkins mailing list