From 447180323fe666a2dfc77edcaddd0b30f6a3c2f1 Mon Sep 17 00:00:00 2001 From: Oleg Ginzburg Date: Fri, 10 May 2013 01:07:14 +0400 Subject: [PATCH 1/2] Removed without much sense line that search for empty directories in WRKDIRPREFIX after each port. If you define WRKDIRPREFIX (such as /tmp) and portmaster execite with -C and -K flags, this procedure greatly increases the time portmaster because /tmp/usr/ports have are large structures while the deletion of empty directories there is no benefit --- portmaster | 4 ---- 1 file changed, 4 deletions(-) diff --git a/portmaster b/portmaster index 0f02f750..8637f1ba 100755 --- a/portmaster +++ b/portmaster @@ -176,10 +176,6 @@ parent_exit () { fi sleep 2 done - - pm_v "===>>> Removing empty directories from WRKDIRPREFIX" - [ -n "$needws" ] && echo '' || pm_v - find $PM_WRKDIRPREFIX -depth -mindepth 1 -type d -empty -delete 2>/dev/null fi case "$DISPLAY_LIST" in From 7b4afcefb2f57bdada342eb43eeb27fda996325f Mon Sep 17 00:00:00 2001 From: Oleg Ginzburg Date: Fri, 10 May 2013 01:54:47 +0400 Subject: [PATCH 2/2] WRKDIRPREFIX cleanup should be optional --- files/portmaster.8 | 2 ++ portmaster | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/files/portmaster.8 b/files/portmaster.8 index 8044e15c..0058fa87 100644 --- a/files/portmaster.8 +++ b/files/portmaster.8 @@ -335,6 +335,8 @@ hide details of the port build and install in a log file prevents 'make clean' from being run after building .It Fl B prevents creation of the backup package for the installed port +.It Fl E +always remove empty directory in WRKDIRPREFIX if set after each building .It Fl b create and keep a backup package of an installed port .It Fl g diff --git a/portmaster b/portmaster index 8637f1ba..7c36a2e4 100755 --- a/portmaster +++ b/portmaster @@ -176,6 +176,11 @@ parent_exit () { fi sleep 2 done + if [ -n "$ALWAYS_REMOVE_EMPTY_WRKDIR" ]; then + pm_v "===>>> Removing empty directories from WRKDIRPREFIX" + [ -n "$needws" ] && echo '' || pm_v + find $PM_WRKDIRPREFIX -depth -mindepth 1 -type d -empty -delete 2>/dev/null + fi fi case "$DISPLAY_LIST" in @@ -453,6 +458,7 @@ usage () { echo '' echo "--force-config run 'make config' for all ports (overrides -G)" echo "-C prevents 'make clean' from being run before building" + echo "-E always remove empty directory in WRKDIRPREFIX if set after each building" echo "-G prevents 'make config'" echo "-H hide details of the port build and install in a log file" echo "-K prevents 'make clean' from being run after building" @@ -713,11 +719,12 @@ set -- $newopts unset var newopts # Save switches for potential child processes -while getopts 'BCDFGHKLPRabde:fghilm:nop:r:stvwx:y' COMMAND_LINE_ARGUMENT ; do +while getopts 'BCDEFGHKLPRabde:fghilm:nop:r:stvwx:y' COMMAND_LINE_ARGUMENT ; do case "${COMMAND_LINE_ARGUMENT}" in B) NO_BACKUP=Bopt; ARGS="-B $ARGS" ;; C) DONT_PRE_CLEAN=Copt; ARGS="-C $ARGS" ;; D) DONT_SCRUB_DISTFILES=Dopt; ARGS="-D $ARGS" ;; + E) ALWAYS_REMOVE_EMPTY_WRKDIR=Eopt; ARGS="-E $ARGS" ;; F) FETCH_ONLY=Fopt; ARGS="-F $ARGS" ;; G) [ -z "$PM_FORCE_CONFIG" ] && { PM_NO_MAKE_CONFIG=Gopt; ARGS="-G $ARGS"; } ;;