bin/tpkg in tpkg-1.19.2 vs bin/tpkg in tpkg-1.20.0

- old
+ new

@@ -28,15 +28,21 @@ @servers = nil @worker_count = 10 @rerun_with_sudo = false @tpkg_options = {} @init_options = {} +@compress = nil + def rerun_with_sudo_if_necessary if Process.euid != 0 && @sudo warn "Executing with sudo" - exec('sudo', $0, *ARGV) + if ENV['TPKG_HOME'] + exec('sudo', 'env', "TPKG_HOME=#{ENV['TPKG_HOME']}", $0, *ARGV) + else + exec('sudo', $0, *ARGV) + end end end opts = OptionParser.new(nil, 24, ' ') opts.banner = 'Usage: tpkg [options]' @@ -232,10 +238,13 @@ end opts.on('--deploy-as', '=USERNAME', 'What username to use for deploying to remote server') do |opt| @deploy_options["deploy-as"] = opt @deploy_params = @deploy_params - ['--deploy-as'] end +opts.on('--compress', '=[TYPE]', 'Compress files when making packages.') do |opt| + @compress = opt +end opts.on('--debug', 'Print lots of messages about what tpkg is doing') do |opt| @debug = opt Tpkg::set_debug(@debug) end opts.on('--version', 'Show tpkg version') do |opt| @@ -334,10 +343,10 @@ end ret_val = 0 case @action when :make - pkgfile = Tpkg::make_package(@action_value, passphrase_callback, {:force => @force}) + pkgfile = Tpkg::make_package(@action_value, passphrase_callback, {:force => @force, :compress => @compress}) if pkgfile puts "Package is #{pkgfile}" else puts "Package build aborted or failed" end