diff --git a/scripts/functions b/scripts/functions index c7b1047f..4b279ac0 100644 --- a/scripts/functions +++ b/scripts/functions @@ -577,6 +577,12 @@ CT_Extract() { fi local full_file="${CT_TARBALLS_DIR}/${basename}${ext}" + # Check if already extracted + if [ -e "${CT_SRC_DIR}/.${basename}.extracted" ]; then + CT_DoLog DEBUG "Already extracted '${basename}'" + return 0 + fi + # Check if previously partially extracted if [ -e "${CT_SRC_DIR}/.${basename}.extracting" ]; then CT_DoLog ERROR "The '${basename}' sources were partially extracted." @@ -587,12 +593,6 @@ CT_Extract() { fi CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.extracting" - # Check if already extracted - if [ -e "${CT_SRC_DIR}/.${basename}.extracted" ]; then - CT_DoLog DEBUG "Already extracted '${basename}'" - return 0 - fi - [ "${nochdir}" = "nochdir" ] || CT_Pushd "${CT_SRC_DIR}" CT_DoLog EXTRA "Extracting '${basename}'" @@ -683,8 +683,8 @@ CT_Patch() { done fi - CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${basename}.patching" CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.patched" + CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${basename}.patching" [ "${nochdir}" = "nochdir" ] || CT_Popd }