diff --git a/foreign_cc/private/framework/toolchains/freebsd_commands.bzl b/foreign_cc/private/framework/toolchains/freebsd_commands.bzl index d2a52df18..4585cebd3 100644 --- a/foreign_cc/private/framework/toolchains/freebsd_commands.bzl +++ b/foreign_cc/private/framework/toolchains/freebsd_commands.bzl @@ -78,7 +78,7 @@ if [ -d "$1" ]; then SAVEIFS=$IFS IFS=$'\n' # Find all real files. Symlinks are assumed to be relative to something within the directory we're seaching and thus ignored - local files=$(find -P -f $1 \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) + local files=$(find -P -f "$1" \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) IFS=$SAVEIFS for file in ${files[@]}; do local backup=$(mktemp) @@ -103,7 +103,7 @@ if [[ -d "{source}" ]]; then else cp -L -R "{source}" "{target}" fi -find {target} -type f -exec touch -r "{source}" "{{}}" \\; +find "{target}" -type f -exec touch -r "{source}" "{{}}" \\; """.format( source = source, target = target, @@ -216,7 +216,7 @@ def cleanup_function(on_success, on_failure): def children_to_path(dir_): text = """\ if [ -d {dir_} ]; then - local tools=$(find $EXT_BUILD_DEPS/bin/ -maxdepth 1 -mindepth 1) + local tools=$(find "$EXT_BUILD_DEPS/bin/" -maxdepth 1 -mindepth 1) for tool in $tools; do if [[ -d \"$tool\" ]] || [[ -L \"$tool\" ]]; then diff --git a/foreign_cc/private/framework/toolchains/linux_commands.bzl b/foreign_cc/private/framework/toolchains/linux_commands.bzl index 4845011f8..6c09484e6 100644 --- a/foreign_cc/private/framework/toolchains/linux_commands.bzl +++ b/foreign_cc/private/framework/toolchains/linux_commands.bzl @@ -69,7 +69,7 @@ if [ -d "$1" ]; then SAVEIFS=$IFS IFS=$'\n' # Find all real files. Symlinks are assumed to be relative to something within the directory we're seaching and thus ignored - local files=$(find -P $1 \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) + local files=$(find -P "$1" \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) IFS=$SAVEIFS for file in ${files[@]}; do local backup=$(mktemp) @@ -86,7 +86,7 @@ fi ) def copy_dir_contents_to_dir(source, target): - return """cp -L -r --no-target-directory "{source}" "{target}" && find {target} -type f -exec touch -r "{source}" "{{}}" \\;""".format( + return """cp -L -r --no-target-directory "{source}" "{target}" && find "{target}" -type f -exec touch -r "{source}" "{{}}" \\;""".format( source = source, target = target, ) @@ -166,7 +166,7 @@ def script_prelude(): def increment_pkg_config_path(source): text = """\ -local children=$(find $1 -mindepth 1 -name '*.pc') +local children=$(find "$1" -mindepth 1 -name '*.pc') # assume there is only one directory with pkg config for child in $children; do export PKG_CONFIG_PATH="$${PKG_CONFIG_PATH:-}$$:$(dirname $child)" @@ -198,7 +198,7 @@ def cleanup_function(on_success, on_failure): def children_to_path(dir_): text = """\ if [ -d {dir_} ]; then - local tools=$(find $EXT_BUILD_DEPS/bin -maxdepth 1 -mindepth 1) + local tools=$(find "$EXT_BUILD_DEPS/bin" -maxdepth 1 -mindepth 1) for tool in $tools; do if [[ -d \"$tool\" ]] || [[ -L \"$tool\" ]]; then diff --git a/foreign_cc/private/framework/toolchains/macos_commands.bzl b/foreign_cc/private/framework/toolchains/macos_commands.bzl index 3120bd92c..68d486ed1 100644 --- a/foreign_cc/private/framework/toolchains/macos_commands.bzl +++ b/foreign_cc/private/framework/toolchains/macos_commands.bzl @@ -69,7 +69,7 @@ if [ -d "$1" ]; then SAVEIFS=$IFS IFS=$'\n' # Find all real files. Symlinks are assumed to be relative to something within the directory we're seaching and thus ignored - local files=$(find -P -f $1 \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) + local files=$(find -P -f "$1" \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) IFS=$SAVEIFS for file in ${files[@]}; do local backup=$(mktemp) @@ -94,7 +94,7 @@ if [[ -d "{source}" ]]; then else cp -L -R "{source}" "{target}" fi -find {target} -type f -exec touch -r "{source}" "{{}}" \\; +find "{target}" -type f -exec touch -r "{source}" "{{}}" \\; """.format( source = source, target = target, @@ -207,7 +207,7 @@ def cleanup_function(on_success, on_failure): def children_to_path(dir_): text = """\ if [ -d {dir_} ]; then - local tools=$(find $EXT_BUILD_DEPS/bin/ -maxdepth 1 -mindepth 1) + local tools=$(find "$EXT_BUILD_DEPS/bin/" -maxdepth 1 -mindepth 1) for tool in $tools; do if [[ -d \"$tool\" ]] || [[ -L \"$tool\" ]]; then diff --git a/foreign_cc/private/framework/toolchains/windows_commands.bzl b/foreign_cc/private/framework/toolchains/windows_commands.bzl index 35e31c2c5..547eb2323 100644 --- a/foreign_cc/private/framework/toolchains/windows_commands.bzl +++ b/foreign_cc/private/framework/toolchains/windows_commands.bzl @@ -70,7 +70,7 @@ if [ -d "$1" ]; then SAVEIFS=$IFS IFS=$'\n' # Find all real files. Symlinks are assumed to be relative to something within the directory we're seaching and thus ignored - local files=$($REAL_FIND -P $1 -type f \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) + local files=$($REAL_FIND -P "$1" -type f \\( -type f -and \\( -name "*.pc" -or -name "*.la" -or -name "*-config" -or -name "*.mk" -or -name "*.cmake" \\) \\)) IFS=$SAVEIFS # Escape any backslashes so sed can understand what it's supposed to replace local argv2=$(echo "$2" | sed 's/\\\\/\\\\\\\\/g') @@ -90,7 +90,7 @@ fi ) def copy_dir_contents_to_dir(source, target): - return """cp -L -r --no-target-directory "{source}" "{target}" && find {target} -type f -exec touch -r "{source}" "{{}}" \\;""".format( + return """cp -L -r --no-target-directory "{source}" "{target}" && $REAL_FIND "{target}" -type f -exec touch -r "{source}" "{{}}" \\;""".format( source = source, target = target, ) @@ -180,7 +180,7 @@ export SYSTEMDRIVE="C:" def increment_pkg_config_path(source): text = """\ -local children=$($REAL_FIND $1 -mindepth 1 -name '*.pc') +local children=$($REAL_FIND "$1" -mindepth 1 -name '*.pc') # assume there is only one directory with pkg config for child in $children; do export PKG_CONFIG_PATH="$${PKG_CONFIG_PATH:-}$$:$(dirname $child)" @@ -212,7 +212,7 @@ def cleanup_function(on_success, on_failure): def children_to_path(dir_): text = """\ if [ -d {dir_} ]; then - local tools=$($REAL_FIND $EXT_BUILD_DEPS/bin -maxdepth 1 -mindepth 1) + local tools=$($REAL_FIND "$EXT_BUILD_DEPS/bin" -maxdepth 1 -mindepth 1) for tool in $tools; do if [[ -d \"$tool\" ]] || [[ -L \"$tool\" ]]; then