diff options
author | 2023-09-07 16:57:08 -0400 | |
---|---|---|
committer | 2023-09-07 17:01:54 -0400 | |
commit | 2b0640135fc886d24de74382487277981de280b6 (patch) | |
tree | dc61a82b2ff89786aba025e7a7d82d979ba5df22 /mime/Android.bp | |
parent | dbc0b78e32530f0fc826dcd6e92c15467ad801c8 (diff) |
Handle grep finds no matches.
Bazel is more strict about exit codes in genrules. In
vendor.mime.types.minimized, there are no no-empty lines, so the grep
fails. Update the command to succeed even though grep fails.
Test: m mimemap and verify contents of
out/soong/.intermediates/frameworks/base/mime/vendor.mime.types.minimized/android_common/gen/vendor.mime.types
Change-Id: I292fa4cde584d2a620fd245469e34bbaa13df256
Diffstat (limited to 'mime/Android.bp')
-rw-r--r-- | mime/Android.bp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mime/Android.bp b/mime/Android.bp index a3ea65cb2efe..757862b998b4 100644 --- a/mime/Android.bp +++ b/mime/Android.bp @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - package { // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import @@ -125,6 +124,6 @@ java_genrule { srcs: [ "java-res/vendor.mime.types", ], - // strip comments normalize whitepace drop empty lines prepend ? to fields that are missing it - cmd: "awk '{gsub(/#.*$$/,\"\"); $$1=$$1; print;}' $(in) | grep ' ' | awk '{for(i=1;i<=NF;i++) { sub(/^\\??/, \"?\", $$i); }; print}' > $(out)", + // strip comments normalize whitepace drop empty lines prepend ? to fields that are missing it + cmd: "awk '{gsub(/#.*$$/,\"\"); $$1=$$1; print;}' $(in) | (grep ' ' || echo -n '') | awk '{for(i=1;i<=NF;i++) { sub(/^\\??/, \"?\", $$i); }; print}' > $(out)", } |