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 <allan@archlinux.org>
This commit is contained in:
parent
5c5b28833c
commit
fe824f87b9
3 changed files with 8 additions and 3 deletions
|
@ -250,7 +250,7 @@ A normal sync or upgrade will not use its value.
|
||||||
|
|
||||||
*staticlibs*;;
|
*staticlibs*;;
|
||||||
Leave static library (.a) files in packages. Specify `!staticlibs` to
|
Leave static library (.a) files in packages. Specify `!staticlibs` to
|
||||||
remove them.
|
remove them (if they have a shared counterpart).
|
||||||
|
|
||||||
*emptydirs*;;
|
*emptydirs*;;
|
||||||
Leave empty directories in packages.
|
Leave empty directories in packages.
|
||||||
|
|
|
@ -162,7 +162,7 @@ Options
|
||||||
|
|
||||||
*staticlibs*;;
|
*staticlibs*;;
|
||||||
Leave static library (.a) files in packages. Specify `!staticlibs` to
|
Leave static library (.a) files in packages. Specify `!staticlibs` to
|
||||||
remove them.
|
remove them (if they have a shared counterpart).
|
||||||
|
|
||||||
*emptydirs*;;
|
*emptydirs*;;
|
||||||
Leave empty directories in packages.
|
Leave empty directories in packages.
|
||||||
|
|
|
@ -1584,7 +1584,12 @@ tidy_install() {
|
||||||
|
|
||||||
if check_option "staticlibs" "n"; then
|
if check_option "staticlibs" "n"; then
|
||||||
msg2 "$(gettext "Removing static library files...")"
|
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
|
fi
|
||||||
|
|
||||||
if check_option "emptydirs" "n"; then
|
if check_option "emptydirs" "n"; then
|
||||||
|
|
Loading…
Add table
Reference in a new issue