Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b064013 authored by Liz Kammer's avatar Liz Kammer
Browse files

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
parent dbc0b78e
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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
@@ -126,5 +125,5 @@ java_genrule {
        "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)",
    cmd: "awk '{gsub(/#.*$$/,\"\"); $$1=$$1; print;}' $(in) | (grep ' ' || echo -n '') | awk '{for(i=1;i<=NF;i++) { sub(/^\\??/, \"?\", $$i); }; print}' > $(out)",
}