From 0c136ecc8a43800476ab631c8b45b46f37028bab Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 24 Dec 2024 17:10:30 +1000 Subject: [PATCH] libmakepkg: strip - add "safe_" prefix to stripping functions Add a "safe_" prefix to strip_file() and strip_lto() to indicate that these functions are taking extra steps to ensure permissions remain unchanged. Signed-off-by: Allan McRae --- scripts/libmakepkg/tidy/strip.sh.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 70121287..949fba86 100644 --- a/scripts/libmakepkg/tidy/strip.sh.in +++ b/scripts/libmakepkg/tidy/strip.sh.in @@ -126,7 +126,7 @@ collect_debug_symbols() { fi } -strip_file(){ +safe_strip_file(){ local binary=$1; shift local tempfile=$(mktemp "$binary.XXXXXX") if strip "$@" "$binary" -o "$tempfile"; then @@ -135,7 +135,7 @@ strip_file(){ rm -f "$tempfile" } -strip_lto() { +safe_strip_lto() { local binary=$1; local tempfile=$(mktemp "$binary.XXXXXX") @@ -193,10 +193,9 @@ tidy_strip() { continue ;; esac (( ! STATICOBJ )) && collect_debug_symbols "$binary" - strip_file "$binary" ${strip_flags} - (( STATICOBJ )) && strip_lto "$binary" + safe_strip_file "$binary" ${strip_flags} + (( STATICOBJ )) && safe_strip_lto "$binary" done - elif check_option "debug" "y"; then msg2 "$(gettext "Copying source files needed for debug symbols...")"