From 0e0f5eace1169de39535166caf3ea18ccee70cae Mon Sep 17 00:00:00 2001 From: Phil Ross Date: Sat, 31 Jan 2015 19:44:33 +0000 Subject: [PATCH] Support changes to tar execution in Rake 10.4. Arguments are now passed as separate Array elements. --- Rakefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index e5ec42d5..ba32b1b3 100644 --- a/Rakefile +++ b/Rakefile @@ -24,7 +24,10 @@ class TZInfoPackageTask < Gem::PackageTask private :orig_sh def sh(*cmd, &block) - if cmd.first =~ /\A__tar_with_owner__ -?([zjcvf]+)(.*)\z/ + if cmd[0] == '__tar_with_owner__' && cmd[1] =~ /\A-?[zjcvf]+\z/ + opts = cmd[1] + cmd = ['tar', 'c', '--owner', '0', '--group', '0', "#{opts.start_with?('-') ? '' : '-'}#{opts.gsub('c', '')}"] + cmd.drop(2) + elsif cmd.first =~ /\A__tar_with_owner__ -?([zjcvf]+)(.*)\z/ opts = $1 args = $2 cmd[0] = "tar c --owner 0 --group 0 -#{opts.gsub('c', '')}#{args}"