diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2016-05-17 13:13:17 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2016-05-17 13:13:17 +0800 |
commit | 480aa69f5a087adc85c0d7204fb6736eb06ed8a8 (patch) | |
tree | 0abcbce3cae28b73a875e2e3c84441ad16af35dc | |
parent | bbdeaa96fff76ca0b3696944f89948d001c56e09 (diff) | |
download | android-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-- | functions | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -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?" |