OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Script to copy Chrome for ChromeOS zipfile in preparation for repackaging as | 7 # Script to copy Chrome for ChromeOS zipfile in preparation for repackaging as |
8 # a debian package. | 8 # a debian package. |
9 | 9 |
10 set -e | 10 set -e |
11 | 11 |
12 # ---------------------------------------------------------------------------- | 12 # ---------------------------------------------------------------------------- |
13 # Configuration | 13 # Configuration |
14 # For release builds, set USE_RELEASE_CHROME=1 and specify a CHROME_BUILD. | 14 # For release builds, set USE_RELEASE_CHROME=1 and specify a CHROME_BUILD. |
15 | 15 |
16 # If set to 1, use a released version of Chrome. If 0, use latest build from | 16 # If set to 1, use a released version of Chrome. If 0, use latest build from |
17 # Chrome continuous build. | 17 # Chrome continuous build. |
18 USE_RELEASE_CHROME=0 | 18 USE_RELEASE_CHROME=0 |
19 | 19 |
20 # Specify a build number to use a specific build of Chrome. If this is blank, | 20 # Specify a build number to use a specific build of Chrome. If this is blank, |
21 # the latest version will be used. | 21 # the latest version will be used. |
22 CHROME_BUILD= | 22 CHROME_BUILD= |
23 | 23 |
| 24 # Option if set will pull a stable version of the Chromium browser |
| 25 WGET_STABLE_BUILD=$GET_STABLE_CHROME |
| 26 |
24 # ---------------------------------------------------------------------------- | 27 # ---------------------------------------------------------------------------- |
25 | 28 |
| 29 # Check to see if the user wants to grab stable browser build |
| 30 while getopts 's' OPTION |
| 31 do |
| 32 case $OPTION in |
| 33 s) WGET_STABLE_BUILD=1 |
| 34 ;; |
| 35 esac |
| 36 done |
| 37 |
| 38 |
26 # Function to download a file using wget or scp | 39 # Function to download a file using wget or scp |
27 function download { | 40 function download { |
28 echo "Downloading $1" | 41 echo "Downloading $1" |
29 if [ $USE_WGET -eq 1 ] | 42 if [ $USE_WGET -eq 1 ] |
30 then | 43 then |
31 wget "$1" | 44 wget "$1" |
32 else | 45 else |
33 scp "$1" . | 46 scp "$1" . |
34 fi | 47 fi |
35 } | 48 } |
(...skipping 24 matching lines...) Expand all Loading... |
60 then | 73 then |
61 USE_WGET=0 | 74 USE_WGET=0 |
62 BASE_FROM="chrome-web:~/www/snapshots/chromium-rel-linux-chromiumos" | 75 BASE_FROM="chrome-web:~/www/snapshots/chromium-rel-linux-chromiumos" |
63 fi | 76 fi |
64 fi | 77 fi |
65 | 78 |
66 # Path to local Chrome | 79 # Path to local Chrome |
67 LOCAL_CHROME="/home/${USER}/trunk/src/build/x86/local_assets/${CHROME_ZIP}" | 80 LOCAL_CHROME="/home/${USER}/trunk/src/build/x86/local_assets/${CHROME_ZIP}" |
68 # TODO: Support ARM | 81 # TODO: Support ARM |
69 | 82 |
70 | |
71 | |
72 # Clobber any existing destination files | 83 # Clobber any existing destination files |
73 rm -f "./$CHROME_ZIP" ./LATEST | 84 rm -f "./$CHROME_ZIP" ./LATEST |
74 | 85 |
75 # We support three ways of getting chrome into our image. | 86 # We support four ways of getting chrome into our image. |
76 # | 87 # |
77 # 1. Use wget to pull the latest Chrome build from the Chrome build server | 88 # 1. Use wget to pull the latest Chrome build from the Chrome build server |
78 # 2. Use scp to pull the latest Chrome build from the Chrome build server; | 89 # 2. Use scp to pull the latest Chrome build from the Chrome build server; |
79 # necessary when running as buildbot, which does not have http access to | 90 # necessary when running as buildbot, which does not have http access to |
80 # that server. | 91 # that server. |
81 # 3. Build chrome locally and put the zip image in src/build/local_packages. | 92 # 3. Build chrome locally and put the zip image in src/build/local_packages. |
| 93 # 4. Use wget to pull a tested version of the browser as opposed to the latest |
82 | 94 |
83 if [ -f "$LOCAL_CHROME" ] | 95 if [ "$WGET_STABLE_BUILD" ] |
84 then | 96 then |
85 # Use local Chrome | 97 echo "Getting a stable version of the browser" |
86 echo "Using locally-build Chrome from $LOCAL_CHROME" | 98 download "http://build.chromium.org/buildbot/archives/chromium-chromiumos-r325
16.zip" |
87 cp "$LOCAL_CHROME" . | 99 mv "chromium-chromiumos-r32516.zip" "$CHROME_ZIP" |
88 else | 100 else |
89 | 101 |
90 if [ -z "$CHROME_BUILD" ] | 102 if [ -f "$LOCAL_CHROME" ] |
91 then | 103 then |
92 # Find latest build of Chrome | 104 # Use local Chrome |
93 echo "Checking for latest build of Chrome" | 105 echo "Using locally-built Chrome from $LOCAL_CHROME" |
94 download "${BASE_FROM}/LATEST" | 106 cp "$LOCAL_CHROME" . |
95 CHROME_BUILD=`cat LATEST` | 107 else |
96 echo "Latest build of Chrome is $CHROME_BUILD" | |
97 fi | |
98 | 108 |
99 # Download Chrome build | 109 # Download Chrome build |
100 echo "Copying Chrome" | 110 echo "Copying Chrome" |
101 download "${BASE_FROM}/${CHROME_BUILD}/${CHROME_ZIP}" || \ | 111 |
102 download "${BASE_FROM}/${CHROME_BUILD}/${CHROME_ZIP_SECOND_TRY}" | 112 if [ -z "$CHROME_BUILD" ] |
103 if [ -f "$CHROME_ZIP_SECOND_TRY" ] | 113 then |
104 then | 114 # Find latest build of Chrome |
105 mv "$CHROME_ZIP_SECOND_TRY" "$CHROME_ZIP" | 115 echo "Checking for latest build of Chrome" |
| 116 download "${BASE_FROM}/LATEST" |
| 117 CHROME_BUILD=`cat LATEST` |
| 118 echo "Latest build of Chrome is $CHROME_BUILD" |
| 119 fi |
| 120 |
| 121 download "${BASE_FROM}/${CHROME_BUILD}/${CHROME_ZIP}" || \ |
| 122 download "${BASE_FROM}/${CHROME_BUILD}/${CHROME_ZIP_SECOND_TRY}" |
| 123 if [ -f "$CHROME_ZIP_SECOND_TRY" ] |
| 124 then |
| 125 mv "$CHROME_ZIP_SECOND_TRY" "$CHROME_ZIP" |
| 126 fi |
106 fi | 127 fi |
107 fi | 128 fi |
OLD | NEW |