Sha256: 00526fa4c6e3441a3642776f899efe563989ca5e2dccadbec64f2349e5fefead

Contents?: true

Size: 685 Bytes

Versions: 56

Compression:

Stored size: 685 Bytes

Contents

require 'shellwords'

class Puppet::ModuleTool::Tar::Gnu
  def unpack(sourcefile, destdir, owner)
    sourcefile = File.expand_path(sourcefile)
    destdir = File.expand_path(destdir)

    Dir.chdir(destdir) do
      Puppet::Util::Execution.execute("gzip -dc #{Shellwords.shellescape(sourcefile)} | tar xof -")
      Puppet::Util::Execution.execute("find . -type d -exec chmod 755 {} +")
      Puppet::Util::Execution.execute("find . -type f -exec chmod a-wst {} +")
      Puppet::Util::Execution.execute("chown -R #{owner} .")
    end
  end

  def pack(sourcedir, destfile)
    Puppet::Util::Execution.execute("tar cf - #{sourcedir} | gzip -c > #{File.basename(destfile)}")
  end
end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
puppet-retrospec-0.12.2 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.7 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.7-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.7-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.6 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.6-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.12.1 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.6-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.12.0 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.5 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.5-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.5-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.4 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.4-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-3.8.4-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.11.0 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.10.0 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.9.1 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.9.0 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb
puppet-retrospec-0.8.1 vendor/gems/puppet-3.7.3/lib/puppet/module_tool/tar/gnu.rb