OSDN Git Service

Make cppreopts.sh deal with new layout
authorAnton Hansson <hansson@google.com>
Thu, 3 Oct 2019 13:16:38 +0000 (14:16 +0100)
committerAnton Hansson <hansson@google.com>
Thu, 3 Oct 2019 13:38:15 +0000 (14:38 +0100)
.odex and .vdex files on system_other are being moved to a subdir
with the name of their source partition. Update cppreopts to
recognize this and pass the right source path to preopt2cachename.

Bug: 141707536
Test: manually verify name of dalvik-cache files post boot
Test: dumpsys package [system-package]; verify reason=prebuilt
Change-Id: Icb5b5307ad42b7c899e11212843ce4b96b015958

cppreopts/cppreopts.sh

index 3416e67..d409db8 100755 (executable)
@@ -53,7 +53,7 @@ if [ $# -eq 1 ]; then
   # NOTE: this implementation will break in any path with spaces to favor
   # background copy tasks
   for file in $(find ${mountpoint} -type f -name "*.odex" -o -type f -name "*.vdex" -o -type f -name "*.art"); do
-    real_name=${file/${mountpoint}/\/system}
+    real_name=${file/${mountpoint}/}
     dest_name=$(preopt2cachename ${real_name})
     if ! test $? -eq 0 ; then
       log -p i -t cppreopts "Unable to figure out destination for ${file}"