Lines Matching refs:upd
109 func (upd *SyzUpdater) UpdateOnStart(shutdown chan struct{}) {
110 os.RemoveAll(upd.currentDir)
111 exeTag, exeMod := readTag(upd.exe + ".tag")
112 latestTag := upd.checkLatest()
116 if err := osutil.LinkFiles(upd.latestDir, upd.currentDir, upd.syzFiles); err != nil {
131 lastCommit = upd.pollAndBuild(lastCommit)
132 latestTag := upd.checkLatest()
137 if err := osutil.LinkFiles(upd.latestDir, upd.currentDir, upd.syzFiles); err != nil {
141 upd.UpdateAndRestart()
158 func (upd *SyzUpdater) WaitForUpdate() {
160 latestTag := upd.checkLatest()
163 lastCommit = upd.pollAndBuild(lastCommit)
164 if latestTag != upd.checkLatest() {
174 func (upd *SyzUpdater) UpdateAndRestart() {
176 latestBin := filepath.Join(upd.latestDir, "bin", upd.exe)
177 latestTag := filepath.Join(upd.latestDir, "tag")
178 if err := osutil.CopyFile(latestBin, upd.exe); err != nil {
181 if err := osutil.CopyFile(latestTag, upd.exe+".tag"); err != nil {
184 if err := syscall.Exec(upd.exe, os.Args, os.Environ()); err != nil {
190 func (upd *SyzUpdater) pollAndBuild(lastCommit string) string {
191 commit, err := upd.repo.Poll(upd.repoAddress, upd.branch)
200 if err := upd.build(commit); err != nil {
207 func (upd *SyzUpdater) build(commit *vcs.Commit) error {
208 if upd.descriptions != "" {
209 files, err := ioutil.ReadDir(upd.descriptions)
214 src := filepath.Join(upd.descriptions, f.Name())
215 dst := filepath.Join(upd.syzkallerDir, "sys", "linux", f.Name())
222 cmd.Dir = upd.syzkallerDir
223 cmd.Env = append([]string{"GOPATH=" + upd.gopathDir}, os.Environ()...)
228 cmd.Dir = upd.syzkallerDir
229 cmd.Env = append([]string{"GOPATH=" + upd.gopathDir}, os.Environ()...)
233 for target := range upd.targets {
236 cmd.Dir = upd.syzkallerDir
239 "GOPATH="+upd.gopathDir,
249 cmd.Dir = upd.syzkallerDir
250 cmd.Env = append([]string{"GOPATH=" + upd.gopathDir}, os.Environ()...)
254 tagFile := filepath.Join(upd.syzkallerDir, "tag")
258 if err := osutil.CopyFiles(upd.syzkallerDir, upd.latestDir, upd.syzFiles); err != nil {
266 func (upd *SyzUpdater) checkLatest() string {
267 if !osutil.FilesExist(upd.latestDir, upd.syzFiles) {
270 tag, _ := readTag(filepath.Join(upd.latestDir, "tag"))