Merge "Don't rebuild file embeds if they haven't changed."

This commit is contained in:
Aaron Boodman 2014-04-06 02:43:04 +00:00 committed by Gerrit Code Review
commit 6e33d64078
2 changed files with 7 additions and 13 deletions

18
make.go
View File

@ -360,19 +360,13 @@ func genEmbeds() error {
}
// We mark all the zembeds in builddir as wanted, so that we do not
// have to regen them next time, unless they need updating.
f, err := os.Open(embeds)
if err != nil {
return err
}
defer f.Close()
names, err := f.Readdirnames(-1)
if err != nil {
return err
}
for _, v := range names {
if strings.HasPrefix(v, "zembed_") {
wantDestFile[filepath.Join(embeds, v)] = true
if err := filepath.Walk(embeds, func(path string, _ os.FileInfo, err error) error {
if strings.HasPrefix(filepath.Base(path), "zembed_") {
wantDestFile[path] = true
}
return err
}); err != nil {
return err
}
}
return nil

View File

@ -108,7 +108,7 @@ func main() {
if !genFile() {
continue
}
log.Printf("Updating %s (package %s)", filepath.Join(dir, embedName), pkgName)
log.Printf("Updating %s (package %s)", embedName, pkgName)
bs, err := ioutil.ReadFile(fileName)
if err != nil {