| OLD | NEW |
| 1 // fix_archives is an application that validates the webpage archives of a | 1 // fix_archives is an application that validates the webpage archives of a |
| 2 // pageset type and deletes the archives which are found to be deliver | 2 // pageset type and deletes the archives which are found to be deliver |
| 3 // inconsistent benchmark results. | 3 // inconsistent benchmark results. |
| 4 // See https://code.google.com/p/chromium/issues/detail?id=456883 for more | 4 // See https://code.google.com/p/chromium/issues/detail?id=456883 for more |
| 5 // details. | 5 // details. |
| 6 package main | 6 package main |
| 7 | 7 |
| 8 import ( | 8 import ( |
| 9 "encoding/csv" | 9 "encoding/csv" |
| 10 "flag" | 10 "flag" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 53 } |
| 54 if *chromiumBuild == "" { | 54 if *chromiumBuild == "" { |
| 55 glog.Error("Must specify --chromium_build") | 55 glog.Error("Must specify --chromium_build") |
| 56 return | 56 return |
| 57 } | 57 } |
| 58 if *runID == "" { | 58 if *runID == "" { |
| 59 glog.Error("Must specify --run_id") | 59 glog.Error("Must specify --run_id") |
| 60 return | 60 return |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Reset the local chromium checkout. |
| 64 if err := util.ResetCheckout(util.ChromiumSrcDir); err != nil { |
| 65 glog.Errorf("Could not reset %s: %s", util.ChromiumSrcDir, err) |
| 66 return |
| 67 } |
| 63 // Sync the local chromium checkout. | 68 // Sync the local chromium checkout. |
| 64 if err := util.SyncDir(util.ChromiumSrcDir); err != nil { | 69 if err := util.SyncDir(util.ChromiumSrcDir); err != nil { |
| 65 glog.Errorf("Could not gclient sync %s: %s", util.ChromiumSrcDir
, err) | 70 glog.Errorf("Could not gclient sync %s: %s", util.ChromiumSrcDir
, err) |
| 66 return | 71 return |
| 67 } | 72 } |
| 68 | 73 |
| 69 // Instantiate GsUtil object. | 74 // Instantiate GsUtil object. |
| 70 gs, err := util.NewGsUtil(nil) | 75 gs, err := util.NewGsUtil(nil) |
| 71 if err != nil { | 76 if err != nil { |
| 72 glog.Error(err) | 77 glog.Error(err) |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 reader.FieldsPerRecord = -1 | 270 reader.FieldsPerRecord = -1 |
| 266 rawCSVdata, err := reader.ReadAll() | 271 rawCSVdata, err := reader.ReadAll() |
| 267 if err != nil { | 272 if err != nil { |
| 268 return nil, nil, fmt.Errorf("Could not read %s: %s", csvPath, er
r) | 273 return nil, nil, fmt.Errorf("Could not read %s: %s", csvPath, er
r) |
| 269 } | 274 } |
| 270 if len(rawCSVdata) != 2 { | 275 if len(rawCSVdata) != 2 { |
| 271 return nil, nil, fmt.Errorf("No data in %s", csvPath) | 276 return nil, nil, fmt.Errorf("No data in %s", csvPath) |
| 272 } | 277 } |
| 273 return rawCSVdata[0], rawCSVdata[1], nil | 278 return rawCSVdata[0], rawCSVdata[1], nil |
| 274 } | 279 } |
| OLD | NEW |