diff options
author | Simon Rettberg | 2018-01-31 15:48:13 +0100 |
---|---|---|
committer | Simon Rettberg | 2018-01-31 15:48:13 +0100 |
commit | baf5ef4ca19d51ec4bd2443f10e5536afe3e6cb9 (patch) | |
tree | 4cb57f0806c159b3881770bd74af2dbadc3eb6f1 /core/bin | |
parent | [printergui] Refine port redirect rules to only match what's coming from VM a... (diff) | |
download | mltk-baf5ef4ca19d51ec4bd2443f10e5536afe3e6cb9.tar.gz mltk-baf5ef4ca19d51ec4bd2443f10e5536afe3e6cb9.tar.xz mltk-baf5ef4ca19d51ec4bd2443f10e5536afe3e6cb9.zip |
setup_target: Print warning when trying to clean invalid module
Diffstat (limited to 'core/bin')
-rwxr-xr-x | core/bin/setup_target | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/bin/setup_target b/core/bin/setup_target index f8f90801..da4c6678 100755 --- a/core/bin/setup_target +++ b/core/bin/setup_target @@ -534,10 +534,24 @@ clean_module() { local TARGET=${1%:*} local MODULE=${1#*:} + local MODULE_DIR="${TARGET}/${MODULE}" local MODULE_WORK_DIR="${ROOT_DIR}/tmp/work/${MODULE}" + if ! [ -d "$MODULE_DIR" ]; then + pwarning "No such module '$MODULE' in current target '$TARGET'" + pwarning "Check your spelling" + if [ -d "$MODULE_WORK_DIR" ]; then + pwarning "Continuing anyways since the according work dir exists..." + else + return 1 + fi + fi + # if kernel is to be cleaned, do it separately and return - [ "x$MODULE" == "xkernel" ] && clean_kernel_module "${TARGET}:${MODULE}" && return + if [ "x$MODULE" == "xkernel" ]; then + clean_kernel_module "${TARGET}:${MODULE}" + return + fi pinfo "Cleaning '$1'..." rm -rf -- "${MODULE_WORK_DIR}/build" || perror "Could not delete build path" @@ -548,6 +562,7 @@ clean_module() { # These are not in use anymore, but leave the cleanup here for upgraders rm -f -- "${MODULE_WORK_DIR}/.built" rm -f -- "${MODULE_WORK_DIR}/.fetched_source" + return 1 } clean_kernel_module() { |