From 26e287836b13fdb777857a47fe48f504d77d9696 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 30 Nov 2016 19:06:47 +0000 Subject: [PATCH] Cleanup old debug dirs in delete-old-dirs target Any .debug or .symbols files under /usr/lib/debug which correspond to OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up by the delete-old target. Make this also apply to any OLD_DIRS entries. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D8683 --- Makefile.inc1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 878e6ce01deb..c3308228212d 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2404,6 +2404,11 @@ delete-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done @echo ">>> Old directories removed" @@ -2418,6 +2423,11 @@ check-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done delete-old: delete-old-files delete-old-dirs .PHONY