Don't use a subshell where it isn't needed.

Noticed by:	John E Hein <jhein@timing.com>
This commit is contained in:
Dag-Erling Smørgrav 2007-05-16 20:16:06 +00:00
parent cfd1374177
commit f27f825839

View File

@ -1140,11 +1140,11 @@ delete-old-files:
@echo ">>> Removing old files (only deletes safe to delete libs)" @echo ">>> Removing old files (only deletes safe to delete libs)"
# Ask for every old file if the user really wants to remove it. # Ask for every old file if the user really wants to remove it.
# It's annoying, but better safe than sorry. # It's annoying, but better safe than sorry.
@(for file in ${OLD_FILES}; do \ @for file in ${OLD_FILES}; do \
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
rm ${RM_I} "${DESTDIR}/$${file}"; \ rm ${RM_I} "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done
# Remove catpages without corresponding manpages. # Remove catpages without corresponding manpages.
@3<&0; \ @3<&0; \
find ${DESTDIR}/usr/share/man/cat* ! -type d | \ find ${DESTDIR}/usr/share/man/cat* ! -type d | \
@ -1159,11 +1159,11 @@ delete-old-files:
check-old-files: check-old-files:
@echo ">>> Checking for old files" @echo ">>> Checking for old files"
@(for file in ${OLD_FILES}; do \ @for file in ${OLD_FILES}; do \
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
echo "${DESTDIR}/$${file}"; \ echo "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done
# Check for catpages without corresponding manpages. # Check for catpages without corresponding manpages.
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \ @find ${DESTDIR}/usr/share/man/cat* ! -type d | \
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
@ -1177,41 +1177,41 @@ check-old-files:
delete-old-libs: delete-old-libs:
@echo ">>> Removing old libraries" @echo ">>> Removing old libraries"
@echo "${OLD_LIBS_MESSAGE}" | fmt @echo "${OLD_LIBS_MESSAGE}" | fmt
@(for file in ${OLD_LIBS}; do \ @for file in ${OLD_LIBS}; do \
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
rm ${RM_I} "${DESTDIR}/$${file}"; \ rm ${RM_I} "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done
@echo ">>> Old libraries removed" @echo ">>> Old libraries removed"
check-old-libs: check-old-libs:
@echo ">>> Checking for old libraries" @echo ">>> Checking for old libraries"
@(for file in ${OLD_LIBS}; do \ @for file in ${OLD_LIBS}; do \
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
echo "${DESTDIR}/$${file}"; \ echo "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done
delete-old-dirs: delete-old-dirs:
@echo ">>> Removing old directories" @echo ">>> Removing old directories"
@(for dir in ${OLD_DIRS}; do \ @for dir in ${OLD_DIRS}; do \
if [ -d "${DESTDIR}/$${dir}" ]; then \ if [ -d "${DESTDIR}/$${dir}" ]; then \
rmdir -v "${DESTDIR}/$${dir}" || true; \ rmdir -v "${DESTDIR}/$${dir}" || true; \
elif [ -L "${DESTDIR}/$${dir}" ]; then \ elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
fi; \ fi; \
done) done
@echo ">>> Old directories removed" @echo ">>> Old directories removed"
check-old-dirs: check-old-dirs:
@echo ">>> Checking for old directories" @echo ">>> Checking for old directories"
@(for dir in ${OLD_DIRS}; do \ @for dir in ${OLD_DIRS}; do \
if [ -d "${DESTDIR}/$${dir}" ]; then \ if [ -d "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir}"; \ echo "${DESTDIR}/$${dir}"; \
elif [ -L "${DESTDIR}/$${dir}" ]; then \ elif [ -L "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
fi; \ fi; \
done) done
delete-old: delete-old-files delete-old-dirs delete-old: delete-old-files delete-old-dirs
@echo "To remove old libraries run '${MAKE} delete-old-libs'." @echo "To remove old libraries run '${MAKE} delete-old-libs'."