svn commit: r216684 - user/dougb/portmaster
Doug Barton
dougb at FreeBSD.org
Fri Dec 24 04:52:54 UTC 2010
Author: dougb
Date: Fri Dec 24 04:52:53 2010
New Revision: 216684
URL: http://svn.freebsd.org/changeset/base/216684
Log:
Clean up empty directories WRKDIRPREFIX when the parent exits
This is not only tidier, but it also helps the situation when
portmaster is occasionally run as root even though most usage
is with the built-in sudo support.
Modified:
user/dougb/portmaster/portmaster
Modified: user/dougb/portmaster/portmaster
==============================================================================
--- user/dougb/portmaster/portmaster Fri Dec 24 01:37:13 2010 (r216683)
+++ user/dougb/portmaster/portmaster Fri Dec 24 04:52:53 2010 (r216684)
@@ -146,6 +146,9 @@ parent_exit () {
for f in ${TMPDIR}/f-${PM_PARENT_PID}-*; do pm_unlink $f ; done
+ [ -n "$PM_WRKDIRPREFIX" ] &&
+ find -d $PM_WRKDIRPREFIX -mindepth 1 -type d -empty -delete 2>/dev/null
+
case "$DISPLAY_LIST" in
*' '*) if [ -n "$1" ]; then
echo "===>>> There are messages from installed ports to display,"
@@ -3042,7 +3045,11 @@ fi
# Do these things first time through
if [ -z "$PM_INDEX_ONLY" -a -z "$PM_BUILDING" -a -z "$SHOW_WORK" -a -z "$NO_ACTION" ]; then
# Do not start this in the background until we are sure we are going to build
- [ "$$" -eq "$PM_PARENT_PID" -a -n "$DI_FILES" ] && (read_distinfos)&
+ if [ "$$" -eq "$PM_PARENT_PID" ]; then
+ [ -n "$DI_FILES" ] && (read_distinfos)&
+
+ PM_WRKDIRPREFIX=`pm_make_b -V WRKDIRPREFIX`
+ fi
# Handle the problem of manual fetching
[ -z "$PM_PACKAGES" ] && master_sites=`pm_make -V MASTER_SITES`
More information about the svn-src-user
mailing list