Message394744
I modified the script to keep the both Python generated tarballs and ran diffoscope, which presents the issue very clearly:
$ diffoscope py.gz py2.gz
--- py.gz
+++ py2.gz
├── filetype from file(1)
│ @@ -1 +1 @@
│ -gzip compressed data, was "py", last modified: Sat May 29 23:24:02 2021, max compression
│ +gzip compressed data, was "py2", last modified: Sat May 29 23:24:03 2021, max compression
The issue is that by default, when writing gzip files, the mtime will be set for the last modification. This is helpful, but might be unwanted in some cases. You can change the mtime as shown in [1].
Now let's take a look at the difference between the file Python generated and the one the `tar` command generated.
$ diffoscope py.gz tar_a0.tgz
--- py.gz
+++ tar_a0.tgz
├── filetype from file(1)
│ @@ -1 +1 @@
│ -gzip compressed data, was "py", last modified: Sat May 29 23:24:02 2021, max compression
│ +gzip compressed data, from Unix
It seems like it generates the same output here because the `tar` command does not set any mtime on the archive by default.
[1] https://github.com/FFY00/trampolim/blob/dbd03c90eaa2cc732e1a01268786b491dc872fb7/trampolim/_build.py#L354 |
|
Date |
User |
Action |
Args |
2021-05-29 23:39:00 | FFY00 | set | recipients:
+ FFY00, yellowhat |
2021-05-29 23:39:00 | FFY00 | set | messageid: <1622331540.28.0.333798764423.issue44262@roundup.psfhosted.org> |
2021-05-29 23:39:00 | FFY00 | link | issue44262 messages |
2021-05-29 23:38:59 | FFY00 | create | |
|