X-Git-Url: http://git.pld-linux.org/?p=packages%2Fchromium-browser-bin.git;a=blobdiff_plain;f=update-source.sh;h=c93083411c1c40154ae339017cc3ed1ea3675b8a;hp=6c6b2765f259ef85233c338dafdd09d688c9cb2a;hb=HEAD;hpb=3ae8864035b7a11c032bf82b647b2f10718c3d88 diff --git a/update-source.sh b/update-source.sh old mode 100644 new mode 100755 index 6c6b276..c930834 --- a/update-source.sh +++ b/update-source.sh @@ -1,26 +1,24 @@ #!/bin/sh # Usage: -# ./update-source.sh [spec|rev] -# Download latest binary tarball based on latest release from -# buildbot, current version referenced in spec file, or custom -# version number. +# ./update-source.sh [spec|trunk|rev] +# Download latest binary tarball based on latest release documented +# in omaha proxy (or alternitavly the current version referenced in the +# spec file, or latest successfully trunk build, or custom version number. set -e dropin= +specfile=chromium-browser-bin.spec # Work in package dir dir=$(dirname "$0") cd "$dir" if [ "$1" == "spec" ]; then - rev=$(grep -e "^%define.*svnrev" chromium-browser-bin.spec | cut -f4) + rev=$(awk '/^%define.*svnrev/{print $NF}' $specfile) echo "Using $rev from spec file" -elif [ "$1" ]; then - rev=$1 - echo "Using $rev..." -else +elif [ "$1" == "trunk" ]; then echo "Fetching latest revno... " - rev=$(wget -q -O - http://build.chromium.org/buildbot/continuous/linux/LATEST/REVISION) - rev64=$(wget -q -O - http://build.chromium.org/buildbot/continuous/linux64/LATEST/REVISION) + rev=$(wget -q -O - http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) + rev64=$(wget -q -O - http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/LAST_CHANGE) # be sure that we use same rev on both arch if [ "$rev" != "$rev64" ]; then echo "Current 32bit build ($rev) does not match 64bit build ($rev64)" @@ -33,17 +31,24 @@ else rev=$rev64 fi fi - echo "$rev" - # TODO: use release branches instead of trunk. Current release can be looked up like this: - #linuxdev=$(wget -q -O - http://omahaproxy.appspot.com | grep '^linux,dev' | cut -d, -f3) + echo "Using trunk $rev" +elif [ "$1" ]; then + rev=$1 + echo "Using $rev..." +else + contents=$(wget -q -O - "http://omahaproxy.appspot.com/?os=linux&channel=dev") + rev=$(echo "$contents" | awk -F, '/^linux/{print $7}') + version=$(echo "$contents" | awk -F, '/^linux/{print $3}') + echo "Using devel channel $rev..." fi if [ ! -f chromium-browser32-r$rev.zip ]; then - wget http://build.chromium.org/buildbot/snapshots/chromium-rel-linux/$rev/chrome-linux.zip -c -O chromium-browser32-r$rev.zip + wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/$rev/chrome-linux.zip -c -O chromium-browser32-r$rev.zip + upload_32="chromium-browser32-r$rev.zip" fi if [ ! -f chromium-browser64-r$rev.zip ]; then - wget http://build.chromium.org/buildbot/snapshots/chromium-rel-linux-64/$rev/chrome-linux.zip -c -O chromium-browser64-r$rev.zip + wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/$rev/chrome-linux.zip -c -O chromium-browser64-r$rev.zip upload_64="chromium-browser64-r$rev.zip" fi @@ -60,17 +65,18 @@ if [ "$dropin" ]; then fi fi -specfile=chromium-browser-bin.spec oldrev=$(awk '/^%define[ ]+svnrev[ ]+/{print $NF}' $specfile) if [ "$oldrev" != "$rev" ]; then - # revno => VERSION hint by Caleb Maclennan - wget -q -O VERSION.sh http://src.chromium.org/viewvc/chrome/trunk/src/chrome/VERSION?revision=$rev - if grep -Ev '^(MAJOR|MINOR|BUILD|PATCH)=[0-9]+$' VERSION.sh >&2; then - echo >&2 "I refuse to execute garbled file for security concerns" - exit 1 + if [ -z "$version" ]; then + wget -q -O VERSION.sh http://src.chromium.org/viewvc/chrome/trunk/src/chrome/VERSION?revision=$rev + echo REV=$rev >> VERSION.sh + if grep -Ev '^(MAJOR|MINOR|BUILD|PATCH|REV)=[0-9]+$' VERSION.sh >&2; then + echo >&2 "I refuse to execute garbled file due security concerns" + exit 1 + fi + . ./VERSION.sh + version=$MAJOR.$MINOR.$BUILD.$PATCH fi - . ./VERSION.sh - version=$MAJOR.$MINOR.$BUILD.$PATCH echo "Updating $specfile for $version r$rev" sed -i -e "