[email protected] | 9631e89 | 2014-03-27 07:53:30 | [diff] [blame] | 1 | #!/bin/sh |
2 | # Copyright 2014 The Chromium Authors. All rights reserved. | ||||
3 | # Use of this source code is governed by a BSD-style license that can be | ||||
4 | # found in the LICENSE file. | ||||
5 | |||||
6 | # Upload the generated output to Google storage. | ||||
7 | |||||
[email protected] | 8de9620 | 2014-04-03 11:52:55 | [diff] [blame] | 8 | set -e |
9 | |||||
10 | if [ ! -d "$1" ]; then | ||||
[email protected] | 9631e89 | 2014-03-27 07:53:30 | [diff] [blame] | 11 | echo "update.sh <output directory from build-all.sh>" |
12 | exit 1 | ||||
13 | fi | ||||
14 | |||||
[email protected] | 8de9620 | 2014-04-03 11:52:55 | [diff] [blame] | 15 | if echo "$PWD" | grep -qE "/src/third_party/binutils$"; then |
16 | echo -n | ||||
17 | else | ||||
18 | echo "update.sh should be run in src/third_party/binutils" | ||||
19 | exit 1 | ||||
20 | fi | ||||
21 | |||||
[email protected] | 9631e89 | 2014-03-27 07:53:30 | [diff] [blame] | 22 | if [ ! -f ~/.boto ]; then |
23 | echo "You need to run 'gsutil config' to set up authentication before running this script." | ||||
24 | exit 1 | ||||
25 | fi | ||||
26 | |||||
[email protected] | 8de9620 | 2014-04-03 11:52:55 | [diff] [blame] | 27 | for DIR in $1/*; do |
28 | # Skip if not directory | ||||
29 | if [ ! -d "$DIR" ]; then | ||||
30 | continue | ||||
31 | fi | ||||
[email protected] | 9631e89 | 2014-03-27 07:53:30 | [diff] [blame] | 32 | |
[email protected] | 8de9620 | 2014-04-03 11:52:55 | [diff] [blame] | 33 | case "$DIR" in |
34 | */i686-pc-linux-gnu) | ||||
35 | export ARCH="Linux_ia32" | ||||
36 | ;; | ||||
37 | |||||
mcgrathr | 8d77853 | 2016-05-11 02:22:02 | [diff] [blame] | 38 | */x86_64-pc-linux-gnu) |
[email protected] | 8de9620 | 2014-04-03 11:52:55 | [diff] [blame] | 39 | export ARCH="Linux_x64" |
40 | ;; | ||||
41 | |||||
42 | *) | ||||
43 | echo "Unknown architecture directory $DIR" | ||||
44 | exit 1 | ||||
45 | ;; | ||||
46 | esac | ||||
47 | |||||
48 | if [ ! -d "$ARCH" ]; then | ||||
49 | mkdir -p "$ARCH" | ||||
50 | fi | ||||
51 | |||||
52 | BINUTILS_TAR_BZ2="$ARCH/binutils.tar.bz2" | ||||
53 | FULL_BINUTILS_TAR_BZ2="$PWD/$BINUTILS_TAR_BZ2" | ||||
54 | if [ -f "${BINUTILS_TAR_BZ2}.sha1" ]; then | ||||
55 | rm "${BINUTILS_TAR_BZ2}.sha1" | ||||
56 | fi | ||||
57 | (cd "$DIR"; tar jcf "$FULL_BINUTILS_TAR_BZ2" .) | ||||
58 | |||||
59 | upload_to_google_storage.py --bucket chromium-binutils "$BINUTILS_TAR_BZ2" | ||||
60 | git add -f "${BINUTILS_TAR_BZ2}.sha1" | ||||
61 | done | ||||
62 | |||||
63 | echo "Please commit the new .sha1 to the Chromium repository" | ||||
[email protected] | 8de9620 | 2014-04-03 11:52:55 | [diff] [blame] | 64 | echo "# git commit" |
mithro | 6e29680 | 2015-10-01 00:19:17 | [diff] [blame] | 65 | echo "" |
66 | echo "Make sure goma is updated with the new binutils *before* landing." | ||||
67 | echo " Notify {ukai,yyanagisawa,shinyak}@chromium.org with the .sha1 files" | ||||
68 | echo " and await confirmation." |