2017-01-31 23:17:33 +00:00
|
|
|
package fs
|
|
|
|
|
2017-02-01 22:30:12 +00:00
|
|
|
import "time"
|
2017-01-31 23:17:33 +00:00
|
|
|
|
|
|
|
// Gnu tar and the go tar writer don't have sub-second mtime
|
|
|
|
// precision, which is problematic when we apply changes via tar
|
|
|
|
// files, we handle this by comparing for exact times, *or* same
|
|
|
|
// second count and either a or b having exactly 0 nanoseconds
|
|
|
|
func sameFsTime(a, b time.Time) bool {
|
|
|
|
return a == b ||
|
|
|
|
(a.Unix() == b.Unix() &&
|
|
|
|
(a.Nanosecond() == 0 || b.Nanosecond() == 0))
|
|
|
|
}
|