diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-05-13 18:15:50 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2007-05-13 18:15:50 +0000 |
commit | 61305271cd22d881f05e18822133b658cf78c32a (patch) | |
tree | 68d976b624cf2ef8d84be68bf8e19e2f80a642bc /Makefile.inc1 | |
parent | abeda21e8d1cca7d87a41d4881091a61374872f6 (diff) | |
download | src-61305271cd22d881f05e18822133b658cf78c32a.tar.gz src-61305271cd22d881f05e18822133b658cf78c32a.zip |
Greatly speed up {check,delete}-old* by replacing make loops with sh loops.
MFC after: 3 weeks
Notes
Notes:
svn path=/head/; revision=169531
Diffstat (limited to 'Makefile.inc1')
-rw-r--r-- | Makefile.inc1 | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index ae27fbc517ef..345ba4563475 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1135,18 +1135,14 @@ RM_I=-v delete-old-files: @echo ">>> Removing old files (only deletes safe to delete libs)" -.for file in ${OLD_FILES} # Ask for every old file if the user really wants to remove it. # It's annoying, but better safe than sorry. - @if [ -f "${DESTDIR}/${file}" -o -L "${DESTDIR}/${file}" ]; then \ - rm ${RM_I} "${DESTDIR}/${file}" || true; \ - if [ -f "${DESTDIR}/${file}" -o -L "${DESTDIR}/${file}" ]; then\ - echo "Removing schg flag on ${DESTDIR}/${file}"; \ - chflags noschg "${DESTDIR}/${file}"; \ - rm ${RM_I} "${DESTDIR}/${file}"; \ + @(cd ${DESTDIR}/ && for file in ${OLD_FILES}; do \ + if [ -f "./$${file}" -o -L "./$${file}" ]; then \ + chflags noschg "./$${file}" 2>/dev/null || true; \ + rm ${RM_I} "${DESTDIR}/$${file}" || true; \ fi; \ - fi -.endfor + done) # Remove catpages without corresponding manpages. @3<&0; \ find ${DESTDIR}/usr/share/man/cat* ! -type d | \ @@ -1161,11 +1157,11 @@ delete-old-files: check-old-files: @echo ">>> Checking for old files" -.for file in ${OLD_FILES} - @if [ -f "${DESTDIR}/${file}" -o -L "${DESTDIR}/${file}" ]; then \ - echo "${DESTDIR}/${file}"; \ - fi -.endfor + @(cd ${DESTDIR}/ && for file in ${OLD_FILES}; do \ + if [ -f "./$${file}" -o -L "./$${file}" ]; then \ + echo "${DESTDIR}/$${file}"; \ + fi; \ + done) # Check for catpages without corresponding manpages. @find ${DESTDIR}/usr/share/man/cat* ! -type d | \ sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \ @@ -1179,25 +1175,21 @@ check-old-files: delete-old-libs: @echo ">>> Removing old libraries" @echo "${OLD_LIBS_MESSAGE}" | fmt -.for file in ${OLD_LIBS} - @if [ -f "${DESTDIR}/${file}" -o -L "${DESTDIR}/${file}" ]; then \ - rm ${RM_I} "${DESTDIR}/${file}" || true; \ - if [ -f "${DESTDIR}/${file}" -o -L "${DESTDIR}/${file}" ]; then\ - echo "Removing schg flag on ${DESTDIR}/${file}"; \ - chflags noschg "${DESTDIR}/${file}"; \ - rm ${RM_I} "${DESTDIR}/${file}"; \ + @(cd ${DESTDIR}/ && for file in ${OLD_LIBS}; do \ + if [ -f "./$${file}" -o -L "./$${file}" ]; then \ + chflags noschg "./$${file}" 2>/dev/null || true; \ + rm ${RM_I} "${DESTDIR}/$${file}" || true; \ fi; \ - fi -.endfor + done) @echo ">>> Old libraries removed" check-old-libs: @echo ">>> Checking for old libraries" -.for file in ${OLD_LIBS} - @if [ -f "${DESTDIR}/${file}" -o -L "${DESTDIR}/${file}" ]; then \ - echo "${DESTDIR}/${file}"; \ - fi -.endfor + @(cd ${DESTDIR}/ && for file in ${OLD_LIBS}; do \ + if [ -f "./$${file}" -o -L "./$${file}" ]; then \ + echo "${DESTDIR}/$${file}"; \ + fi; \ + done) delete-old-dirs: @echo ">>> Removing old directories" |