#!/bin/bash # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. mirror_base_address="https://storage.googleapis.com/nativeclient-mirror/toolchain" if (($#<1 || $#>2)); then cat < [SRC-directory name] This script downloads pristine sources and applies patches found on https://gsdview.appspot.com/nativeclient-archive2/x86_toolchain/r/ By default sources are put in SRC directory (which should be empty). END exit 1 fi dir="$(realpath "$(dirname "$0")")" if (($#==2)); then if [[ "${2:0:1}" = "/" ]]; then target="$2" else target="$dir/$2" fi else target="$dir/SRC" fi # If target exist but only contains files starting with dot we can use it. if [[ -e "$target" ]] && (($(find "$target" -maxdepth 1 ! -name ".*" | wc -l)>1)); then cat < "$target/.src-lock"