From fe824f87b9f1e40d88bd1a190a0bc1c80f2e91eb Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Thu, 31 Oct 2013 23:24:26 +1000 Subject: makepkg: only remove static libraries if they have a shared version It is fairly common that packages contain static libraries with no shared counterpart. These should not be removed with !staticlibs. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b2cc8e27..e01e7ab3 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1584,7 +1584,12 @@ tidy_install() { if check_option "staticlibs" "n"; then msg2 "$(gettext "Removing static library files...")" - find . ! -type d -name "*.a" -exec rm -f -- '{}' + + local l + while read -rd '' l; do + if [[ -f "${l%.a}.so" ]]; then + rm "$l" + fi + done < <(find . ! -type d -name "*.a" -print0) fi if check_option "emptydirs" "n"; then -- cgit v1.2.3-70-g09d2