3 ## Copyright (c) 2014 The WebM project authors. All Rights Reserved.
5 ## Use of this source code is governed by a BSD-style license
6 ## that can be found in the LICENSE file in the root of the source
7 ## tree. An additional intellectual property rights grant can be found
8 ## in the file PATENTS. All contributing project authors may
9 ## be found in the AUTHORS file in the root of the source tree.
12 shell_name="$(uname -o 2>/dev/null)"
13 if [[ "$shell_name" = "Cygwin" || "$shell_name" = "Msys" ]] \
14 && cygpath --help >/dev/null 2>&1; then
21 echo "${self_basename}: $@" >&2
26 echo "Unknown option \"$1\"." >&2
27 echo "See ${self_basename} --help for available options." >&2
37 # Output one, possibly changed based on the system, path per line.
42 # Corrects the paths in file_list in one pass for efficiency.
43 # $1 is the name of the array to be modified.
45 if [ "${FIXPATH}" = "echo_path" ] ; then
46 # When used with echo_path, fix_file_list is a no-op. Avoid warning about
47 # unsupported 'declare -n' when it is not important.
49 elif [ "${BASH_VERSINFO}" -lt 4 ] ; then
50 echo "Cygwin path conversion has failed. Please use a version of bash"
51 echo "which supports nameref (-n), introduced in bash 4.3"
54 declare -n array_ref=$1
55 files=$(fix_path "${array_ref[@]}")
61 local hex="0123456789ABCDEF"
65 #93995380-89BD-4b04-88EB-625FBE52EBFB
66 for ((i=0; i<32; i++)); do
67 (( j = $RANDOM % 16 ))
68 uuid="${uuid}${hex:$j:1}"
70 echo "${uuid:0:8}-${uuid:8:4}-${uuid:12:4}-${uuid:16:4}-${uuid:20:12}"
76 indent="${indent}${indent1}"
79 indent="${indent%${indent1}}"
86 die "Missing attribute value in '$opt' while generating $tag tag"
87 echo "${indent}${opt%%=*}=\"${optval}\""
95 echo "${indent}<${tag}"
100 echo "${indent}<${tag}>"
108 echo "${indent}</${tag}>"
114 if [ $# -ne 0 ]; then
115 echo "${indent}<${tag}"
121 echo "${indent}<${tag}/>"