summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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?"