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

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

Change-Id: I6994a1ab14ee8c74b3cc9954536ba9dc6d4ef60c
This commit is contained in:
Cole Faust
2021-09-15 00:42:05 +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)
}