OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
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 # ChromeOS version information | 7 # ChromeOS version information |
8 # | 8 # |
9 # This file is usually sourced by other build scripts, but can be run | 9 # This file is usually sourced by other build scripts, but can be run |
10 # directly to see what it would do. | 10 # directly to see what it would do. |
11 # | 11 # |
12 # Version numbering scheme is much like Chrome's, with the addition of | 12 # Version numbering scheme is much like Chrome's, with the addition of |
13 # double-incrementing branch number so trunk is always odd. | 13 # double-incrementing branch number so trunk is always odd. |
14 | 14 |
15 # Sets up a version number for release builds. | 15 HOSTNAME=$(hostname) |
16 export_release_version() { | 16 ############################################################################# |
17 # Major/minor versions. | 17 # SET VERSION NUMBERS |
18 # Primarily for product marketing. | 18 ############################################################################# |
19 export CHROMEOS_VERSION_MAJOR=0 | 19 # Major/minor versions. |
20 export CHROMEOS_VERSION_MINOR=5 | 20 # Primarily for product marketing. |
| 21 export CHROMEOS_VERSION_MAJOR=0 |
| 22 export CHROMEOS_VERSION_MINOR=5 |
21 | 23 |
22 # Branch number. | 24 # Major/minor versions. |
23 # Increment by 1 in a new release branch. | 25 # Primarily for product marketing. |
24 # Increment by 2 in trunk after making a release branch. | 26 export CHROMEOS_VERSION_MAJOR=0 |
25 # Does not reset on a major/minor change (always increases). | 27 export CHROMEOS_VERSION_MINOR=5 |
26 # (Trunk is always odd; branches are always even). | |
27 export CHROMEOS_VERSION_BRANCH=23 | |
28 | 28 |
29 # Patch number. | 29 # Branch number. |
30 # Increment by 1 each release on a branch. | 30 # Increment by 1 in a new release branch. |
31 # Reset to 0 when increasing branch number. | 31 # Increment by 2 in trunk after making a release branch. |
32 export CHROMEOS_VERSION_PATCH=0 | 32 # Does not reset on a major/minor change (always increases). |
| 33 # (Trunk is always odd; branches are always even). |
| 34 export CHROMEOS_VERSION_BRANCH=23 |
33 | 35 |
34 # Codename of this version. | 36 # Patch number. |
35 export CHROMEOS_VERSION_CODENAME="" | 37 # Increment by 1 each release on a branch. |
36 } | 38 # Reset to 0 when increasing branch number. |
| 39 export CHROMEOS_VERSION_PATCH=0 |
37 | 40 |
38 # Sets up a version for developer builds. | 41 # Codename of this version. |
39 export_developer_version() { | 42 export CHROMEOS_VERSION_CODENAME="" |
40 # Use an arbitrarily high number to indicate that this is a dev build. | 43 |
41 export CHROMEOS_VERSION_MAJOR=999 | |
42 | 44 |
43 # Use the SVN revision number of the tree here. | 45 ############################################################################# |
44 # TODO(rtc): Figure out how to do this. | 46 # SET VERSION STRINGS |
45 export CHROMEOS_VERSION_MINOR=999 | 47 ############################################################################# |
46 | 48 # Official builds must set |
47 # Use the day of year and two digit year. | 49 # CHROMEOS_OFFICIAL=1 |
48 export CHROMEOS_VERSION_BRANCH=$(date +"%j%y") | 50 # Note that ${FOO:-0} means default-to-0-if-unset; ${FOO:?} means die-if-unset. |
49 | 51 if [ ${CHROMEOS_OFFICIAL:-0} -eq 1 ] |
50 export CHROMEOS_VERSION_PATCH=$(date +"%H%M%S") | 52 then |
51 | 53 # Official builds (i.e., buildbot) |
| 54 export CHROMEOS_VERSION_NAME="Chrome OS" |
| 55 export CHROMEOS_VERSION_TRACK="dev-channel" |
| 56 export CHROMEOS_VERSION_AUSERVER="https://tools.google.com/service/update2" |
| 57 export CHROMEOS_VERSION_DEVSERVER="" |
| 58 elif [ "$USER" = "chrome-bot" ] |
| 59 then |
| 60 # Continuous builder |
52 # Sets the codename to the user who built the image. This | 61 # Sets the codename to the user who built the image. This |
53 # will help us figure out who did the build if a different | 62 # will help us figure out who did the build if a different |
54 # person is debugging the system. | 63 # person is debugging the system. |
55 export CHROMEOS_VERSION_CODENAME="$USER" | 64 export CHROMEOS_VERSION_CODENAME="$USER" |
56 } | |
57 | 65 |
58 export_version_string() { | 66 export CHROMEOS_VERSION_NAME="Chromium OS" |
| 67 export CHROMEOS_VERSION_TRACK="buildbot-build" |
| 68 export CHROMEOS_VERSION_AUSERVER="http://$HOSTNAME:8080/update" |
| 69 export CHROMEOS_VERSION_DEVSERVER="http://$HOSTNAME:8080" |
| 70 else |
| 71 # Developer hand-builds |
| 72 # Sets the codename to the user who built the image. This |
| 73 # will help us figure out who did the build if a different |
| 74 # person is debugging the system. |
| 75 export CHROMEOS_VERSION_CODENAME="$USER" |
| 76 |
| 77 export CHROMEOS_VERSION_NAME="Chromium OS" |
| 78 export CHROMEOS_VERSION_TRACK="developer-build" |
| 79 export CHROMEOS_VERSION_AUSERVER="http://$HOSTNAME:8080/update" |
| 80 export CHROMEOS_VERSION_DEVSERVER="http://$HOSTNAME:8080" |
| 81 fi |
| 82 |
59 # Version string. Not indentied to appease bash. | 83 # Version string. Not indentied to appease bash. |
60 export CHROMEOS_VERSION_STRING=\ | 84 export CHROMEOS_VERSION_STRING=\ |
61 "${CHROMEOS_VERSION_MAJOR}.${CHROMEOS_VERSION_MINOR}"\ | 85 "${CHROMEOS_VERSION_MAJOR}.${CHROMEOS_VERSION_MINOR}"\ |
62 ".${CHROMEOS_VERSION_BRANCH}.${CHROMEOS_VERSION_PATCH}" | 86 ".${CHROMEOS_VERSION_BRANCH}.${CHROMEOS_VERSION_PATCH}" |
63 } | |
64 | |
65 # Official builds must set | |
66 # CHROMEOS_OFFICIAL=1 | |
67 # CHROMEOS_REVISION=(the subversion revision being built). | |
68 # Note that ${FOO:-0} means default-to-0-if-unset; ${FOO:?} means die-if-unset. | |
69 if [ ${CHROMEOS_OFFICIAL:-0} -eq 1 ] | |
70 then | |
71 # Official builds (i.e., buildbot) | |
72 export_release_version | |
73 export_version_string | |
74 export CHROMEOS_VERSION_NAME="Chrome OS" | |
75 export CHROMEOS_VERSION_TRACK="dev-channel" | |
76 export CHROMEOS_VERSION_AUSERVER="https://tools.google.com/service/update2" | |
77 export CHROMEOS_VERSION_DEVSERVER="" | |
78 else | |
79 # Continuous builds and developer hand-builds | |
80 export_developer_version | |
81 export_version_string | |
82 export CHROMEOS_VERSION_NAME="Chromium OS" | |
83 export CHROMEOS_VERSION_TRACK="developer-build" | |
84 HOSTNAME=$(hostname) | |
85 export CHROMEOS_VERSION_AUSERVER="http://$HOSTNAME:8080/update" | |
86 export CHROMEOS_VERSION_DEVSERVER="http://$HOSTNAME:8080" | |
87 fi | |
88 | 87 |
89 # Print version info. | 88 # Print version info. |
90 echo "ChromeOS version information:" | 89 echo "ChromeOS version information:" |
91 env | grep "^CHROMEOS_VERSION" | sed 's/^/ /' | 90 env | egrep "^CHROMEOS_VERSION" | sed 's/^/ /' |
OLD | NEW |