home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 March / PCWELT_3_2006.ISO / base / 05_common.mo / usr / lib / rpm / brp-strip-comment-note < prev    next >
Encoding:
Text File  |  2003-10-29  |  642 b   |  19 lines

  1. #!/bin/sh
  2. # If using normal root, avoid changing anything.
  3. if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
  4.     exit 0
  5. fi
  6.  
  7. # Strip .comment and .note sections (the latter only if it is not allocated)
  8. # for already stripped elf files in the build root
  9. for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
  10.         grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug"  | \
  11.     sed -n -e 's/^\(.*\):[     ]*ELF.*, stripped/\1/p'`; do
  12.     note="-R .note"
  13.     if objdump -h $f | grep '^[     ]*[0-9]*[     ]*.note[     ]' -A 1 | \
  14.         grep ALLOC >/dev/null; then
  15.         note=
  16.     fi
  17.     strip -R .comment $note $f || :
  18. done
  19.