3 # ./update-source.sh [spec|rev]
4 # Download latest binary tarball based on latest release from
5 # buildbot, current version referenced in spec file, or custom
14 if [ "$1" == "spec" ]; then
15 rev=$(grep -e "^%define.*svnrev" chromium-browser-bin.spec | cut -f4)
16 echo "Using $rev from spec file"
21 echo "Fetching latest revno... "
22 rev=$(wget -q -O - http://build.chromium.org/buildbot/continuous/linux/LATEST/REVISION)
23 rev64=$(wget -q -O - http://build.chromium.org/buildbot/continuous/linux64/LATEST/REVISION)
24 # be sure that we use same rev on both arch
25 if [ "$rev" != "$rev64" ]; then
26 echo "Current 32bit build ($rev) does not match 64bit build ($rev64)"
27 echo "The upstream buildbot probably failed."
28 if [ "$rev" -lt "$rev64" ]; then
29 echo "Using latest 32bit revision..."
32 echo "Using latest 64bit revision..."
37 # TODO: use release branches instead of trunk. Current release can be looked up like this:
38 #linuxdev=$(wget -q -O - http://omahaproxy.appspot.com | grep '^linux,dev' | cut -d, -f3)
41 if [ ! -f chromium-browser32-r$rev.zip ]; then
42 wget http://build.chromium.org/buildbot/snapshots/chromium-rel-linux/$rev/chrome-linux.zip -c -O chromium-browser32-r$rev.zip
43 upload_32="chromium-browser32-r$rev.zip"
45 if [ ! -f chromium-browser64-r$rev.zip ]; then
46 wget http://build.chromium.org/buildbot/snapshots/chromium-rel-linux-64/$rev/chrome-linux.zip -c -O chromium-browser64-r$rev.zip
47 upload_64="chromium-browser64-r$rev.zip"
50 if [ "$dropin" ]; then
51 if [ -x ./dropin ]; then
53 elif [ -x ../dropin ]; then
57 if [ "$upload_32" -o "$upload_64" ]; then
58 echo "Uploading to dropin. ^C to abort"
59 ../dropin $upload_32 $upload_64
63 specfile=chromium-browser-bin.spec
64 oldrev=$(awk '/^%define[ ]+svnrev[ ]+/{print $NF}' $specfile)
65 if [ "$oldrev" != "$rev" ]; then
66 # revno => VERSION hint by Caleb Maclennan <caleb#alerque.com>
67 wget -q -O VERSION.sh http://src.chromium.org/viewvc/chrome/trunk/src/chrome/VERSION?revision=$rev
68 if grep -Ev '^(MAJOR|MINOR|BUILD|PATCH)=[0-9]+$' VERSION.sh >&2; then
69 echo >&2 "I refuse to execute garbled file for security concerns"
73 version=$MAJOR.$MINOR.$BUILD.$PATCH
75 echo "Updating $specfile for $version r$rev"
77 s/^\(%define[ \t]\+svnrev[ \t]\+\)[0-9]\+\$/\1$rev/
78 s/^\(Version:[ \t]\+\)[.0-9]\+\$/\1$version/
80 ../builder -ncs -5 $specfile