Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / binutils / upload.sh
blob5ff10aad3ad7029ab259bb1f447e8d23967c4e2c
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.
6 # Upload the generated output to Google storage.
8 set -e
10 if [ ! -d "$1" ]; then
11 echo "update.sh <output directory from build-all.sh>"
12 exit 1
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
22 if [ ! -f ~/.boto ]; then
23 echo "You need to run 'gsutil config' to set up authentication before running this script."
24 exit 1
27 for DIR in $1/*; do
28 # Skip if not directory
29 if [ ! -d "$DIR" ]; then
30 continue
33 case "$DIR" in
34 */i686-pc-linux-gnu)
35 export ARCH="Linux_ia32"
38 */x86_64-unknown-linux-gnu)
39 export ARCH="Linux_x64"
43 echo "Unknown architecture directory $DIR"
44 exit 1
46 esac
48 if [ ! -d "$ARCH" ]; then
49 mkdir -p "$ARCH"
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"
57 (cd "$DIR"; tar jcf "$FULL_BINUTILS_TAR_BZ2" .)
59 upload_to_google_storage.py --bucket chromium-binutils "$BINUTILS_TAR_BZ2"
60 git add -f "${BINUTILS_TAR_BZ2}.sha1"
61 done
63 echo "Please commit the new .sha1 to the Chromium repository"
64 echo ""
65 echo "# git commit"