From 5d16db1c48c81f898b27ea703e26c2414fc6d673 Mon Sep 17 00:00:00 2001 From: Jamie Nguyen Date: Tue, 24 Feb 2015 15:07:54 +0000 Subject: [PATCH] Avoid gzip "-k" option for wider OS compatibility The "-k" option tells gzip to keep the original files intact and is an alternative to `gzip -c file > file.gz`. It was implemented in 2013: http://git.savannah.gnu.org/cgit/gzip.git/commit/?id=0192f02 There are a few popular operating systems (ie, Red Hat 7, Debian Wheezy) whose version of gzip does not have the "-k" option. Compiling assets breaks on these operating systems. Using "-c" instead ensures that it works even with older versions of gzip. --- lib/tasks/assets.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index 69dba652950..aa95714cf9b 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -118,7 +118,7 @@ end def gzip(path) STDERR.puts "gzip #{path}" - STDERR.puts `gzip -f -k -9 #{path}` + STDERR.puts `gzip -f -c -9 #{path} > #{path}.gz` end def compress(from,to)