Skip to content

Commit

Permalink
Add an option to remove install dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Loc Nguyen authored and akritid committed Mar 1, 2022
1 parent 5ce5604 commit 4c24b31
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion rbuild
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ function rm_build_dir {
$SSH $BUILD_HOST "rm -rf \"$BUILD_DIR\""
}

function rm_install_dir {
echo Removing $BUILD_HOST:$INSTALL_DIR/$BASENAME
$SSH $BUILD_HOST "rm -rf \"$INSTALL_DIR/$BASENAME\""
}

function deploy {
if [ -z "$DEPLOY_HOST" ]; then
echo >&2 "DEPLOY_HOST not set"
Expand Down Expand Up @@ -168,7 +173,7 @@ _EOF_
}

noargs=1
while getopts "he:scAaB:brtdD:SRoj:i:x" arg; do
while getopts "he:scAaB:brutdD:SRoj:i:x" arg; do
unset noargs
case $arg in
h)
Expand All @@ -181,6 +186,7 @@ while getopts "he:scAaB:brtdD:SRoj:i:x" arg; do
echo -e "-B TARGET\tRun 'make TARGET' on BUILD_HOST"
echo -e "-b\t\tRun 'make install' on BUILD_HOST"
echo -e "-r\t\tRemove build directory (when 'make clean' is not enough)"
echo -e "-u\t\tRemove install directory"
echo -e "-d\t\tDeploy binaries from BUILD_HOST to DEPLOY_HOST"
echo -e "-D HOST\t\tDeploy binaries from BUILD_HOST to HOST"
echo -e "-S\t\tDeploy source code from BUILD_HOST to DEPLOY_HOST (e.g. for GDB)"
Expand Down Expand Up @@ -221,6 +227,9 @@ while getopts "he:scAaB:brtdD:SRoj:i:x" arg; do
r)
do_rm_build_dir=1
;;
u)
do_rm_install_dir=1
;;
b)
do_build=1
;;
Expand Down Expand Up @@ -285,6 +294,10 @@ if [ $do_rm_build_dir ]; then
rm_build_dir || exit 1
fi

if [ $do_rm_install_dir ]; then
rm_install_dir || exit 1
fi

if [ $do_autoreconf ]; then
autoreconf || exit 1
fi
Expand Down

0 comments on commit 4c24b31

Please sign in to comment.