set CHROME_DESKTOP="chromium-browser-bin.desktop"
[packages/chromium-browser-bin.git] / update-source.sh
CommitLineData
f7d776fe 1#!/bin/sh
ada01960 2# Usage:
896f8072
CM
3# ./update-source.sh [spec|trunk|rev]
4# Download latest binary tarball based on latest release documented
5# in omaha proxy (or alternitavly the current version referenced in the
6# spec file, or latest successfully trunk build, or custom version number.
611042d5 7set -e
9c3609a0 8dropin=
be240a41 9specfile=chromium-browser-bin.spec
f7d776fe 10
ada01960
CM
11# Work in package dir
12dir=$(dirname "$0")
13cd "$dir"
14
15if [ "$1" == "spec" ]; then
be240a41 16 rev=$(awk '/^%define.*svnrev/{print $NF}' $specfile)
ada01960 17 echo "Using $rev from spec file"
741c7b60 18elif [ "$1" == "trunk" ]; then
9c3609a0 19 echo "Fetching latest revno... "
59372285
CM
20 rev=$(wget -q -O - http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE)
21 rev64=$(wget -q -O - http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/LAST_CHANGE)
9c3609a0
ER
22 # be sure that we use same rev on both arch
23 if [ "$rev" != "$rev64" ]; then
24 echo "Current 32bit build ($rev) does not match 64bit build ($rev64)"
25 echo "The upstream buildbot probably failed."
26 if [ "$rev" -lt "$rev64" ]; then
27 echo "Using latest 32bit revision..."
28 rev64=$rev
29 else
30 echo "Using latest 64bit revision..."
31 rev=$rev64
32 fi
993fde95 33 fi
741c7b60
CM
34 echo "Using trunk $rev"
35elif [ "$1" ]; then
36 rev=$1
37 echo "Using $rev..."
38else
be240a41
ER
39 contents=$(wget -q -O - "http://omahaproxy.appspot.com/?os=linux&channel=dev")
40 rev=$(echo "$contents" | awk -F, '/^linux/{print $7}')
41 version=$(echo "$contents" | awk -F, '/^linux/{print $3}')
741c7b60 42 echo "Using devel channel $rev..."
f7d776fe
ER
43fi
44
e0ca2098 45if [ ! -f chromium-browser32-r$rev.zip ]; then
424ae1c0 46 wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/$rev/chrome-linux.zip -c -O chromium-browser32-r$rev.zip
be240a41 47
e0ca2098 48 upload_32="chromium-browser32-r$rev.zip"
ec977a2a 49fi
e0ca2098 50if [ ! -f chromium-browser64-r$rev.zip ]; then
424ae1c0 51 wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/$rev/chrome-linux.zip -c -O chromium-browser64-r$rev.zip
e0ca2098 52 upload_64="chromium-browser64-r$rev.zip"
ec977a2a
ER
53fi
54
ce3ccb19
ER
55if [ "$dropin" ]; then
56 if [ -x ./dropin ]; then
57 dropin=./dropin
58 elif [ -x ../dropin ]; then
59 dropin=../dropin
60 fi
f9a1143c 61
ce3ccb19
ER
62 if [ "$upload_32" -o "$upload_64" ]; then
63 echo "Uploading to dropin. ^C to abort"
64 ../dropin $upload_32 $upload_64
65 fi
f9a1143c 66fi
a9c889b8 67
0d727ae6
ER
68oldrev=$(awk '/^%define[ ]+svnrev[ ]+/{print $NF}' $specfile)
69if [ "$oldrev" != "$rev" ]; then
741c7b60
CM
70 if [ -z "$version" ]; then
71 wget -q -O VERSION.sh http://src.chromium.org/viewvc/chrome/trunk/src/chrome/VERSION?revision=$rev
59372285
CM
72 echo REV=$rev >> VERSION.sh
73 if grep -Ev '^(MAJOR|MINOR|BUILD|PATCH|REV)=[0-9]+$' VERSION.sh >&2; then
be240a41 74 echo >&2 "I refuse to execute garbled file due security concerns"
741c7b60
CM
75 exit 1
76 fi
77 . ./VERSION.sh
78 version=$MAJOR.$MINOR.$BUILD.$PATCH
611042d5 79 fi
611042d5
ER
80
81 echo "Updating $specfile for $version r$rev"
82 sed -i -e "
83 s/^\(%define[ \t]\+svnrev[ \t]\+\)[0-9]\+\$/\1$rev/
84 s/^\(Version:[ \t]\+\)[.0-9]\+\$/\1$version/
85 " $specfile
0d727ae6
ER
86 ../builder -ncs -5 $specfile
87fi
This page took 0.046269 seconds and 4 git commands to generate.