media/webrtc/trunk/build/branding_value.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/media/webrtc/trunk/build/branding_value.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,51 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +# Copyright (c) 2008 The Chromium Authors. All rights reserved.
     1.7 +# Use of this source code is governed by a BSD-style license that can be
     1.8 +# found in the LICENSE file.
     1.9 +
    1.10 +# This is a wrapper for fetching values from the BRANDING files.  Pass the
    1.11 +# value of GYP's branding variable followed by the key you want and the right
    1.12 +# file is checked.
    1.13 +#
    1.14 +#  branding_value.sh Chromium COPYRIGHT
    1.15 +#  branding_value.sh Chromium PRODUCT_FULLNAME
    1.16 +#
    1.17 +
    1.18 +set -e
    1.19 +
    1.20 +if [ $# -ne 2 ] ;  then
    1.21 +  echo "error: expect two arguments, branding and key" >&2
    1.22 +  exit 1
    1.23 +fi
    1.24 +
    1.25 +BUILD_BRANDING=$1
    1.26 +THE_KEY=$2
    1.27 +
    1.28 +pushd $(dirname "${0}") > /dev/null
    1.29 +BUILD_DIR=$(pwd)
    1.30 +popd > /dev/null
    1.31 +
    1.32 +TOP="${BUILD_DIR}/.."
    1.33 +
    1.34 +case ${BUILD_BRANDING} in
    1.35 +  Chromium)
    1.36 +    BRANDING_FILE="${TOP}/chrome/app/theme/chromium/BRANDING"
    1.37 +    ;;
    1.38 +  Chrome)
    1.39 +    BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING"
    1.40 +    ;;
    1.41 +  *)
    1.42 +    echo "error: unknown branding: ${BUILD_BRANDING}" >&2
    1.43 +    exit 1
    1.44 +    ;;
    1.45 +esac
    1.46 +
    1.47 +BRANDING_VALUE=$(sed -n -e "s/^${THE_KEY}=\(.*\)\$/\1/p" "${BRANDING_FILE}")
    1.48 +
    1.49 +if [ -z "${BRANDING_VALUE}" ] ; then
    1.50 +  echo "error: failed to find key '${THE_KEY}'" >&2
    1.51 +  exit 1
    1.52 +fi
    1.53 +
    1.54 +echo "${BRANDING_VALUE}"

mercurial