diff options
Diffstat (limited to 'pcre.sh')
-rwxr-xr-x | pcre.sh | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -0,0 +1,47 @@ +. $(dirname $0)/functions + +vertonumber () { + local VERSIONID=$1 + local V1=$(echo $VERSIONID | cut -d. -f1) + local V2=$(echo $VERSIONID | cut -d. -f2) + local V="$V1$V2" + echo -n $V +} + +NEW_VERSION=$(latest $(curl ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ | grep pcre- | cut -d "-" -f8 | cut -d . -f1,2)) +echo "NEW_VERSION = $NEW_VERSION" + +checkout platform/external/pcre + +cd $SRC/platform/external/pcre + +if git branch -a |grep -q linaro-upstream-$NEW_VERSION; then + ok "pcre is up to date." + exit 0 +fi + +git checkout -b linaro-upstream-work-$TIMESTAMP aosp/master + +AOSPVER=$(grep PACKAGE_VERSION config.h | cut -d \" -f2) +echo "AOSPVER = $AOSPVER" + +if [ "$(vertonumber $NEW_VERSION)" -le "$(vertonumber $AOSPVER)" ]; then + notice "pcre is up to date in AOSP master, copying its work" +else + notice "Updating pcre to $NEW_VERSION" + wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-$NEW_VERSION.tar.bz2 + tar -jxvf pcre-$NEW_VERSION.tar.bz2 + rm -rf dist + mv pcre-$NEW_VERSION dist + rm pcre-$NEW_VERSION.tar.bz2 + + git commit -asm "Update to pcre $NEW_VERSION" + git clean -d -f -x +fi + +git push origin linaro-upstream-work-$TIMESTAMP:linaro-upstream-$NEW_VERSION +git pull +git checkout -b linaro-upstream-$NEW_VERSION origin/linaro-upstream-$NEW_VERSION +git branch -D linaro-upstream-work-$TIMESTAMP +pwd + |