-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgzip.functions
20 lines (18 loc) · 1.13 KB
/
gzip.functions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# This file is part of shellfire compress. It is subject to the licence terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/compress/master/COPYRIGHT. No part of swaddle, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
# Copyright © 2014-2015 The developers of shellfire compress. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/shellfire-dev/compress/master/COPYRIGHT.
core_dependency_requires '*' pigz zopfli gzip touch
compress_gzip()
{
local fileName="$1"
if core_compatibility_whichNoOutput pigz; then
# -T strips the timestamp - not an option on gzip, it seems
# -I <iterations> does not work in Ubuntu 14.04
# Compression sizes varies from run to run... and corrupt archives seem possible
pigz -11 -c -q -f -n -T -- "$1" >"$1".gz
elif core_compatibility_whichNoOutput zopfli; then
zopfli -c --gzip --i15 -- "$1" >"$1".gz
else
gzip -9 -c -q -f -n -- "$1" >"$1".gz
fi
touch -r "$1" "$1".gz
}