lib/puppet/module_tool/tar/gnu.rb in puppet-3.3.2 vs lib/puppet/module_tool/tar/gnu.rb in puppet-3.4.0.rc1
- old
+ new
@@ -1,9 +1,13 @@
class Puppet::ModuleTool::Tar::Gnu
+ def initialize(command = "tar")
+ @command = command
+ end
+
def unpack(sourcefile, destdir, owner)
- Puppet::Util::Execution.execute("tar xzf #{sourcefile} --no-same-permissions --no-same-owner -C #{destdir}")
+ Puppet::Util::Execution.execute("#{@command} xzf #{sourcefile} --no-same-owner -C #{destdir}")
Puppet::Util::Execution.execute("find #{destdir} -type d -exec chmod 755 {} +")
- Puppet::Util::Execution.execute("find #{destdir} -type f -exec chmod 644 {} +")
+ Puppet::Util::Execution.execute("find #{destdir} -type f -exec chmod a-wst {} +")
Puppet::Util::Execution.execute("chown -R #{owner} #{destdir}")
end
def pack(sourcedir, destfile)
Puppet::Util::Execution.execute("tar cf - #{sourcedir} | gzip -c > #{destfile}")