class Puppet::ModuleTool::Tar::Gnu

Public Instance Methods

pack(sourcedir, destfile) click to toggle source
   # File lib/puppet/module_tool/tar/gnu.rb
16 def pack(sourcedir, destfile)
17   Puppet::Util::Execution.execute("tar cf - #{sourcedir} | gzip -c > #{File.basename(destfile)}")
18 end
unpack(sourcefile, destdir, owner) click to toggle source
   # File lib/puppet/module_tool/tar/gnu.rb
 4 def unpack(sourcefile, destdir, owner)
 5   sourcefile = File.expand_path(sourcefile)
 6   destdir = File.expand_path(destdir)
 7 
 8   Dir.chdir(destdir) do
 9     Puppet::Util::Execution.execute("gzip -dc #{Shellwords.shellescape(sourcefile)} | tar xof -")
10     Puppet::Util::Execution.execute("find . -type d -exec chmod 755 {} +")
11     Puppet::Util::Execution.execute("find . -type f -exec chmod u+rw,g+r,a-st {} +")
12     Puppet::Util::Execution.execute("chown -R #{owner} .")
13   end
14 end