Skip to content

Commit

Permalink
Support changes to tar execution in Rake 10.4.
Browse files Browse the repository at this point in the history
Arguments are now passed as separate Array elements.
  • Loading branch information
philr committed Jan 31, 2015
1 parent 05f749a commit 0e0f5ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 0e0f5ea

Please sign in to comment.