Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion makeself.sh
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,10 @@ fi

case $COMPRESS in
gzip)
GZIP_CMD="gzip -c$COMPRESS_LEVEL"
# --no-name: omit the filename/timestamp from the gzip member
# header. Without it, the compressed output differ on every run even
# when the input is byte-for-byte identical.
GZIP_CMD="gzip --no-name -c$COMPRESS_LEVEL"
GUNZIP_CMD="gzip -cd"
;;
pigz)
Expand Down
7 changes: 3 additions & 4 deletions test/datetest
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,9 @@ testByteforbyte()
{
date='Sat Mar 3 19:35:21 EST 2016'

# bsdtar does not have option --mtime
# TODO: unstable test: first second differ: char 242, line 10

startSkipping
# GNU tar supports --tar-extra's --mtime option used below.
# bsdtar (Mac/BSD) does not.
tar --version 2>/dev/null | grep -q GNU || startSkipping

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can enable this test when we are using GNU tar now.

Mac /opt/homebrew/bin/gtar

bash datetest -- testByteforbyte # /opt/homebrew/bin/gtar
testByteforbyte
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
/opt/homebrew/bin/gtar: Option --mtime: Treating date '20160303' as 2016-03-03 00:00:00
./startup.sh
CRC: 1520247960
MD5: 21a99f115e4b3125a76fef4d4d203432

Self-extractable archive "src.sh" successfully created.
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
/opt/homebrew/bin/gtar: Option --mtime: Treating date '20160303' as 2016-03-03 00:00:00
./startup.sh
CRC: 1520247960
MD5: 21a99f115e4b3125a76fef4d4d203432

Self-extractable archive "src.sh" successfully created.

Ran 1 test.

OK

It still does not work on bsdtar.

Mac /usr/bin/bsdtar

bash datetest -- testByteforbyte
testByteforbyte
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
bsdtar: Option --mtime is not supported
Usage:
  List:    bsdtar -tf <archive-filename>
  Extract: bsdtar -xf <archive-filename>
  Create:  bsdtar -cf <archive-filename> [filenames...]
  Help:    bsdtar --help
ERROR: failed to create temporary archive: /var/folders/2x/mv56x8w15pb0lv1ql29c99lm0000gp/T//mkself69625.tar
mv: rename src.sh to first: No such file or directory
Header is 772 lines long

About to compress 4 KB of data...
Adding files to archive named "src.sh"...
bsdtar: Option --mtime is not supported
Usage:
  List:    bsdtar -tf <archive-filename>
  Extract: bsdtar -xf <archive-filename>
  Create:  bsdtar -cf <archive-filename> [filenames...]
  Help:    bsdtar --help
ERROR: failed to create temporary archive: /var/folders/2x/mv56x8w15pb0lv1ql29c99lm0000gp/T//mkself69649.tar
mv: rename src.sh to second: No such file or directory
cmp: first: No such file or directory
ASSERT:expected:<2> but was:<0>
shunit2:ERROR testByteforbyte() returned non-zero return code.

Ran 1 test.

FAILED (failures=1)


# Exercise
${SUT} --packaging-date "${date}" --tar-extra "--mtime 20160303" \
Expand Down
Loading