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