Fix m product-graph am: 521e951ad4

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

Change-Id: I5ce93b1a1d70ad7578069621f5a773ba45615f8e
This commit is contained in:
Cole Faust
2021-09-14 23:59:16 +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)
}