diff options
author | Colin Cross <ccross@android.com> | 2020-07-11 22:30:45 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2020-07-13 14:26:12 -0700 |
commit | 774a7580267ec9cb898f2a64b659fd85b7209926 (patch) | |
tree | fb64b1f4ea88a938ea41d5f10671db23da090412 | |
parent | 7e2b36c7d59b1939d3ff1be79bd846a882e75bf7 (diff) | |
download | soong-774a7580267ec9cb898f2a64b659fd85b7209926.tar.gz |
Use unzip -DD
We put reproducible timestamps in zip files so that the artifacts
are consistent, but that leads to old timestamps in the output
directory if they are unzipped as part of the build. Use
unzip -DD when unzipping to update the timestamps.
Bug: 161015009
Test: touch -d 2020-01-01 ref; find $OUT/system -not -newer ref
Change-Id: I70407a627cb070e24be510faa6a774e3d9eae3a8
Merged-In: I70407a627cb070e24be510faa6a774e3d9eae3a8
(cherry picked from commit d783bbbace0d7e5b7e333ffa276ff18216109cc7)
-rw-r--r-- | apex/builder.go | 2 | ||||
-rw-r--r-- | java/aar.go | 2 | ||||
-rw-r--r-- | java/hiddenapi.go | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/apex/builder.go b/apex/builder.go index e1b2dab01..9da6ef851 100644 --- a/apex/builder.go +++ b/apex/builder.go @@ -343,7 +343,7 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) { } else { if fi.class == appSet { copyCommands = append(copyCommands, - fmt.Sprintf("unzip -q -d %s %s", destPathDir, fi.builtFile.String())) + fmt.Sprintf("unzip -qDD -d %s %s", destPathDir, fi.builtFile.String())) } else { copyCommands = append(copyCommands, "cp -f "+fi.builtFile.String()+" "+destPath) } diff --git a/java/aar.go b/java/aar.go index 53b50d60d..8dd752f12 100644 --- a/java/aar.go +++ b/java/aar.go @@ -641,7 +641,7 @@ func (a *AARImport) DepsMutator(ctx android.BottomUpMutatorContext) { var unzipAAR = pctx.AndroidStaticRule("unzipAAR", blueprint.RuleParams{ Command: `rm -rf $outDir && mkdir -p $outDir && ` + - `unzip -qo -d $outDir $in && rm -rf $outDir/res && touch $out`, + `unzip -qoDD -d $outDir $in && rm -rf $outDir/res && touch $out`, }, "outDir") diff --git a/java/hiddenapi.go b/java/hiddenapi.go index 130b63496..b5a021785 100644 --- a/java/hiddenapi.go +++ b/java/hiddenapi.go @@ -146,7 +146,7 @@ func (h *hiddenAPI) hiddenAPIGenerateCSV(ctx android.ModuleContext, flagsCSV, me var hiddenAPIEncodeDexRule = pctx.AndroidStaticRule("hiddenAPIEncodeDex", blueprint.RuleParams{ Command: `rm -rf $tmpDir && mkdir -p $tmpDir && mkdir $tmpDir/dex-input && mkdir $tmpDir/dex-output && - unzip -o -q $in 'classes*.dex' -d $tmpDir/dex-input && + unzip -qoDD $in 'classes*.dex' -d $tmpDir/dex-input && for INPUT_DEX in $$(find $tmpDir/dex-input -maxdepth 1 -name 'classes*.dex' | sort); do echo "--input-dex=$${INPUT_DEX}"; echo "--output-dex=$tmpDir/dex-output/$$(basename $${INPUT_DEX})"; |