Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | #!/bin/sh |
michael@0 | 2 | |
michael@0 | 3 | # Copyright (c) 2008 The Chromium Authors. All rights reserved. |
michael@0 | 4 | # Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | # found in the LICENSE file. |
michael@0 | 6 | |
michael@0 | 7 | # This is a wrapper for fetching values from the BRANDING files. Pass the |
michael@0 | 8 | # value of GYP's branding variable followed by the key you want and the right |
michael@0 | 9 | # file is checked. |
michael@0 | 10 | # |
michael@0 | 11 | # branding_value.sh Chromium COPYRIGHT |
michael@0 | 12 | # branding_value.sh Chromium PRODUCT_FULLNAME |
michael@0 | 13 | # |
michael@0 | 14 | |
michael@0 | 15 | set -e |
michael@0 | 16 | |
michael@0 | 17 | if [ $# -ne 2 ] ; then |
michael@0 | 18 | echo "error: expect two arguments, branding and key" >&2 |
michael@0 | 19 | exit 1 |
michael@0 | 20 | fi |
michael@0 | 21 | |
michael@0 | 22 | BUILD_BRANDING=$1 |
michael@0 | 23 | THE_KEY=$2 |
michael@0 | 24 | |
michael@0 | 25 | pushd $(dirname "${0}") > /dev/null |
michael@0 | 26 | BUILD_DIR=$(pwd) |
michael@0 | 27 | popd > /dev/null |
michael@0 | 28 | |
michael@0 | 29 | TOP="${BUILD_DIR}/.." |
michael@0 | 30 | |
michael@0 | 31 | case ${BUILD_BRANDING} in |
michael@0 | 32 | Chromium) |
michael@0 | 33 | BRANDING_FILE="${TOP}/chrome/app/theme/chromium/BRANDING" |
michael@0 | 34 | ;; |
michael@0 | 35 | Chrome) |
michael@0 | 36 | BRANDING_FILE="${TOP}/chrome/app/theme/google_chrome/BRANDING" |
michael@0 | 37 | ;; |
michael@0 | 38 | *) |
michael@0 | 39 | echo "error: unknown branding: ${BUILD_BRANDING}" >&2 |
michael@0 | 40 | exit 1 |
michael@0 | 41 | ;; |
michael@0 | 42 | esac |
michael@0 | 43 | |
michael@0 | 44 | BRANDING_VALUE=$(sed -n -e "s/^${THE_KEY}=\(.*\)\$/\1/p" "${BRANDING_FILE}") |
michael@0 | 45 | |
michael@0 | 46 | if [ -z "${BRANDING_VALUE}" ] ; then |
michael@0 | 47 | echo "error: failed to find key '${THE_KEY}'" >&2 |
michael@0 | 48 | exit 1 |
michael@0 | 49 | fi |
michael@0 | 50 | |
michael@0 | 51 | echo "${BRANDING_VALUE}" |