strip: split off file stripping and debug package creation
Some projects might duplicate the file in multiple locations for one reason or another. When debug packages are enabled, `makepkg` will only strip the first occurrence of the binary and abort early on all the other binaries. Signed-off-by: Morten Linderud <morten@linderud.pw>
This commit is contained in:
parent
8d38746586
commit
7a4fff3310
1 changed files with 5 additions and 1 deletions
|
@ -66,7 +66,7 @@ package_source_files() {
|
||||||
done < <(source_files "$binary")
|
done < <(source_files "$binary")
|
||||||
}
|
}
|
||||||
|
|
||||||
strip_file() {
|
collect_debug_symbols() {
|
||||||
local binary=$1; shift
|
local binary=$1; shift
|
||||||
|
|
||||||
if check_option "debug" "y"; then
|
if check_option "debug" "y"; then
|
||||||
|
@ -118,7 +118,10 @@ strip_file() {
|
||||||
ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug"
|
ln -s "$target" "$dbgdir/.build-id/${bid:0:2}/${bid:2}.debug"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
strip_file(){
|
||||||
|
local binary=$1; shift
|
||||||
local tempfile=$(mktemp "$binary.XXXXXX")
|
local tempfile=$(mktemp "$binary.XXXXXX")
|
||||||
if strip "$@" "$binary" -o "$tempfile"; then
|
if strip "$@" "$binary" -o "$tempfile"; then
|
||||||
cat "$tempfile" > "$binary"
|
cat "$tempfile" > "$binary"
|
||||||
|
@ -174,6 +177,7 @@ tidy_strip() {
|
||||||
*)
|
*)
|
||||||
continue ;;
|
continue ;;
|
||||||
esac
|
esac
|
||||||
|
collect_debug_symbols "$binary"
|
||||||
strip_file "$binary" ${strip_flags}
|
strip_file "$binary" ${strip_flags}
|
||||||
(( STRIPLTO )) && strip_lto "$binary"
|
(( STRIPLTO )) && strip_lto "$binary"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Reference in a new issue