summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2016-05-17 13:13:17 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2016-05-17 13:13:17 +0800
commit480aa69f5a087adc85c0d7204fb6736eb06ed8a8 (patch)
tree0abcbce3cae28b73a875e2e3c84441ad16af35dc
parentbbdeaa96fff76ca0b3696944f89948d001c56e09 (diff)
downloadandroid-patchsets-RLCR-16.05.tar.gz
functions: make apply command support for --local optionRLCR-16.05
so that we can apply patches to the local path we specified. By this way we can customize the project path on local side Change-Id: I6138d0d5b9f52a613fc05eac6d7aae278562d302 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--functions15
1 files changed, 13 insertions, 2 deletions
diff --git a/functions b/functions
index 61ccfe9..761b4e0 100644
--- a/functions
+++ b/functions
@@ -10,6 +10,7 @@ apply() {
local REPO
local DIR
local SERVER
+ local LOCAL_DIR
if [ "$1" = "--linaro" ]; then
SERVER="git://review.android.git.linaro.org/"
shift
@@ -21,14 +22,24 @@ apply() {
SERVER="https://android.googlesource.com/"
fi
- if echo "$1" |grep -q '^device/'; then
+ # Make specifying local path possible
+ if [ "$1" = "--local" ]; then
+ shift
+ LOCAL_DIR="$1"
+ shift
+ else
+ LOCAL_DIR="$1"
+ fi
+
+ # device and kernel have different path on repo to projects under platform
+ if echo "$1" |grep -q -e '^device/' -e '^kernel/'; then
REPO="$1"
else
REPO="platform/$1"
fi
DIR=`echo $2 |cut -d/ -f1 |rev |cut -b1-2 |rev`
- cd "$AOSP"/"$1"
+ cd "$AOSP"/"${LOCAL_DIR}"
echo "=== Applying $2 ==="
if ! git fetch "$SERVER$REPO" refs/changes/$DIR/"$2"; then
echo "Failed to fetch $2, typo in script?"