summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2015-05-17 00:30:05 +0200
committerBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2015-05-17 00:30:05 +0200
commit897f05ac8e45036890cc2630e4189c8ea2c6549c (patch)
tree957fe86b10cd54df60921c6f82b3eaf0bf44c751
parent9b49b83d39368a19a03eff927358cb98fccd2bd0 (diff)
downloadupdate-externals-897f05ac8e45036890cc2630e4189c8ea2c6549c.tar.gz
Add giflib updater
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
-rwxr-xr-xgiflib.sh72
1 files changed, 72 insertions, 0 deletions
diff --git a/giflib.sh b/giflib.sh
new file mode 100755
index 0000000..089eca6
--- /dev/null
+++ b/giflib.sh
@@ -0,0 +1,72 @@
+. $(dirname $0)/functions
+
+# Unfortunately, Android's giflib is cherry-picked files that don't
+# share history with the official giflib git repository.
+# git rebase and friends aren't as useful as they should be.
+
+cd $SRC/platform/external
+if [ -d giflib-upstream ]; then
+ cd giflib-upstream
+ git pull
+else
+ git clone git://git.code.sf.net/p/giflib/code giflib-upstream
+ cd giflib-upstream
+fi
+V=$(latest $(git tag |grep ^[0-9]))
+
+checkout platform/external/giflib
+
+cd $SRC/platform/external/giflib
+if git branch -a |grep -q linaro-upstream-$V; then
+ ok "giflib is up to date."
+ exit 0
+fi
+
+git checkout -b linaro-upstream-work-$TIMESTAMP aosp/master
+AOSPVER=$(grep GIFLIB_MAJOR gif_lib.h |cut -d' ' -f3).$(grep GIFLIB_MINOR gif_lib.h |cut -d' ' -f3).$(grep GIFLIB_RELEASE gif_lib.h |cut -d' ' -f3)
+
+if [ "$V" = "$AOSPVER" ]; then
+ notice "giflib is up to date in AOSP master, copying its work"
+else
+ notice "Updating giflib to $V"
+
+ rm -f Android.patch
+ cd ../giflib-upstream
+ git checkout -b linaro-upstream-work-$TIMESTAMP $AOSPVER
+ cd ../giflib
+ for i in *; do
+ if [ -e ../giflib-upstream/lib/$i ]; then
+ diff -u ../giflib-upstream/lib/$i $i >>Android.patch
+ fi
+ done
+ cd ../giflib-upstream
+ git checkout master
+ git branch -D linaro-upstream-work-$TIMESTAMP
+ git checkout -b linaro-upstream-work-$TIMESTAMP $V
+ cd ../giflib
+ for i in *; do
+ if [ -e ../giflib-upstream/lib/$i ]; then
+ cp -f ../giflib-upstream/lib/$i .
+ fi
+ done
+ if patch -p0 <Android.patch; then
+ notice "Auto-updated giflib to $V."
+ git commit -asm "Update to giflib $V"
+ git clean -d -f -x
+ else
+ error "Couldn't auto-update giflib - patch failed to apply."
+ error "Please fix manually and commit to a branch called"
+ error "linaro-upstream-$V."
+ exit 1
+ fi
+ cd ../giflib-external
+ git checkout master
+ git branch -D linaro-upstream-work-$TIMESTAMP
+ cd ../giflib
+fi
+
+git push origin linaro-upstream-work-$TIMESTAMP:linaro-upstream-$V
+git pull
+git checkout -b linaro-upstream-$V origin/linaro-upstream-$V
+git branch -D linaro-upstream-work-$TIMESTAMP
+pwd