1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Cleaned up and simplified tidy_install().

Added 'LC_ALL= LANG=' to find commands for stripping symbols from binaries/libraries.
This stops the greps failing if LC_ALL or LANG != en_US|C|POSIX.

Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
This commit is contained in:
Andrew Fyfe 2007-04-11 20:06:01 +01:00 committed by Dan McGee
parent e2f42947e3
commit 9b85864e37

View File

@ -394,44 +394,43 @@ removedeps() {
}
tidy_install() {
cd "$startdir"/pkg
msg2 "$(gettext "Tidying install...")"
if [ "$(check_option docs)" = "n" ]; then
# remove info/doc files
msg "$(gettext "Removing info/doc files...")"
cd "$startdir/pkg"
msg2 "$(gettext "Removing info/doc files...")"
#fix flyspray bug #5021
rm -rf ${DOC_DIRS[@]}
fi
# move /usr/share/man files to /usr/man
if [ -d $startdir/pkg/usr/share/man ]; then
cd "$startdir"
mkdir -p pkg/usr/man
cp -a pkg/usr/share/man/* pkg/usr/man/
rm -rf pkg/usr/share/man
if [ -d usr/share/man ]; then
msg2 "$(gettext "Moving usr/share/man files to usr/man")"
mkdir -p usr/man
cp -a usr/share/man/* usr/man/
rm -rf usr/share/man
fi
# compress man pages
msg "$(gettext "Compressing man pages...")"
find "$startdir"/pkg/{usr{,/local},opt/*}/man -type f 2>/dev/null | while read i ; do
ext="${i##*.}"
fn="${i##*/}"
msg2 "$(gettext "Compressing man pages...")"
local manpage ext file link
find {usr{,/local},opt/*}/man -type f 2>/dev/null | while read manpage ; do
ext="${manpage##*.}"
file="${manpage##*/}"
if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
# update symlinks to this manpage
find "$startdir"/pkg/{usr{,/local},opt/*}/man -lname "$fn" 2> /dev/null | while read ln ; do
rm -f "$ln"
ln -sf "${fn}.gz" "${ln}.gz"
find {usr{,/local},opt/*}/man -lname "$file" 2>/dev/null | while read link ; do
rm -f "$link"
ln -sf "${file}.gz" "${link}.gz"
done
# compress the original
gzip -9 "$i"
gzip -9 "$manpage"
fi
done
cd "$startdir"
# strip binaries
if [ "$(check_option strip)" = "y" ]; then
msg "$(gettext "Stripping debugging symbols from binaries and libraries...")"
for file in $(find pkg/*/{bin,lib,sbin} -type f 2>/dev/null || true); do
for file in $(find {,*/}{bin,lib,sbin} -type f 2>/dev/null || true); do
case "$(file -biz "$file")" in
*application/x-sharedlib*) # Libraries
/usr/bin/strip --strip-debug "$file";;
@ -441,17 +440,14 @@ tidy_install() {
done
fi
# remove libtool (.la) files
if [ "$(check_option libtool)" = "n" ]; then
msg "$(gettext "Removing libtool .la files...")"
find pkg -type f -name "*.la" -exec rm -f -- '{}' \;
msg2 "$(gettext "Removing libtool .la files...")"
find -type f -name "*.la" -exec rm -f -- '{}' \;
fi
# remove empty directories
if [ "$(check_option emptydirs)" = "n" ]; then
msg "$(gettext "Removing empty directories...")"
cd "$startdir/pkg"
find -depth -type d -empty -delete;
msg2 "$(gettext "Removing empty directories...")"
find -depth -type d -empty -delete
fi
}