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

Commit 9eaeb56c authored by Colin Cross's avatar Colin Cross
Browse files

Create directories before unzipping dexpreopt zip

unzip sometimes fails with:
checkdir error: cannot create out/target/product/.../system/framework/oat
File exists

I think this happens when two unzips run in parallel, see that the
parent directory is missing, race to create it, and then one of them
treats the EEXIST when creating it as an error instead of continuing.
Work around this by creating the directories with mkdir -p before
running unzip.

Test: m installclean && m
Bug: 119412419
Change-Id: Ie7daa94e107d53eff075ca58dbe721bd9d7fc8c2
parent e1c81d74
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -253,7 +253,7 @@ ifdef LOCAL_DEX_PREOPT
    LOCAL_POST_INSTALL_CMD += &&
    LOCAL_POST_INSTALL_CMD += &&
  endif
  endif


  LOCAL_POST_INSTALL_CMD += unzip -qo -d $(PRODUCT_OUT) $(my_dexpreopt_zip)
  LOCAL_POST_INSTALL_CMD += for i in $$(zipinfo -1 $(my_dexpreopt_zip)); do mkdir -p $$(dirname $$i); done && unzip -qo -d $(PRODUCT_OUT) $(my_dexpreopt_zip)
  $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
  $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
  $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip)
  $(LOCAL_INSTALLED_MODULE): $(my_dexpreopt_zip)