Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removing empty directories search after each ports #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions files/portmaster.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions portmaster
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ 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
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
Expand Down Expand Up @@ -457,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"
Expand Down Expand Up @@ -717,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"; } ;;
Expand Down