From 63f109e1499cdbaf69d0555b4341677bdf3e04d8 Mon Sep 17 00:00:00 2001 From: Alexander Zielenski Date: Fri, 13 Jan 2023 15:31:05 -0800 Subject: [PATCH] use --null instead of -Z in grep invocation BSD grep has a different behavior from GNU grep with -Z. --null has consistent behavior accross both implementations --- hack/update-codegen.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index cee4f582284..01e2d4528a9 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -130,7 +130,7 @@ function codegen::prerelease() { fi local tag_dirs=() kube::util::read-array tag_dirs < <( \ - grep -l -Z --color=never '+k8s:prerelease-lifecycle-gen=true' "${ALL_K8S_TAG_FILES[@]}" \ + grep -l --null --color=never '+k8s:prerelease-lifecycle-gen=true' "${ALL_K8S_TAG_FILES[@]}" \ | xargs -0 -n1 dirname \ | LC_ALL=C sort -u) if [[ "${DBG_CODEGEN}" == 1 ]]; then @@ -189,7 +189,7 @@ function codegen::deepcopy() { fi local tag_dirs=() kube::util::read-array tag_dirs < <( \ - grep -l -Z --color=never '+k8s:deepcopy-gen=' "${ALL_K8S_TAG_FILES[@]}" \ + grep -l --null --color=never '+k8s:deepcopy-gen=' "${ALL_K8S_TAG_FILES[@]}" \ | xargs -0 -n1 dirname \ | LC_ALL=C sort -u) if [[ "${DBG_CODEGEN}" == 1 ]]; then @@ -255,7 +255,7 @@ function codegen::defaults() { fi local tag_dirs=() kube::util::read-array tag_dirs < <( \ - grep -l -Z --color=never '+k8s:defaulter-gen=' "${ALL_K8S_TAG_FILES[@]}" \ + grep -l --null --color=never '+k8s:defaulter-gen=' "${ALL_K8S_TAG_FILES[@]}" \ | xargs -0 -n1 dirname \ | LC_ALL=C sort -u) if [[ "${DBG_CODEGEN}" == 1 ]]; then @@ -326,7 +326,7 @@ function codegen::conversions() { fi local tag_dirs=() kube::util::read-array tag_dirs < <(\ - grep -l -Z --color=never '^// *+k8s:conversion-gen=' "${ALL_K8S_TAG_FILES[@]}" \ + grep -l --null --color=never '^// *+k8s:conversion-gen=' "${ALL_K8S_TAG_FILES[@]}" \ | xargs -0 -n1 dirname \ | LC_ALL=C sort -u) if [[ "${DBG_CODEGEN}" == 1 ]]; then @@ -536,7 +536,7 @@ function codegen::openapi() { local tag_dirs=() kube::util::read-array tag_dirs < <( - grep -l -Z --color=never '+k8s:openapi-gen=' $(indirect_array "${prefix}_tag_files") \ + grep -l --null --color=never '+k8s:openapi-gen=' $(indirect_array "${prefix}_tag_files") \ | xargs -0 -n1 dirname \ | LC_ALL=C sort -u)