index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-09-13 23:02:36 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2011-09-14 17:25:29 -0400 |
commit | 4a02350ded318bdc1da5421551784ab2a10dd96b (patch) | |
tree | 1a3579a2802490add5a06ccb99b40bb7ba47bb60 | |
parent | d1e04c1b677d733262a0436ed9b25b2e7eada15e (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 11 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b83f57a1..6304a258 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -996,14 +996,15 @@ tidy_install() { # check file still exists (potentially already compressed due to hardlink) if [[ -f ${manpage} ]]; then # 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 - find "${MAN_DIRS[@]}" \! -name "$file" -samefile "$manpage" \ - -exec rm -f {} \; 2>/dev/null || true + # the '|| true' part keeps the script from bailing on the EOF returned + # by read at the end of the find output + IFS=$'\n' read -rd '' -a hardlinks < \ + <(find "${MAN_DIRS[@]}" \! -name "$file" -samefile "$manpage" 2>/dev/null) || true + rm -f "${hardlinks[@]}" # compress the original gzip -9 "$manpage" # recreate hard links removed earlier - for hl in ${hardlinks}; do + for hl in "${hardlinks[@]}"; do ln "${manpage}.gz" "${hl}.gz" chmod 644 ${hl}.gz done |