Sha256: a6f0736c3527c1aa0d4fac96400e32bf626460bf1b7b0101c33b59d0a2bf55c3

Contents?: true

Size: 693 Bytes

Versions: 679

Compression:

Stored size: 693 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 u+rw,g+r,a-st {} +")
      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

679 entries across 679 versions & 3 rubygems

Version Path
puppet-7.34.0 lib/puppet/module_tool/tar/gnu.rb
puppet-7.34.0-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.34.0-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.34.0-universal-darwin lib/puppet/module_tool/tar/gnu.rb
puppet-7.33.0 lib/puppet/module_tool/tar/gnu.rb
puppet-7.33.0-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.33.0-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.33.0-universal-darwin lib/puppet/module_tool/tar/gnu.rb
puppet-7.32.1 lib/puppet/module_tool/tar/gnu.rb
puppet-7.32.1-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.32.1-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.32.1-universal-darwin lib/puppet/module_tool/tar/gnu.rb
puppet-7.31.0 lib/puppet/module_tool/tar/gnu.rb
puppet-7.31.0-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.31.0-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.31.0-universal-darwin lib/puppet/module_tool/tar/gnu.rb
puppet-7.30.0 lib/puppet/module_tool/tar/gnu.rb
puppet-7.30.0-x86-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.30.0-x64-mingw32 lib/puppet/module_tool/tar/gnu.rb
puppet-7.30.0-universal-darwin lib/puppet/module_tool/tar/gnu.rb