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