mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2024-11-29 07:01:45 +00:00
Add --bzip2 option to create-packages.rb to use bzip2 compression instead of deflate when creating the .zip packages
This results in smaller packages but the package creation will be slower and the system 'zip' tool must support bzip2 compression.
This commit is contained in:
parent
c3dee80640
commit
38bb0e8787
1 changed files with 5 additions and 1 deletions
|
@ -272,6 +272,7 @@ end
|
||||||
updater_binary_input_path = nil
|
updater_binary_input_path = nil
|
||||||
target_version = nil
|
target_version = nil
|
||||||
target_platform = nil
|
target_platform = nil
|
||||||
|
zip_flags = nil
|
||||||
|
|
||||||
OptionParser.new do |parser|
|
OptionParser.new do |parser|
|
||||||
parser.banner = "#{$0} [options] <input dir> <config file> <output dir>"
|
parser.banner = "#{$0} [options] <input dir> <config file> <output dir>"
|
||||||
|
@ -284,6 +285,9 @@ OptionParser.new do |parser|
|
||||||
parser.on("-p","--platform [platform]","Specifies the target platform for this update") do |platform|
|
parser.on("-p","--platform [platform]","Specifies the target platform for this update") do |platform|
|
||||||
target_platform = platform
|
target_platform = platform
|
||||||
end
|
end
|
||||||
|
parser.on(nil,"--bzip2","Use bzip2 compression (requires that 'zip' supports the -Z bz2 argument)") do
|
||||||
|
zip_flags = "-Z bzip2"
|
||||||
|
end
|
||||||
end.parse!
|
end.parse!
|
||||||
|
|
||||||
raise "Platform not specified (use -p option)" if !target_platform
|
raise "Platform not specified (use -p option)" if !target_platform
|
||||||
|
@ -365,7 +369,7 @@ package_file_map.each do |package,files|
|
||||||
File.unlink(output_file) if File.exist?(output_file)
|
File.unlink(output_file) if File.exist?(output_file)
|
||||||
|
|
||||||
Dir.chdir(input_dir) do
|
Dir.chdir(input_dir) do
|
||||||
if (!system("zip #{output_file} #{quoted_file_list}"))
|
if (!system("zip #{zip_flags} #{output_file} #{quoted_file_list}"))
|
||||||
raise "Failed to generate package #{package}"
|
raise "Failed to generate package #{package}"
|
||||||
else
|
else
|
||||||
puts "Generated package #{package} : #{file_sha1(output_file)}"
|
puts "Generated package #{package} : #{file_sha1(output_file)}"
|
||||||
|
|
Loading…
Reference in a new issue