def initialize
@tar = Pkg::Util::Tool.find_tool('tar', :required => true)
@project = Pkg::Config.project
@version = Pkg::Config.version
@files = Pkg::Config.files
@target = File.join(Pkg::Config.project_root, "pkg", "#{@project}-#{@version}.tar.gz")
if Pkg::Config.tar_excludes
if Pkg::Config.tar_excludes.is_a?(String)
warn "warning: `tar_excludes` should be an array, not a string"
@excludes = Pkg::Config.tar_excludes.split(' ')
elsif Pkg::Config.tar_excludes.is_a?(Array)
@excludes = Pkg::Config.tar_excludes
else
fail "Tarball excludes must either be an array or a string, not #{@excludes.class}"
end
else
@excludes = []
end
if Pkg::Config.templates
@templates = Pkg::Config.templates.dup
fail "templates must be an array" unless @templates.is_a?(Array)
end
end