Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP4:Update
rpm-ndb.32908
finddebuginfo.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File finddebuginfo.diff of Package rpm-ndb.32908
--- ./scripts/find-debuginfo.sh.orig 2020-04-28 12:50:11.939400520 +0000 +++ ./scripts/find-debuginfo.sh 2021-04-21 12:13:07.187523159 +0000 @@ -331,12 +331,18 @@ trap 'rm -rf "$temp"' EXIT # Build a list of unstripped ELF files and their hardlinks touch "$temp/primary" -find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \ - \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \ - -print | LC_ALL=C sort | -file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped.*/\1/p' | -xargs --no-run-if-empty stat -c '%h %D_%i %n' | +find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | LC_ALL=C sort -z | +xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' | while read nlinks inum f; do + case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in + *debuglink*) continue ;; + *debug*) ;; + *gnu.version*) + echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!" + continue + ;; + *) continue ;; + esac if [ $nlinks -gt 1 ]; then var=seen_$inum if test -n "${!var}"; then @@ -369,6 +375,8 @@ do_file() if [ "$no_recompute_build_id" = "true" ]; then no_recompute="-n" fi + mode=$(stat -c %a "$f") + chmod +w "$f" id=$(${lib_rpm_dir}/debugedit -b "$debug_base_name" -d "$debug_dest_name" \ $no_recompute -i \ ${build_id_seed:+--build-id-seed="$build_id_seed"} \ @@ -396,17 +404,30 @@ do_file() # just has its file names collected and adjusted. case "$dn" in /usr/lib/debug/*) + chmod $mode "$f" return ;; esac mkdir -p "${debugdn}" - if test -w "$f"; then - strip_to_debug "${debugfn}" "$f" - else - chmod u+w "$f" - strip_to_debug "${debugfn}" "$f" - chmod u-w "$f" - fi + objcopy --only-keep-debug "$f" "$debugfn" || : + ( + shopt -s extglob + strip_option="--strip-all" + case "$f" in + *.ko) + strip_option="--strip-debug" ;; + *$STRIP_KEEP_SYMTAB*) + if test -n "$STRIP_KEEP_SYMTAB"; then + strip_option="--strip-debug" + fi + ;; + esac + if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then + strip_option= + fi + objcopy --add-gnu-debuglink="$debugfn" -R .comment -R .GCC.command.line $strip_option "$f" + chmod $mode "$f" + ) || : # strip -g implies we have full symtab, don't add mini symtab in that case. # It only makes sense to add a minisymtab for executables and shared @@ -517,7 +538,7 @@ if $run_dwz \ rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then id="`readelf -Wn "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" \ - 2>/dev/null | sed -n 's/^ Build ID: \([0-9a-f]\+\)/\1/p'`" + 2>/dev/null | sed -n 's/^.* Build ID: \([0-9a-f]\+\)/\1/p'`" fi # dwz invalidates .gnu_debuglink CRC32 in the main files. @@ -561,12 +582,14 @@ if [ -s "$SOURCEFILE" ]; then # and non-standard modes may be inherented from original directories, fixup find "${RPM_BUILD_ROOT}${debug_dest_name}" -type d -print0 | xargs --no-run-if-empty -0 chmod 0755 + find "${RPM_BUILD_ROOT}${debug_dest_name}" -type f -print0 | + xargs --no-run-if-empty -0 chmod a+r fi if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then ((nout > 0)) || test ! -d "${RPM_BUILD_ROOT}/usr/lib" || - (cd "${RPM_BUILD_ROOT}/usr/lib"; find debug -type d) | + (cd "${RPM_BUILD_ROOT}/usr/lib"; test ! -d debug || find debug -type d) | sed 's,^,%dir /usr/lib/,' >> "$LISTFILE" (cd "${RPM_BUILD_ROOT}/usr"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor