debug sembolleri /debug içine değil /debug/paket_ismi içine kendi klasörüne konsun, böylece farklı revizyonlara/versiyonlara ait semboller karışmasın...
This commit is contained in:
+3
-2
@@ -423,11 +423,12 @@ class Builder:
|
|||||||
"""strip install directory"""
|
"""strip install directory"""
|
||||||
ctx.ui.action(_("Stripping files.."))
|
ctx.ui.action(_("Stripping files.."))
|
||||||
install_dir = self.pkg_install_dir()
|
install_dir = self.pkg_install_dir()
|
||||||
|
pkg_name = self.spec.source.name + '-' + self.spec.source.version + '-' + self.spec.source.release
|
||||||
try:
|
try:
|
||||||
nostrip = self.actionGlobals['NoStrip']
|
nostrip = self.actionGlobals['NoStrip']
|
||||||
util.strip_directory(install_dir, nostrip)
|
util.strip_directory(install_dir, pkg_name, nostrip)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
util.strip_directory(install_dir)
|
util.strip_directory(install_dir, pkg_name)
|
||||||
|
|
||||||
def gen_metadata_xml(self, package):
|
def gen_metadata_xml(self, package):
|
||||||
"""Generate the metadata.xml file for build source.
|
"""Generate the metadata.xml file for build source.
|
||||||
|
|||||||
+14
-10
@@ -434,7 +434,7 @@ def do_patch(sourceDir, patchFile, level = 0, target = ''):
|
|||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
|
||||||
def strip_directory(top, excludelist=[]):
|
def strip_directory(top, package_name, excludelist=[]):
|
||||||
for root, dirs, files in os.walk(top):
|
for root, dirs, files in os.walk(top):
|
||||||
for fn in files:
|
for fn in files:
|
||||||
frpath = join_path(root, fn)
|
frpath = join_path(root, fn)
|
||||||
@@ -458,11 +458,11 @@ def strip_directory(top, excludelist=[]):
|
|||||||
ctx.ui.debug("%s [%s]" %(p, "NoStrip"))
|
ctx.ui.debug("%s [%s]" %(p, "NoStrip"))
|
||||||
|
|
||||||
if strip:
|
if strip:
|
||||||
if strip_file(frpath):
|
if strip_file(frpath, package_name):
|
||||||
ctx.ui.debug("%s [%s]" %(p, "stripped"))
|
ctx.ui.debug("%s [%s]" %(p, "stripped"))
|
||||||
|
|
||||||
|
|
||||||
def strip_file(filepath):
|
def strip_file(filepath, package_name):
|
||||||
"""strip a file"""
|
"""strip a file"""
|
||||||
p = os.popen("file \"%s\"" % filepath)
|
p = os.popen("file \"%s\"" % filepath)
|
||||||
o = p.read()
|
o = p.read()
|
||||||
@@ -473,15 +473,19 @@ def strip_file(filepath):
|
|||||||
if ret:
|
if ret:
|
||||||
ctx.ui.warning(_("strip command failed for file '%s'!") % f)
|
ctx.ui.warning(_("strip command failed for file '%s'!") % f)
|
||||||
|
|
||||||
def save_elf_debug(f):
|
def save_elf_debug(f, package_name):
|
||||||
"""copy debug info into /debug/file.debug file"""
|
"""copy debug info into /debug/PACKAGE_NAME/file.debug file"""
|
||||||
p = os.popen("objcopy --only-keep-debug %s /debug/%s.debug" % (f, os.path.basename(f)))
|
try:
|
||||||
|
os.makedirs("/debug/%s" % package_name)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
p = os.popen("objcopy --only-keep-debug %s /debug/%s/%s.debug" % (f, package_name, os.path.basename(f)))
|
||||||
ret = p.close()
|
ret = p.close()
|
||||||
if ret:
|
if ret:
|
||||||
ctx.ui.warning(_("objcopy (keep-debug) command failed for file '%s'!") % f)
|
ctx.ui.warning(_("objcopy (keep-debug) command failed for file '%s'!") % f)
|
||||||
|
|
||||||
"""mark binary/shared objects to use /debug/file.debug"""
|
"""mark binary/shared objects to use /debug/PACKAGE_NAME/file.debug"""
|
||||||
p = os.popen("objcopy --add-gnu-debuglink=/debug/%s.debug %s" % (os.path.basename(f), f))
|
p = os.popen("objcopy --add-gnu-debuglink=/debug/%s/%s.debug %s" % (package_name, os.path.basename(f), f))
|
||||||
ret = p.close()
|
ret = p.close()
|
||||||
if ret:
|
if ret:
|
||||||
ctx.ui.warning(_("objcopy (add-debuglink) command failed for file '%s'!") % f)
|
ctx.ui.warning(_("objcopy (add-debuglink) command failed for file '%s'!") % f)
|
||||||
@@ -492,13 +496,13 @@ def strip_file(filepath):
|
|||||||
|
|
||||||
elif "SB executable" in o:
|
elif "SB executable" in o:
|
||||||
if ctx.config.values.build.debug == "True":
|
if ctx.config.values.build.debug == "True":
|
||||||
save_elf_debug(filepath)
|
save_elf_debug(filepath, package_name)
|
||||||
run_strip(filepath)
|
run_strip(filepath)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
elif "SB shared object" in o:
|
elif "SB shared object" in o:
|
||||||
if ctx.config.values.build.debug == "True":
|
if ctx.config.values.build.debug == "True":
|
||||||
save_elf_debug(filepath)
|
save_elf_debug(filepath, package_name)
|
||||||
run_strip(filepath, "--strip-unneeded")
|
run_strip(filepath, "--strip-unneeded")
|
||||||
# FIXME: warn for TEXTREL
|
# FIXME: warn for TEXTREL
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user