1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-19 03:52:17 +00:00
freebsd-ports/devel/porttools/files/patch-cmd_test.in
Pav Lucistnik d289501472 - Add checking of empty directories to leftover check
PR:		ports/71363
Submitted by:	leeym
2005-07-15 18:53:23 +00:00

31 lines
1.1 KiB
Plaintext

--- cmd_test.in.orig Sat Aug 7 06:10:14 2004
+++ cmd_test.in Tue Sep 7 01:25:08 2004
@@ -178,7 +178,7 @@
done
# Check for extra files left
-echo "===> Extra files check"
+echo "===> Extra files and directories check"
if [ -d ${PREFIX} -a "${USE_X_PREFIX}" != "yes" ]
then
# Remove PREFIX from the extra files list
@@ -186,6 +186,9 @@
find ${PREFIX} ! -type d | \
egrep -v "${PREFIX}/share/nls/(POSIX|en_US.US-ASCII)" | \
sed -e "s,^${PREFIX}/,,"
+ sudo find ${LOCALBASE}/ -type d | sed "s,^${LOCALBASE}/,," | sort > ${PREFIX}.PLIST_DIRS.before
+ sudo find ${PREFIX}/ -type d | sed "s,^${PREFIX}/,," | sort > ${PREFIX}.PLIST_DIRS.after
+ comm -13 ${PREFIX}.PLIST_DIRS.before ${PREFIX}.PLIST_DIRS.after | sort -r | awk '{print "@unexec rmdir %D/"$1" 2>/dev/null || true"}'
fi
# Finish with a clean workspace
@@ -196,7 +199,7 @@
if [ "${USE_X_PREFIX}" != "yes" -a -d ${PREFIX} ]
then
echo "===> Removing existing ${PREFIX} dir"
- [ "${PREFIX}" != "${LOCALBASE}" ] && sudo rm -rf ${PREFIX}
+ [ "${PREFIX}" != "${LOCALBASE}" ] && sudo rm -rf ${PREFIX} ${PREFIX}.PLIST_DIRS.before ${PREFIX}.PLIST_DIRS.after
fi
sudo rm -rf ${PKG_DBDIR}
fi