aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2016-03-22 17:01:15 -0700
committerIgor Murashkin <iam@google.com>2016-03-22 17:01:15 -0700
commit3b720bd591345aba037c51e0639a7bd7c4893561 (patch)
tree518fa0df10274b408df22ed576831870ea2f6af3
parentad89e101fea7da5f43b4664942cbcf93f11ba92f (diff)
downloadsnakeyaml-3b720bd591345aba037c51e0639a7bd7c4893561.tar.gz
build: Fix build on AOSP
Fix an issue where some 'cp' commands do not create directories recursively. Bug: 27552463 Change-Id: Ib1c70bf0c7acdfcbc5a664246c941cd5e656354b
-rwxr-xr-xpatch-android-src6
1 files changed, 6 insertions, 0 deletions
diff --git a/patch-android-src b/patch-android-src
index 011c0074..2b515ce2 100755
--- a/patch-android-src
+++ b/patch-android-src
@@ -30,6 +30,7 @@ src_file_prefix="$1"
src_file="$2"
src_file_with_prefix="$2"
dst_file="$3"
+dst_dir="$(dirname "$dst_file")"
# Sanity checking
@@ -79,6 +80,11 @@ fi
set -e
# Copy the src file and then apply the patch to it.
+mkdir -p "$dst_dir"
cp "$src_file_with_prefix" "$dst_file"
+if ! [[ -f "$dst_file" ]]; then
+ echo "File "$dst_file" does not exist; patching will fail" >&2
+ exit 1
+fi
patch -p0 "$dst_file" "$patch_file_src"
echo "Successfully applied patch $patch_file_src into copy of file $dst_file"