Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9ca384

Browse files
author
Tarek Ziadé
committed
Merged revisions 70094 via svnmerge from
svn+ssh://[email protected]/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 ........
1 parent ccc5ae7 commit d9ca384

2 files changed

Lines changed: 3 additions & 43 deletions

File tree

Lib/distutils/command/bdist_rpm.py

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,10 @@ class bdist_rpm(Command):
125125

126126
('quiet', 'q',
127127
"Run the INSTALL phase of RPM building in quiet mode"),
128-
129-
# Forces the -O1 option when calling the install command,
130-
# so the rpm contains all files needed for proper operation under
131-
# SELinux. Some systems checks for this on build-time and will
132-
# fail without this.
133-
('force-optimize', None,
134-
"Forces the -O1 option when calling the install command"),
135-
136128
]
137129

138130
boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode',
139-
'no-autoreq', 'quiet', 'force-optimize']
131+
'no-autoreq', 'quiet']
140132

141133
negative_opt = {'no-keep-temp': 'keep-temp',
142134
'no-rpm-opt-flags': 'use-rpm-opt-flags',
@@ -187,7 +179,6 @@ def initialize_options(self):
187179

188180
self.force_arch = None
189181
self.quiet = 0
190-
self.force_optimize = 1
191182

192183
def finalize_options(self):
193184
self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
@@ -492,14 +483,8 @@ def _make_spec_file(self):
492483
# that we open and interpolate into the spec file, but the defaults
493484
# are just text that we drop in as-is. Hmmm.
494485

495-
# forcing -O1 if force-optimize
496-
if self.force_optimize:
497-
optimize = ' -O1'
498-
else:
499-
optimize = ''
500-
501-
install_cmd = ('%s install%s --root=$RPM_BUILD_ROOT '
502-
'--record=INSTALLED_FILES') % (def_setup_call, optimize)
486+
install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
487+
'--record=INSTALLED_FILES') % def_setup_call
503488

504489
script_options = [
505490
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),

Lib/distutils/tests/test_bdist_rpm.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ def test_no_optimize_flag(self):
109109
cmd = bdist_rpm(dist)
110110
cmd.fix_python = True
111111

112-
# running with force-optimize = 1
113-
# and quiet = 1
114112
cmd.quiet = 1
115113
cmd.ensure_finalized()
116114
cmd.run()
@@ -119,29 +117,6 @@ def test_no_optimize_flag(self):
119117
self.assert_('foo-0.1-1.noarch.rpm' in dist_created)
120118
os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))
121119

122-
# XXX I am unable yet to make this test work without
123-
# spurious stderr output
124-
# so returning until distutils.spawn acts better
125-
return
126-
127-
# running with force-optimize = 0
128-
cmd.force_optimize = 0
129-
try:
130-
# XXX How to prevent the spawned
131-
# rpmbuild command to display errors ?
132-
# this can be a problem for buildbots
133-
cmd.ensure_finalized()
134-
cmd.run()
135-
except DistutilsExecError:
136-
# happens only under Fedora/RedHat
137-
# and some flavors of Linux
138-
# otherwise it's a bug
139-
if sys.platform == 'linux2':
140-
return
141-
142-
dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
143-
self.assert_('foo-0.1-1.noarch.rpm' in dist_created)
144-
145120
def test_suite():
146121
return unittest.makeSuite(BuildRpmTestCase)
147122

0 commit comments

Comments
 (0)