mirror of
https://github.com/facebook/zstd.git
synced 2025-12-20 00:02:54 -05:00
'date -r FILE' is non-portable.
date(1) is used to display the last modification time of a file, which is not supported on OpenBSD, FreeBSD and Darwin. Instead use stat(1). Tested on OpenBSD.
This commit is contained in:
parent
73f8905b83
commit
e488cabf25
@ -92,6 +92,11 @@ case "$UNAME" in
|
|||||||
*) MD5SUM="md5sum" ;;
|
*) MD5SUM="md5sum" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
MTIME="stat -c %Y"
|
||||||
|
case "$UNAME" in
|
||||||
|
Darwin | FreeBSD | OpenBSD) MTIME="stat -f %m" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
DIFF="diff"
|
DIFF="diff"
|
||||||
case "$UNAME" in
|
case "$UNAME" in
|
||||||
SunOS) DIFF="gdiff" ;;
|
SunOS) DIFF="gdiff" ;;
|
||||||
@ -227,8 +232,8 @@ sleep 5
|
|||||||
$ZSTD --exclude-compressed --long --rm -r precompressedFilterTestDir
|
$ZSTD --exclude-compressed --long --rm -r precompressedFilterTestDir
|
||||||
test ! -f precompressedFilterTestDir/input.5.zst.zst
|
test ! -f precompressedFilterTestDir/input.5.zst.zst
|
||||||
test ! -f precompressedFilterTestDir/input.6.zst.zst
|
test ! -f precompressedFilterTestDir/input.6.zst.zst
|
||||||
file1timestamp=`date -r precompressedFilterTestDir/input.5.zst +%s`
|
file1timestamp=`$MTIME precompressedFilterTestDir/input.5.zst`
|
||||||
file2timestamp=`date -r precompressedFilterTestDir/input.7.zst +%s`
|
file2timestamp=`$MTIME precompressedFilterTestDir/input.7.zst`
|
||||||
if [[ $file2timestamp -ge $file1timestamp ]]; then
|
if [[ $file2timestamp -ge $file1timestamp ]]; then
|
||||||
println "Test is successful. input.5.zst is precompressed and therefore not compressed/modified again."
|
println "Test is successful. input.5.zst is precompressed and therefore not compressed/modified again."
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user