Detect and abort on partially patched component.
/trunk/scripts/functions | 18 15 3 0 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
1.1 --- a/scripts/functions Fri Mar 27 18:53:54 2009 +0000
1.2 +++ b/scripts/functions Fri Mar 27 21:30:47 2009 +0000
1.3 @@ -642,9 +642,9 @@
1.4 # Some tarballs have read-only files... :-(
1.5 # Because of nochdir, we don't know where we are, so chmod all
1.6 # the src tree
1.7 - chmod -R u+w "${CT_SRC_DIR}"
1.8 + CT_DoExecLog DEBUG chmod -R u+w "${CT_SRC_DIR}"
1.9
1.10 - touch "${CT_SRC_DIR}/.${basename}.extracted"
1.11 + CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.extracted"
1.12
1.13 [ "${nochdir}" = "nochdir" ] || CT_Popd
1.14 }
1.15 @@ -665,6 +665,17 @@
1.16 return 0
1.17 fi
1.18
1.19 + # Check if already partially patched
1.20 + if [ -e "${CT_SRC_DIR}/.${basename}.patching" ]; then
1.21 + CT_DoLog ERROR "The '${basename}' sources were partially patched."
1.22 + CT_DoLog ERROR "Please remove first:"
1.23 + CT_DoLog ERROR " - the source dir for '${basename}', in '${CT_SRC_DIR}'"
1.24 + CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.extracted'"
1.25 + CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.patching'"
1.26 + CT_Abort "I'll stop now to avoid any carnage..."
1.27 + fi
1.28 + touch "${CT_SRC_DIR}/.${basename}.patching"
1.29 +
1.30 [ "${nochdir}" = "nochdir" ] || CT_Pushd "${CT_SRC_DIR}/${basename}"
1.31
1.32 CT_DoLog EXTRA "Patching '${basename}'"
1.33 @@ -695,7 +706,8 @@
1.34 done
1.35 fi
1.36
1.37 - touch "${CT_SRC_DIR}/.${basename}.patched"
1.38 + CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${basename}.patching"
1.39 + CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.patched"
1.40
1.41 [ "${nochdir}" = "nochdir" ] || CT_Popd
1.42 }