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