]>
Commit | Line | Data |
---|---|---|
f7d776fe | 1 | #!/bin/sh |
ada01960 CM |
2 | # Usage: |
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 | |
6 | # version number. | |
611042d5 | 7 | set -e |
9c3609a0 | 8 | dropin= |
f7d776fe | 9 | |
ada01960 CM |
10 | # Work in package dir |
11 | dir=$(dirname "$0") | |
12 | cd "$dir" | |
13 | ||
14 | if [ "$1" == "spec" ]; then | |
15 | rev=$(grep -e "^%define.*svnrev" chromium-browser-bin.spec | cut -f4) | |
16 | echo "Using $rev from spec file" | |
17 | elif [ "$1" ]; then | |
f7d776fe ER |
18 | rev=$1 |
19 | echo "Using $rev..." | |
20 | else | |
9c3609a0 | 21 | echo "Fetching latest revno... " |
424ae1c0 CM |
22 | rev=$(wget -q -O - http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/LAST_CHANGE) |
23 | rev64=$(wget -q -O - http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/LAST_CHANGE) | |
9c3609a0 ER |
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..." | |
30 | rev64=$rev | |
31 | else | |
32 | echo "Using latest 64bit revision..." | |
33 | rev=$rev64 | |
34 | fi | |
993fde95 | 35 | fi |
f7d776fe | 36 | echo "$rev" |
993fde95 CM |
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) | |
f7d776fe ER |
39 | fi |
40 | ||
e0ca2098 | 41 | if [ ! -f chromium-browser32-r$rev.zip ]; then |
424ae1c0 CM |
42 | wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/$rev/chrome-linux.zip -c -O chromium-browser32-r$rev.zip |
43 | ||
e0ca2098 | 44 | upload_32="chromium-browser32-r$rev.zip" |
ec977a2a | 45 | fi |
e0ca2098 | 46 | if [ ! -f chromium-browser64-r$rev.zip ]; then |
424ae1c0 | 47 | wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/$rev/chrome-linux.zip -c -O chromium-browser64-r$rev.zip |
e0ca2098 | 48 | upload_64="chromium-browser64-r$rev.zip" |
ec977a2a ER |
49 | fi |
50 | ||
ce3ccb19 ER |
51 | if [ "$dropin" ]; then |
52 | if [ -x ./dropin ]; then | |
53 | dropin=./dropin | |
54 | elif [ -x ../dropin ]; then | |
55 | dropin=../dropin | |
56 | fi | |
f9a1143c | 57 | |
ce3ccb19 ER |
58 | if [ "$upload_32" -o "$upload_64" ]; then |
59 | echo "Uploading to dropin. ^C to abort" | |
60 | ../dropin $upload_32 $upload_64 | |
61 | fi | |
f9a1143c | 62 | fi |
a9c889b8 | 63 | |
0d727ae6 ER |
64 | specfile=chromium-browser-bin.spec |
65 | oldrev=$(awk '/^%define[ ]+svnrev[ ]+/{print $NF}' $specfile) | |
66 | if [ "$oldrev" != "$rev" ]; then | |
611042d5 ER |
67 | # revno => VERSION hint by Caleb Maclennan <caleb#alerque.com> |
68 | wget -q -O VERSION.sh http://src.chromium.org/viewvc/chrome/trunk/src/chrome/VERSION?revision=$rev | |
69 | if grep -Ev '^(MAJOR|MINOR|BUILD|PATCH)=[0-9]+$' VERSION.sh >&2; then | |
3ae88640 | 70 | echo >&2 "I refuse to execute garbled file for security concerns" |
611042d5 ER |
71 | exit 1 |
72 | fi | |
73 | . ./VERSION.sh | |
74 | version=$MAJOR.$MINOR.$BUILD.$PATCH | |
75 | ||
76 | echo "Updating $specfile for $version r$rev" | |
77 | sed -i -e " | |
78 | s/^\(%define[ \t]\+svnrev[ \t]\+\)[0-9]\+\$/\1$rev/ | |
79 | s/^\(Version:[ \t]\+\)[.0-9]\+\$/\1$version/ | |
80 | " $specfile | |
0d727ae6 ER |
81 | ../builder -ncs -5 $specfile |
82 | fi |