Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(378)

Unified Diff: tools/common-includes.sh

Issue 10538056: Merged r11546 into 3.9 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.9
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/check-static-initializers.sh ('k') | tools/merge-to-branch.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/common-includes.sh
diff --git a/tools/common-includes.sh b/tools/common-includes.sh
index 8f0e78b60180bcbf5a678870113b0e43b7faa3a7..2b806caa5f44e143ebf70b7d25e55f27786b98b8 100644
--- a/tools/common-includes.sh
+++ b/tools/common-includes.sh
@@ -77,20 +77,27 @@ delete_branch() {
persist() {
local VARNAME=$1
local FILE="$PERSISTFILE_BASENAME-$VARNAME"
- echo "${!VARNAME}" > $FILE
+ local VALUE="${!VARNAME}"
+ if [ -z "$VALUE" ] ; then
+ VALUE="__EMPTY__"
+ fi
+ echo "$VALUE" > $FILE
}
restore() {
local VARNAME=$1
local FILE="$PERSISTFILE_BASENAME-$VARNAME"
local VALUE="$(cat $FILE)"
+ [[ -z "$VALUE" ]] && die "Variable '$VARNAME' could not be restored."
+ if [ "$VALUE" == "__EMPTY__" ] ; then
+ VALUE=""
+ fi
eval "$VARNAME=\"$VALUE\""
}
restore_if_unset() {
local VARNAME=$1
[[ -z "${!VARNAME}" ]] && restore "$VARNAME"
- [[ -z "${!VARNAME}" ]] && die "Variable '$VARNAME' could not be restored."
}
initial_environment_checks() {
@@ -175,9 +182,10 @@ the uploaded CL."
# Takes a file containing the patch to apply as first argument.
apply_patch() {
- patch -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
+ patch $REVERSE_PATCH -p1 < "$1" > "$PATCH_OUTPUT_FILE" || \
{ cat "$PATCH_OUTPUT_FILE" && die "Applying the patch failed."; }
- tee < "$PATCH_OUTPUT_FILE" >(awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
+ tee < "$PATCH_OUTPUT_FILE" >(grep "patching file" \
+ | awk '{print $NF}' >> "$TOUCHED_FILES_FILE")
rm "$PATCH_OUTPUT_FILE"
}
« no previous file with comments | « tools/check-static-initializers.sh ('k') | tools/merge-to-branch.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698