mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 10:36:17 +01:00
pass the --debug option to the build script which will take care of creating debuginfo packages
This commit is contained in:
parent
cd406dde98
commit
99732545b4
16
osc/build.py
16
osc/build.py
@ -250,6 +250,8 @@ def main(opts, argv):
|
||||
buildargs.append('--jobs %s' % opts.jobs)
|
||||
if opts.baselibs:
|
||||
buildargs.append('--baselibs')
|
||||
if opts.debuginfo:
|
||||
buildargs.append('--debug')
|
||||
buildargs = ' '.join(buildargs)
|
||||
|
||||
prj = store_read_project(os.curdir)
|
||||
@ -264,20 +266,6 @@ def main(opts, argv):
|
||||
print >>sys.stderr, 'Error: specfile \'%s\' does not exist.' % spec
|
||||
return 1
|
||||
|
||||
if opts.debuginfo:
|
||||
# make sure %debug_package is in the spec-file.
|
||||
spec_text = open(spec).read()
|
||||
if not re.search(r'(?m)^%debug_package', spec_text):
|
||||
spec_text = re.sub(r'(?m)^(%prep)',
|
||||
r'# added by osc build -d\n%debug_package\n\n\1',
|
||||
spec_text, 1)
|
||||
tmp_spec = NamedTemporaryFile(prefix = spec + '_', dir = '.', suffix = '.spec')
|
||||
tmp_spec.write(spec_text)
|
||||
tmp_spec.flush()
|
||||
spec = tmp_spec.name
|
||||
os.chmod(spec, 0644)
|
||||
|
||||
|
||||
# make it possible to override configuration of the rc file
|
||||
for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'OSC_BUILD_ROOT']:
|
||||
val = os.getenv(var)
|
||||
|
Loading…
Reference in New Issue
Block a user