Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(95)

Side by Side Diff: src/pkg/go/build/build.go

Issue 5416060: code review 5416060: io: new FileInfo, FileMode types + update tree (Closed)
Patch Set: diff -r d917a203b389 https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/pkg/exp/types/gcimporter_test.go ('k') | src/pkg/go/build/dir.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // Package build provides tools for building Go packages. 5 // Package build provides tools for building Go packages.
6 package build 6 package build
7 7
8 import ( 8 import (
9 "bytes" 9 "bytes"
10 "errors" 10 "errors"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Stale returns true if the build's inputs are newer than its outputs. 152 // Stale returns true if the build's inputs are newer than its outputs.
153 func (s *Script) Stale() bool { 153 func (s *Script) Stale() bool {
154 var latest time.Time 154 var latest time.Time
155 // get latest mtime of outputs 155 // get latest mtime of outputs
156 for _, file := range s.Output { 156 for _, file := range s.Output {
157 fi, err := os.Stat(file) 157 fi, err := os.Stat(file)
158 if err != nil { 158 if err != nil {
159 // any error reading output files means stale 159 // any error reading output files means stale
160 return true 160 return true
161 } 161 }
162 » » if fi.ModTime.After(latest) { 162 » » if mtime := fi.ModTime(); mtime.After(latest) {
163 » » » latest = fi.ModTime 163 » » » latest = mtime
164 } 164 }
165 } 165 }
166 for _, file := range s.Input { 166 for _, file := range s.Input {
167 fi, err := os.Stat(file) 167 fi, err := os.Stat(file)
168 » » if err != nil || fi.ModTime.After(latest) { 168 » » if err != nil || fi.ModTime().After(latest) {
169 // any error reading input files means stale 169 // any error reading input files means stale
170 // (attempt to rebuild to figure out why) 170 // (attempt to rebuild to figure out why)
171 return true 171 return true
172 } 172 }
173 } 173 }
174 return false 174 return false
175 } 175 }
176 176
177 // Clean removes the Script's Intermediate files. 177 // Clean removes the Script's Intermediate files.
178 // It tries to remove every file and returns the first error it encounters. 178 // It tries to remove every file and returns the first error it encounters.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 }) 437 })
438 b.script.addIntermediate(importC) 438 b.script.addIntermediate(importC)
439 439
440 // cc _cgo_import.ARCH 440 // cc _cgo_import.ARCH
441 importObj := b.obj + "_cgo_import." + b.arch 441 importObj := b.obj + "_cgo_import." + b.arch
442 b.cc(importObj, importC) 442 b.cc(importObj, importC)
443 outObj = append(outObj, importObj) 443 outObj = append(outObj, importObj)
444 444
445 return 445 return
446 } 446 }
OLDNEW
« no previous file with comments | « src/pkg/exp/types/gcimporter_test.go ('k') | src/pkg/go/build/dir.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b