mirror of https://github.com/grpc/grpc-java.git
xds/third_part: revert change of envoy import script (#5667)
* Revert "xds/third_party: fixed compatibility issue of regex in BSD for import.sh sed command (#5613)"
This reverts commit affce636dd.
* added comment to avoid manual change as the script is synced with internal upstream
This commit is contained in:
parent
63f636b4b6
commit
7712ef596c
|
|
@ -13,6 +13,8 @@
|
||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
# Only run this script on Linux environment.
|
||||||
|
|
||||||
# Update VERSION then in this directory run ./import.sh
|
# Update VERSION then in this directory run ./import.sh
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -68,6 +70,8 @@ do
|
||||||
cp -p "${tmpdir}/${SOURCE_PROTO_BASE_DIR}/${file}" "${file}"
|
cp -p "${tmpdir}/${SOURCE_PROTO_BASE_DIR}/${file}" "${file}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# DO NOT TOUCH! The following section is upstreamed with an internal script.
|
||||||
|
|
||||||
# See google internal third_party/envoy/envoy-update.sh
|
# See google internal third_party/envoy/envoy-update.sh
|
||||||
# ===========================================================================
|
# ===========================================================================
|
||||||
# Fix up proto imports and remove references to gogoproto.
|
# Fix up proto imports and remove references to gogoproto.
|
||||||
|
|
@ -78,22 +82,19 @@ do
|
||||||
# Import mangling.
|
# Import mangling.
|
||||||
-e 's#import "gogoproto/gogo.proto";##'
|
-e 's#import "gogoproto/gogo.proto";##'
|
||||||
# Remove references to gogo.proto extensions.
|
# Remove references to gogo.proto extensions.
|
||||||
-e 's#option \(gogoproto\.[a-z_]+\) = (true|false);##'
|
-e 's#option (gogoproto\.[a-z_]\+) = \(true\|false\);##'
|
||||||
-e 's#(, )?\(gogoproto\.[a-z_]+\) = (true|false),?##'
|
-e 's#\(, \)\?(gogoproto\.[a-z_]\+) = \(true\|false\),\?##'
|
||||||
# gogoproto removal can result in empty brackets.
|
# gogoproto removal can result in empty brackets.
|
||||||
-e 's# \[\]##'
|
-e 's# \[\]##'
|
||||||
# gogoproto removal can result in four spaces on a line by itself.
|
# gogoproto removal can result in four spaces on a line by itself.
|
||||||
-e '/^ $/d'
|
-e '/^ $/d'
|
||||||
)
|
)
|
||||||
# Use a temp file to workaround `sed -i` cross-platform compatibility issue.
|
sed -i "${commands[@]}" "$f"
|
||||||
tmpfile="$(mktemp)"
|
|
||||||
sed -E "${commands[@]}" "$f" > "$tmpfile"
|
|
||||||
|
|
||||||
# gogoproto removal can leave a comma on the last element in a list.
|
# gogoproto removal can leave a comma on the last element in a list.
|
||||||
# This needs to run separately after all the commands above have finished
|
# This needs to run separately after all the commands above have finished
|
||||||
# since it is multi-line and rewrites the output of the above patterns.
|
# since it is multi-line and rewrites the output of the above patterns.
|
||||||
sed -E -e '$!N; s#(.*),([[:space:]]*\];)#\1\2#; t' -e 'P; D;' "$tmpfile" > "$f"
|
sed -i -e '$!N; s#\(.*\),\([[:space:]]*\];\)#\1\2#; t; P; D;' "$f"
|
||||||
rm "$tmpfile"
|
|
||||||
done
|
done
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue