Fix m product-graph
`m product-graph` runs a "non-full" build, which skips some steps to improve performance. One of the steps it skips is making a .installable_files file. Soong reads this file and removes any files that were removed from the list in this file. It errored out if the file didn't exist. Make soong less strict about the presence of this file, because if it doesn't exist, there shouldn't be any installed files to remove either. Fixes: 168105598 Test: rm -rf out/, m product-graph Change-Id: I366f7b09d87911f9660d4e08c2d2f097cc04800f
This commit is contained in:
@@ -250,7 +250,10 @@ func cleanOldFiles(ctx Context, basePath, newFile string) {
|
|||||||
newFile = filepath.Join(basePath, newFile)
|
newFile = filepath.Join(basePath, newFile)
|
||||||
oldFile := newFile + ".previous"
|
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)
|
ctx.Fatalf("Expected %q to be readable", newFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user