Skip to content

Commit

Permalink
Fix java_stub_template.txt when parsing runfiles with spaces in path.
Browse files Browse the repository at this point in the history
Print the rest of the line instead of only the second column separated by spaces.

Fix bazelbuild#3807

RELNOTES: None
PiperOrigin-RevId: 170030984
  • Loading branch information
meteorcloudy authored and katre committed Sep 26, 2017
1 parent aa8540d commit e69bcce
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ else
for line in "${my_array[@]}"
do
line_split=($line)
runfiles_array[${line_split[0]}]=${line_split[1]}
runfiles_array[${line_split[0]}]=${line_split[@]:1}
done
fi

Expand All @@ -208,7 +208,10 @@ else
echo $1
else
if is_macos; then
echo $(grep "^$1 " $RUNFILES_MANIFEST_FILE | awk '{ print $2 }')
# Print the rest of line after the first space
# First, set the first column to empty and print rest of the line
# Second, use a trick of awk to remove leading and trailing spaces.
echo $(grep "^$1 " $RUNFILES_MANIFEST_FILE | awk '{ $1=""; print }' | awk '{ $1=$1; print }')
else
echo ${runfiles_array[$1]}
fi
Expand Down

0 comments on commit e69bcce

Please sign in to comment.