summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfreetype.sh27
1 files changed, 18 insertions, 9 deletions
diff --git a/freetype.sh b/freetype.sh
index 7aa0c91..48171d5 100755
--- a/freetype.sh
+++ b/freetype.sh
@@ -39,7 +39,6 @@ fi
NEW_VERSION=$(latest $(git tag | grep -E 'VER-[0-9]+\-'|sed -e 's,^VER-,,' |grep -v '[A-Z]' |grep -v '[a-z]'|sed -e "s/-/./g"))
echo "NEW_VERSION = $NEW_VERSION"
-
checkout platform/external/freetype
cd $SRC/platform/external/freetype
@@ -50,18 +49,22 @@ fi
git checkout -b linaro-upstream-work-$TIMESTAMP aosp/master
-AOSPVER_A=$(grep "Version:" README.version)
-#echo "AOSPVER_A = $AOSPVER_A"
+AOSPVER_A=$(grep "define FREETYPE_MAJOR" include/freetype/freetype.h |sed -e 's,.* ,,')
+echo "AOSPVER_A = $AOSPVER_A"
-AOSPVER_B=$(echo "$AOSPVER_A" | grep -oP '(?<=.)\d+(?=\.)'| awk '{print $1}' ORS='.')
-#echo "AOSPVER_B = $AOSPVER_B"
+AOSPVER_B=$(grep "define FREETYPE_MINOR" include/freetype/freetype.h |sed -e 's,.* ,,')
+echo "AOSPVER_B = $AOSPVER_B"
-AOSPVER_C=$(echo "$AOSPVER_A" | grep -oP '(\d+)(?!.*\d)')
-#echo "AOSPVER_C = $AOSPVER_C"
+AOSPVER_C=$(grep "define FREETYPE_PATCH" include/freetype/freetype.h |sed -e 's,.* ,,')
+echo "AOSPVER_C = $AOSPVER_C"
-AOSPVER=$AOSPVER_B$AOSPVER_C
+AOSPVER=$AOSPVER_A.$AOSPVER_B.$AOSPVER_C
echo "AOSPVER = $AOSPVER"
+# Let's see if AOSP uses a git snapshot instead of a release right now...
+AOSPGIT="$(grep Version: README.version |sed -e 's,.* ,,')"
+# If there's a . in there, it's a version number -- otherwise it's a git commit ID
+echo $AOSPGIT |grep -q '\.' && AOSPGIT=""
CHECK_VERSION=$(latest $NEW_VERSION $AOSPVER)
echo "CHECK_VERSION = $CHECK_VERSION"
@@ -83,7 +86,13 @@ else
rm -f Android.patch
cd $SRC/platform/external/freetype-upstream
- git checkout -b linaro-upstream-work-$TIMESTAMP $(replaceover $AOSPVER)
+ if test -n "$AOSPGIT"; then
+ echo git checkout -b linaro-upstream-work-$TIMESTAMP $AOSPGIT
+ git checkout -b linaro-upstream-work-$TIMESTAMP $AOSPGIT
+ else
+ echo git checkout -b linaro-upstream-work-$TIMESTAMP $(replaceover $AOSPVER)
+ git checkout -b linaro-upstream-work-$TIMESTAMP $(replaceover $AOSPVER)
+ fi
cd $SRC/platform/external/freetype/src
for i in *; do
if [ -e ../../freetype-upstream/src/$i ]; then