- status, body, err := fetchIfModified(file.Url, &t)
+
+ hash, err := checksumFile(file)
+ if err != nil {
+ // See below in deployFile() for the reason
+ return errors.Wrapf(err, "file.path %q must exist", file.Path)
+ }
+ if hash != state.Checksum[file.Url] {
+ log.Printf("%q -> %q: hash has changed", file.Url, file.Path)
+ var zero time.Time
+ t = zero // force download
+ }
+
+ oldT := t
+ status, body, err := fetchIfModified(file.Url,
+ file.Username, file.Password, file.CA, &t)