. $(dirname $0)/functions vertonumber () { local VERSIONID=$1 local V1=$(echo $VERSIONID | cut -d. -f1) local V2=$(echo $VERSIONID | cut -d. -f2) local V3=$(echo $VERSIONID | cut -d. -f3) local V="$V1$V2$V3" echo -n $V } numbertover () { local VERSIONID=$1 local V1=$(echo $VERSIONID | cut -d. -f1) local V2=$(echo $VERSIONID | cut -d. -f2) local V3=$(echo $VERSIONID | cut -d. -f3) local V="v$V1.$V2.$V3" echo -n $V } cd $SRC/platform/external if [ -d elfutils-upstream ]; then cd elfutils-upstream git checkout master git pull else git clone git://sourceware.org/git/elfutils.git elfutils-upstream cd elfutils-upstream fi NEW_VERSION=$(latest $(git tag | grep -E 'elfutils-' | sed -e 's,^elfutils-0.,,')) echo "NEW_VERSION = 0.$NEW_VERSION" checkout platform/external/elfutils cd $SRC/platform/external/elfutils if git branch -a |grep -q linaro-upstream-0.$NEW_VERSION; then ok "elfutils is up to date." exit 0 fi git checkout -b linaro-upstream-work-$TIMESTAMP aosp/master AOSPVER=$(latest $(grep "Version" NEWS | sed -e 's,^Version 0.,,'| sed -e "s/:/ /g")) echo "AOSPVER = 0.$AOSPVER" if [ "$NEW_VERSION" = "$AOSPVER" ]; then notice "elfutils is up to date in AOSP master, copying its work" else LATEST_LINARO=$(latest $(git branch -a |grep origin/linaro-upstream |sed -e 's,.*-0.,,')) if [ -n "$LATEST_LINARO" ]; then if [ "$(latest $LATEST_LINARO $AOSPVER)" != "$AOSPVER" ]; then git checkout linaro-upstream-$LATEST_LINARO || git checkout -b linaro-upstream-$LATEST_LINARO origin/linaro-upstream-$LATEST_LINARO fi fi notice "Updating elfutils to $NEW_VERSION" rm -f Android.patch cd ../elfutils-upstream git checkout -b linaro-upstream-work-$TIMESTAMP elfutils-0.$AOSPVER cd ../elfutils for i in *; do if [ -e ../elfutils-upstream/$i ]; then diff -ruN ../elfutils-upstream/$i $i >>Android.patch fi done cd ../elfutils-upstream git checkout master git branch -D linaro-upstream-work-$TIMESTAMP git checkout -b linaro-upstream-work-$TIMESTAMP elfutils-0.$NEW_VERSION cd ../elfutils for i in *; do if [ -e ../elfutils-upstream/$i ]; then cp -rf ../elfutils-upstream/$i . fi done if patch -p0