makepkg: avoid for loop in deleting manpage hardlinks

find can do this all on its own and remain portable.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
Dave Reisner 2011-09-06 14:17:15 -04:00 committed by Dan McGee
parent 17c3de3e4f
commit 4ed12aec30
1 changed files with 2 additions and 4 deletions

View File

@ -995,10 +995,8 @@ tidy_install() {
# find hard links and remove them
# the '|| true' part keeps the script from bailing if find returned an
# error, such as when one of the man directories doesn't exist
hardlinks="$(find ${MAN_DIRS[@]} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true
for hl in ${hardlinks}; do
rm -f "${hl}";
done
find "${MAN_DIRS[@]}" \! -name "$file" -samefile "$manpage" \
-exec rm -f {} \; 2>/dev/null || true
# compress the original
gzip -9 "$manpage"
# recreate hard links removed earlier