=end
class Package
- attr_accessor :package_name, :label, :os, :build_host_os, :maintainer, :attribute, :install_dep_list, :build_dep_list, :source_dep_list, :conflicts, :source, :src_path, :path, :origin, :checksum, :size, :description, :os_list, :custom, :change_log
+ attr_accessor :package_name, :label, :os, :build_host_os, :maintainer, :attribute, :install_dep_list, :build_dep_list, :source_dep_list, :conflicts, :source, :src_path, :path, :origin, :checksum, :size, :uncompressed_size, :description, :os_list, :custom, :change_log
def initialize (package_name)
@package_name = package_name
@label = ""
@origin = ""
@checksum = ""
@size = ""
+ @uncompressed_size = ""
@description = ""
@custom = ""
@change_log = {}
if not @origin.empty? then string = string + "\n" + "Origin : " + @origin end
if not @checksum.empty? then string = string + "\n" + "SHA256 : " + @checksum end
if not @size.empty? then string = string + "\n" + "Size : " + @size end
+ if not @uncompressed_size.empty? then string = string + "\n" + "Uncompressed-size : " + @uncompressed_size end
if not @custom.empty? then string = string + "\n" + @custom end
if not @description.empty? then string = string + "\n" + "Description : " + @description end
return string
when /^Size$/i then
package.size = l.sub(/^[ \t]*Size[ \t]*:[ \t]*/i,"").strip
multi_line = nil
+ when /^Uncompressed-size$/i then
+ package.uncompressed_size = l.sub(/^[ \t]*Uncompressed-size[ \t]*:[ \t]*/i,"").strip
+ multi_line = nil
when /^Description$/i then
package.description = l.sub(/^[ \t]*Description[ \t]*:[ \t]*/i,"").strip
multi_line = "Description"
pkg.size = `du -b #{file_path}`.split[0].strip
end
+ if pkg.uncompressed_size.empty? then
+ if File.extname( file_path ).eql? ".zip" then
+ output = `zipinfo -t #{file_path}`
+
+ pkg.uncompressed_size = output.scan(/\d+/)[1]
+ end
+ end
+
@pkg_hash_os[pkg.os][pkg.package_name] = pkg
return pkg