chromium/native_client_sdk/src/build_tools/naclsdk

#!/bin/bash
#
# Copyright 2011 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

readonly SCRIPT_DIR="$(dirname "$0")"
readonly SCRIPT_DIR_ABS="$(cd "${SCRIPT_DIR}" ; pwd -P)"
readonly SDK_TOOLS="${SCRIPT_DIR_ABS}/sdk_tools"
readonly SDK_TOOLS_UPDATE="${SCRIPT_DIR_ABS}/sdk_tools_update"

if [[ -e "${SDK_TOOLS_UPDATE}" ]]; then
  echo "Updating sdk_tools"
  rm -rf "${SDK_TOOLS}"
  mv "${SDK_TOOLS_UPDATE}" "${SDK_TOOLS}"
fi

export PYTHONPATH="${SDK_TOOLS}"
python "${SDK_TOOLS}/sdk_update.py" "$@"