From 7aecf33efd238a0c83c702a454bfba0e7686e680 Mon Sep 17 00:00:00 2001 From: Victor Hsieh Date: Thu, 8 Feb 2018 12:21:37 -0800 Subject: [PATCH] Don't use the same temp directory to uncompress dex This was ok for apk because they are in different parent directory. Test: marlin built Bug: 63920015 Bug: 30972906 Change-Id: I5ed00824fda9e7e0a99c825402753c21a06ba6c5 --- core/definitions.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 4eac01cce..2d1953cf2 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2601,11 +2601,12 @@ endef # define uncompress-dexs $(hide) if (zipinfo $@ '*.dex' 2>/dev/null | grep -v ' stor ' >/dev/null) ; then \ - rm -rf $(dir $@)uncompresseddexs && mkdir $(dir $@)uncompresseddexs; \ - unzip -q $@ '*.dex' -d $(dir $@)uncompresseddexs && \ + tmpdir=$@.tmpdir; \ + rm -rf $$tmpdir && mkdir $$tmpdir; \ + unzip -q $@ '*.dex' -d $$tmpdir && \ zip -qd $@ '*.dex' && \ - ( cd $(dir $@)uncompresseddexs && find . -type f | sort | zip -qD -X -0 ../$(notdir $@) -@ ) && \ - rm -rf $(dir $@)uncompresseddexs; \ + ( cd $$tmpdir && find . -type f | sort | zip -qD -X -0 ../$(notdir $@) -@ ) && \ + rm -rf $$tmpdir; \ fi endef