Checksum of gzip tarball keeps changing after tmp/directories cleanup #32

Closed
axilleas opened this Issue Apr 3, 2014 · 2 comments

2 participants

@axilleas
GitLab member

Port issue from gitlabhq/gitlabhq#6662

As @jhollingsworth commented:

The archive is created and then stored in tmp/repositories, so this behavior should only occur if that directory is being cleared out between downloads. Recreating the archive causes a different timestamp to be associated with the internal tar file.

That being said, the behavior is quite easy to emulate and reproduce in a terminal window. Try running this:

cat somefile | gzip > out1.gz
cat somefile | gzip > out2.gz

The somefile should just be any file you want. If you run these right after each other, the checksums will be different. Now run:

cat somefile | gzip -n > out3.gz
cat somefile | gzip -n > out4.gz

The checksums for these 2 new files will be the same. The -n suppresses storing the original file name and/or timestamp.

You should be able to change this line from:

pipe_cmd = "gzip"

to

pipe_cmd = "gzip -n"

and have your fix.

@jacobvosmaer
GitLab member

@axilleas do you have a PR?

@axilleas
GitLab member
@randx randx pushed a commit that closed this issue Apr 4, 2014
@axilleas axilleas Do not save the original file name and timestamp by default. Fix #32
Thanks to the Archlinux community for catching this
and @jhollingsworth for coming up with a fix :)
f4cd2cf
@randx randx closed this in f4cd2cf Apr 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment