Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into shell_env
Browse files Browse the repository at this point in the history
UebelAndre authored May 12, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 268e54f + 0859891 commit 90b3966
Showing 5 changed files with 17 additions and 12 deletions.
7 changes: 4 additions & 3 deletions foreign_cc/private/framework/toolchains/linux_commands.bzl
Original file line number Diff line number Diff line change
@@ -68,7 +68,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 "libtool" -or -name "*.pc" -or -name "*.lai" -or -name "*.la" -or -name "*-config" -or -name "*.nice" -or -name "*.mk" -or -name "*.cmake" \\) \\))
IFS=$SAVEIFS
for file in ${files[@]}; do
sed -i 's@'"$2"'@'"$3"'@g' "${file}"
@@ -114,8 +114,9 @@ mkdir -p "$target"
if [[ -f "$1" ]]; then
# In order to be able to use `replace_in_files`, we ensure that we create copies of specfieid
# files so updating them is possible.
if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" == *.cmake ]]; then
dest="$target/$(basename $1)"
local input_basename="$(basename "$1")"
if [[ "$input_basename" == "libtool" || "$1" == *.pc || "$1" == *.la || "$1" == *.lai || "$1" == *-config || "$1" == *.nice || "$1" == *.mk || "$1" == *.cmake ]]; then
local dest="$target/$input_basename"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f -t "$target" "$1"
7 changes: 4 additions & 3 deletions foreign_cc/private/framework/toolchains/macos_commands.bzl
Original file line number Diff line number Diff line change
@@ -68,7 +68,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 "libtool" -or -name "*.pc" -or -name "*.lai" -or -name "*.la" -or -name "*-config" -or -name "*.nice" -or -name "*.mk" -or -name "*.cmake" \\) \\))
IFS=$SAVEIFS
for file in ${files[@]}; do
sed -i '' -e 's@'"$2"'@'"$3"'@g' "${file}"
@@ -138,8 +138,9 @@ mkdir -p "$target"
if [[ -f "$1" ]]; then
# In order to be able to use `replace_in_files`, we ensure that we create copies of specfieid
# files so updating them is possible.
if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" == *.cmake ]]; then
dest="$target/$(basename $1)"
local input_basename="$(basename "$1")"
if [[ "$input_basename" == "libtool" || "$1" == *.pc || "$1" == *.la || "$1" == *.lai || "$1" == *-config || "$1" == *.nice || "$1" == *.mk || "$1" == *.cmake ]]; then
local dest="$target/$input_basename"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f "$1" "$target"
5 changes: 3 additions & 2 deletions foreign_cc/private/framework/toolchains/windows_commands.bzl
Original file line number Diff line number Diff line change
@@ -115,8 +115,9 @@ mkdir -p "$target"
if [[ -f "$1" ]]; then
# In order to be able to use `replace_in_files`, we ensure that we create copies of specfieid
# files so updating them is possible.
if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" == *.cmake ]]; then
dest="$target/$(basename $1)"
local input_basename="$(basename "$1")"
if [[ "$input_basename" == "libtool" || "$1" == *.pc || "$1" == *.la || "$1" == *.lai || "$1" == *-config || "$1" == *.nice || "$1" == *.mk || "$1" == *.cmake ]]; then
local dest="$target/$input_basename"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f -t "$target" "$1"
5 changes: 3 additions & 2 deletions test/expected/inner_fun_text.txt
Original file line number Diff line number Diff line change
@@ -23,8 +23,9 @@ mkdir -p "$target"
if [[ -f "$1" ]]; then
# In order to be able to use `replace_in_files`, we ensure that we create copies of specfieid
# files so updating them is possible.
if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" == *.cmake ]]; then
dest="$target/$(basename $1)"
local input_basename="$(basename "$1")"
if [[ "$input_basename" == "libtool" || "$1" == *.pc || "$1" == *.la || "$1" == *.lai || "$1" == *-config || "$1" == *.nice || "$1" == *.mk || "$1" == *.cmake ]]; then
local dest="$target/$input_basename"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f -t "$target" "$1"
5 changes: 3 additions & 2 deletions test/expected/inner_fun_text_macos.txt
Original file line number Diff line number Diff line change
@@ -23,8 +23,9 @@ mkdir -p "$target"
if [[ -f "$1" ]]; then
# In order to be able to use `replace_in_files`, we ensure that we create copies of specfieid
# files so updating them is possible.
if [[ "$1" == *.pc || "$1" == *.la || "$1" == *-config || "$1" == *.mk || "$1" == *.cmake ]]; then
dest="$target/$(basename $1)"
local input_basename="$(basename "$1")"
if [[ "$input_basename" == "libtool" || "$1" == *.pc || "$1" == *.la || "$1" == *.lai || "$1" == *-config || "$1" == *.nice || "$1" == *.mk || "$1" == *.cmake ]]; then
local dest="$target/$input_basename"
cp "$1" "$dest" && chmod +w "$dest" && touch -r "$1" "$dest"
else
ln -s -f "$1" "$target"

0 comments on commit 90b3966

Please sign in to comment.