Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/gogenerate/protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=p
# +// - protoc version [omitted for reproducibility]
#
# perl is used because `sed -i` is not portable across BSD (macOS) and GNU.
perl -pi -E 's@(^//.*)protoc[[:blank:]]+v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+@\1protoc version [omitted for reproducibility]@g' "$PB_GO" "$GRPC_PB_GO"
perl -pi -E 's@(^//.*protoc.*)[[:blank:]]+v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+@\1 [version omitted for reproducibility]@g' "$PB_GO" "$GRPC_PB_GO"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm old-fashioned, but I find the \s and \d escapes more readable than the noisy POSIX character classes:

Suggested change
perl -pi -E 's@(^//.*protoc.*)[[:blank:]]+v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+@\1 [version omitted for reproducibility]@g' "$PB_GO" "$GRPC_PB_GO"
perl -pi -E 's@(^//.*protoc\S*)\s+v\d+\.\d+\.\d+@\1 [version omitted for reproducibility]@g' "$PB_GO" "$GRPC_PB_GO"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel single-character escapes are cryptic

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you find regular expressions cryptic, you can use the /x modifier to insert whitespace to break up the pattern into groups:

perl -pi -E 's@ (^//.*protoc.*)  [[:blank:]]+  v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ @\1 [version omitted for reproducibility]@gx' "$PB_GO" "$GRPC_PB_GO"

4 changes: 2 additions & 2 deletions pkg/driver/external/driver.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/driver/external/driver_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/guestagent/api/guestservice.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/guestagent/api/guestservice_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading