summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-03-27 21:30:47 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2009-03-27 21:30:47 (GMT)
commit3a181fe51460375b8c08be8d86ff11f1c8e80855 (patch)
tree3921891819af8a3e0e490e6c248cb2e09b7eef85 /scripts
parentb79ffe16c64dbe3005888fd94eb5bd9f43443e94 (diff)
Detect and abort on partially patched component.
/trunk/scripts/functions | 18 15 3 0 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions18
1 files changed, 15 insertions, 3 deletions
diff --git a/scripts/functions b/scripts/functions
index b9f6d65..581096d 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -642,9 +642,9 @@ CT_Extract() {
# 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 @@ CT_Patch() {
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 @@ CT_Patch() {
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
}