Merge "Touch output files in sbox"

am: 80eb6907ac

Change-Id: I0ff287156926e0788e8af3af8efb36cf222e02c4
This commit is contained in:
Colin Cross
2019-04-01 11:06:07 -07:00
committed by android-build-merger

View File

@@ -24,6 +24,7 @@ import (
"path"
"path/filepath"
"strings"
"time"
)
var (
@@ -265,6 +266,15 @@ func run() error {
if err != nil {
return err
}
// Update the timestamp of the output file in case the tool wrote an old timestamp (for example, tar can extract
// files with old timestamps).
now := time.Now()
err = os.Chtimes(tempPath, now, now)
if err != nil {
return err
}
err = os.Rename(tempPath, destPath)
if err != nil {
return err