# HG changeset patch # User "Yann E. MORIN" # Date 1238189447 0 # Node ID f96f26d4a8552a15dc758fe6984dfe93486ab0a6 # Parent d1d192887a15d5d16f8ed2f5a46a7aaf16490ae2 Detect and abort on partially patched component. /trunk/scripts/functions | 18 15 3 0 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff -r d1d192887a15 -r f96f26d4a855 scripts/functions --- a/scripts/functions Fri Mar 27 18:53:54 2009 +0000 +++ b/scripts/functions Fri Mar 27 21:30:47 2009 +0000 @@ -642,9 +642,9 @@ # Some tarballs have read-only files... :-( # Because of nochdir, we don't know where we are, so chmod all # the src tree - chmod -R u+w "${CT_SRC_DIR}" + CT_DoExecLog DEBUG chmod -R u+w "${CT_SRC_DIR}" - touch "${CT_SRC_DIR}/.${basename}.extracted" + CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.extracted" [ "${nochdir}" = "nochdir" ] || CT_Popd } @@ -665,6 +665,17 @@ return 0 fi + # Check if already partially patched + if [ -e "${CT_SRC_DIR}/.${basename}.patching" ]; then + CT_DoLog ERROR "The '${basename}' sources were partially patched." + CT_DoLog ERROR "Please remove first:" + CT_DoLog ERROR " - the source dir for '${basename}', in '${CT_SRC_DIR}'" + CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.extracted'" + CT_DoLog ERROR " - the file '${CT_SRC_DIR}/.${basename}.patching'" + CT_Abort "I'll stop now to avoid any carnage..." + fi + touch "${CT_SRC_DIR}/.${basename}.patching" + [ "${nochdir}" = "nochdir" ] || CT_Pushd "${CT_SRC_DIR}/${basename}" CT_DoLog EXTRA "Patching '${basename}'" @@ -695,7 +706,8 @@ done fi - touch "${CT_SRC_DIR}/.${basename}.patched" + CT_DoExecLog DEBUG rm -f "${CT_SRC_DIR}/.${basename}.patching" + CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.patched" [ "${nochdir}" = "nochdir" ] || CT_Popd }