blob: d9d43cf3a88c9b7c3881271a99d3259e42bba09c [file] [log] [blame]
[email protected]9631e892014-03-27 07:53:301#!/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]8de96202014-04-03 11:52:558set -e
9
10if [ ! -d "$1" ]; then
[email protected]9631e892014-03-27 07:53:3011 echo "update.sh <output directory from build-all.sh>"
12 exit 1
13fi
14
[email protected]8de96202014-04-03 11:52:5515if echo "$PWD" | grep -qE "/src/third_party/binutils$"; then
16 echo -n
17else
18 echo "update.sh should be run in src/third_party/binutils"
19 exit 1
20fi
21
[email protected]9631e892014-03-27 07:53:3022if [ ! -f ~/.boto ]; then
23 echo "You need to run 'gsutil config' to set up authentication before running this script."
24 exit 1
25fi
26
[email protected]8de96202014-04-03 11:52:5527for DIR in $1/*; do
28 # Skip if not directory
29 if [ ! -d "$DIR" ]; then
30 continue
31 fi
[email protected]9631e892014-03-27 07:53:3032
[email protected]8de96202014-04-03 11:52:5533 case "$DIR" in
34 */i686-pc-linux-gnu)
35 export ARCH="Linux_ia32"
36 ;;
37
mcgrathr8d778532016-05-11 02:22:0238 */x86_64-pc-linux-gnu)
[email protected]8de96202014-04-03 11:52:5539 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"
61done
62
63echo "Please commit the new .sha1 to the Chromium repository"
[email protected]8de96202014-04-03 11:52:5564echo "# git commit"
mithro6e296802015-10-01 00:19:1765echo ""
66echo "Make sure goma is updated with the new binutils *before* landing."
67echo " Notify {ukai,yyanagisawa,shinyak}@chromium.org with the .sha1 files"
68echo " and await confirmation."