Fix m product-graph am: 521e951ad4 am: ec84292f1b am: 06103c45c5

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1826630

Change-Id: I66a12b08bdb47a1dd18252e1e919894ec13db5f6
This commit is contained in:
Cole Faust
2021-09-15 00:29:00 +00:00
committed by Automerger Merge Worker

View File

@@ -250,7 +250,10 @@ func cleanOldFiles(ctx Context, basePath, newFile string) {
newFile = filepath.Join(basePath, newFile)
oldFile := newFile + ".previous"
if _, err := os.Stat(newFile); err != nil {
if _, err := os.Stat(newFile); os.IsNotExist(err) {
// If the file doesn't exist, assume no installed files exist either
return
} else if err != nil {
ctx.Fatalf("Expected %q to be readable", newFile)
}