setup-new-2.sh: rewritten stripping code in more configurable way.
svn path=/nixpkgs/trunk/; revision=9237
This commit is contained in:
parent
d215554ba4
commit
6fc617391d
@ -192,6 +192,23 @@ if test "$NIX_DEBUG" = "1"; then
|
|||||||
echo "Final path: $PATH"
|
echo "Final path: $PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
stripDirs() {
|
||||||
|
local dirs="$1"
|
||||||
|
local stripFlags="$2"
|
||||||
|
local dirsNew=
|
||||||
|
|
||||||
|
for d in ${dirs}; do
|
||||||
|
if test -d "$prefix/$d"; then
|
||||||
|
dirsNew="${dirsNew} $prefix/$d "
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
dirs=${dirsNew}
|
||||||
|
|
||||||
|
if test -n "${dirs}"; then
|
||||||
|
echo $dirs
|
||||||
|
find $dirs -type f -print0 | xargs -0 strip $stripFlags || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
######################################################################
|
######################################################################
|
||||||
# Textual substitution functions.
|
# Textual substitution functions.
|
||||||
@ -733,19 +750,10 @@ fixupW() {
|
|||||||
|
|
||||||
# TODO : strip _only_ ELF executables, and return || fail here...
|
# TODO : strip _only_ ELF executables, and return || fail here...
|
||||||
if test -z "$dontStrip"; then
|
if test -z "$dontStrip"; then
|
||||||
test -d "$prefix/lib" && stripDebug="$prefix/lib"
|
echo "Stripping debuging symbols from files in"
|
||||||
|
stripDirs "${stripDebugList:-lib}" -S
|
||||||
if test -n "$stripDebug"; then
|
echo "Stripping all symbols from files in"
|
||||||
find "$stripDebug" -type f -print0 |
|
stripDirs "${stripAllList:-bin sbin}" -s
|
||||||
xargs -0 strip --strip-debug --verbose || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
test -d "$prefix/bin" && stripAll="$prefix/bin"
|
|
||||||
test -d "$prefix/sbin" && stripAll="${stripAll} $prefix/sbin"
|
|
||||||
if test -n "$stripAll"; then
|
|
||||||
find "$prefix/bin" "$prefix/sbin" -type f -print0 |
|
|
||||||
xargs -0 strip --strip-all --verbose || true
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then
|
if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user