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:
parent
f0cd539d5e
commit
d1e75b81e3
@ -1137,9 +1137,8 @@ delete-old-files:
|
||||
@echo ">>> Removing old files (only deletes safe to delete libs)"
|
||||
# Ask for every old file if the user really wants to remove it.
|
||||
# It's annoying, but better safe than sorry.
|
||||
@(cd ${DESTDIR}/ && for file in ${OLD_FILES}; do \
|
||||
if [ -f "./$${file}" -o -L "./$${file}" ]; then \
|
||||
chflags noschg "./$${file}" 2>/dev/null || true; \
|
||||
@(for file in ${OLD_FILES}; do \
|
||||
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
||||
rm ${RM_I} "${DESTDIR}/$${file}"; \
|
||||
fi; \
|
||||
done)
|
||||
@ -1157,8 +1156,8 @@ delete-old-files:
|
||||
|
||||
check-old-files:
|
||||
@echo ">>> Checking for old files"
|
||||
@(cd ${DESTDIR}/ && for file in ${OLD_FILES}; do \
|
||||
if [ -f "./$${file}" -o -L "./$${file}" ]; then \
|
||||
@(for file in ${OLD_FILES}; do \
|
||||
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
||||
echo "${DESTDIR}/$${file}"; \
|
||||
fi; \
|
||||
done)
|
||||
@ -1175,9 +1174,8 @@ check-old-files:
|
||||
delete-old-libs:
|
||||
@echo ">>> Removing old libraries"
|
||||
@echo "${OLD_LIBS_MESSAGE}" | fmt
|
||||
@(cd ${DESTDIR}/ && for file in ${OLD_LIBS}; do \
|
||||
if [ -f "./$${file}" -o -L "./$${file}" ]; then \
|
||||
chflags noschg "./$${file}" 2>/dev/null || true; \
|
||||
@(for file in ${OLD_LIBS}; do \
|
||||
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
||||
rm ${RM_I} "${DESTDIR}/$${file}"; \
|
||||
fi; \
|
||||
done)
|
||||
@ -1185,37 +1183,33 @@ delete-old-libs:
|
||||
|
||||
check-old-libs:
|
||||
@echo ">>> Checking for old libraries"
|
||||
@(cd ${DESTDIR}/ && for file in ${OLD_LIBS}; do \
|
||||
if [ -f "./$${file}" -o -L "./$${file}" ]; then \
|
||||
@(for file in ${OLD_LIBS}; do \
|
||||
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
||||
echo "${DESTDIR}/$${file}"; \
|
||||
fi; \
|
||||
done)
|
||||
|
||||
delete-old-dirs:
|
||||
@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.
|
||||
@if [ -d "${DESTDIR}/${dir}" ]; then \
|
||||
rmdir -v "${DESTDIR}/${dir}" || true; \
|
||||
else \
|
||||
if [ -L "${DESTDIR}/${dir}" ]; then \
|
||||
echo "${DESTDIR}/${dir} is a link, please remove everything manually."; \
|
||||
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
||||
rmdir -v "${DESTDIR}/$${dir}" || true; \
|
||||
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
||||
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
||||
fi; \
|
||||
fi
|
||||
.endfor
|
||||
done)
|
||||
@echo ">>> Old directories removed"
|
||||
|
||||
check-old-dirs:
|
||||
@echo ">>> Checking for old directories"
|
||||
.for dir in ${OLD_DIRS}
|
||||
@if [ -d "${DESTDIR}/${dir}" ]; then \
|
||||
echo "${DESTDIR}/${dir}"; \
|
||||
else \
|
||||
if [ -L "${DESTDIR}/${dir}" ]; then \
|
||||
echo "${DESTDIR}/${dir} is a link, please remove everything manually."; \
|
||||
@(for dir in ${OLD_DIRS}; do \
|
||||
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
||||
echo "${DESTDIR}/$${dir}"; \
|
||||
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
||||
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
||||
fi; \
|
||||
fi
|
||||
.endfor
|
||||
done)
|
||||
|
||||
delete-old: delete-old-files delete-old-dirs
|
||||
@echo "To remove old libraries run '${MAKE} delete-old-libs'."
|
||||
|
Loading…
Reference in New Issue
Block a user