Commit Graph

2 Commits

Author SHA1 Message Date
Nalin Dahyabhai 15e07f8272 pkg/archive: truncate ModTime when we'd otherwise round it
When writing a header with no format explicitly specified, the first
thing archive/tar 1.10 does is round the header's ModTime field,
possibly up, which confuses our change-detection logic when we later go
to check if the result of untarring the archive matches the source
content.  Truncate the timestamp before that can happen.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-12-06 13:50:38 -05:00
Nalin Dahyabhai 38ce897d7c pkg/archive: use subsecond timestamps in Copy...WithTar
When we know we're going to extract the contents of a tar archive as
part of a copying process, set the desired format in the tar header to
PAX so that we get subsecond precision in timestamps, so that the
timestamps on the copies that we create aren't rounded off.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2018-05-29 17:28:00 -04:00