summaryrefslogtreecommitdiff
path: root/libpng.sh
blob: 9b98006bb97951e9658d4870763e008b1eda5bd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
. $(dirname $0)/functions

# Unfortunately, Android's libpng doesn't share history with the
# official libpng git repository.
# git rebase and friends aren't as useful as they should be.
# Let's fix this, however... linaro-upstream-* branches are based
# on the upstream git repositories.

checkout platform/external/libpng

cd $SRC/platform/external/libpng

V=$(latest $(git tag |grep ^v |grep -vE '(alpha|beta|pre|rc)' |grep -v '[a-z]$' |sed -e 's,^v,,'))

if git branch -a |grep -q linaro-upstream-$V; then
	ok "libpng is up to date."
	exit 0
fi

notice "Updating libpng to $V"

LATEST_LINARO=$(latest $(git branch -a |grep origin/linaro-upstream- |sed -e 's,^.*/linaro-upstream-,,'))

git checkout -b linaro-upstream-work-$TIMESTAMP origin/linaro-upstream-$LATEST_LINARO

if git rebase v$V; then
	notice "Auto-updated libpng to $V."
else
	error "Couldn't auto-update libpng - patch failed to rebase."
	error "Please fix manually and commit to a branch called"
	error "linaro-upstream-$V."
	exit 1
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