Partially revert the check-old / delete-old modifications to clarify the

logic.

Apply similar modifications to {check,delete}-old-dirs, which I had
overlooked.
This commit is contained in:
Dag-Erling Smørgrav 2007-05-16 08:37:40 +00:00
parent f0cd539d5e
commit d1e75b81e3

View File

@ -1137,9 +1137,8 @@ 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.
@(cd ${DESTDIR}/ && for file in ${OLD_FILES}; do \ @(for file in ${OLD_FILES}; do \
if [ -f "./$${file}" -o -L "./$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
chflags noschg "./$${file}" 2>/dev/null || true; \
rm ${RM_I} "${DESTDIR}/$${file}"; \ rm ${RM_I} "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done)
@ -1157,8 +1156,8 @@ delete-old-files:
check-old-files: check-old-files:
@echo ">>> Checking for old files" @echo ">>> Checking for old files"
@(cd ${DESTDIR}/ && for file in ${OLD_FILES}; do \ @(for file in ${OLD_FILES}; do \
if [ -f "./$${file}" -o -L "./$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
echo "${DESTDIR}/$${file}"; \ echo "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done)
@ -1175,9 +1174,8 @@ 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
@(cd ${DESTDIR}/ && for file in ${OLD_LIBS}; do \ @(for file in ${OLD_LIBS}; do \
if [ -f "./$${file}" -o -L "./$${file}" ]; then \ if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
chflags noschg "./$${file}" 2>/dev/null || true; \
rm ${RM_I} "${DESTDIR}/$${file}"; \ rm ${RM_I} "${DESTDIR}/$${file}"; \
fi; \ fi; \
done) done)
@ -1185,37 +1183,33 @@ delete-old-libs:
check-old-libs: check-old-libs:
@echo ">>> Checking for old libraries" @echo ">>> Checking for old libraries"
@(cd ${DESTDIR}/ && for file in ${OLD_LIBS}; do \ @(for file in ${OLD_LIBS}; do \
if [ -f "./$${file}" -o -L "./$${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} @(for dir in ${OLD_DIRS}; do \
# Don't fail if an old directory isn't empty. # Don't fail if an old directory isn't empty.
@if [ -d "${DESTDIR}/${dir}" ]; then \ if [ -d "${DESTDIR}/$${dir}" ]; then \
rmdir -v "${DESTDIR}/${dir}" || true; \ rmdir -v "${DESTDIR}/$${dir}" || true; \
else \ elif [ -L "${DESTDIR}/$${dir}" ]; then \
if [ -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; \
fi done)
.endfor
@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} @(for dir in ${OLD_DIRS}; do \
@if [ -d "${DESTDIR}/${dir}" ]; then \ if [ -d "${DESTDIR}/$${dir}" ]; then \
echo "${DESTDIR}/${dir}"; \ echo "${DESTDIR}/$${dir}"; \
else \ elif [ -L "${DESTDIR}/$${dir}" ]; then \
if [ -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; \
fi done)
.endfor
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'."