if not execute_build_command("build", src_path, build_root_dir, os, pkginfo.get_version) then
return false
end
+
# execute install script
@log.info( "Make install...", Log::LV_USER)
if not execute_build_command("install", src_path, build_root_dir, os, pkginfo.get_version) then
return false
end
+ # check uncompressed directory size
+ if not check_uncompressed_size(pkginfo, os, src_path ) then
+ return false
+ end
+
# write pkginfo
@log.info( "Generatiing pkginfo.manifest...", Log::LV_USER)
if not write_pkginfo_files(pkginfo,os,src_path) then
# execute
return execute_build_command("clean", src_path, build_root_dir, target_os, pkginfo.get_version)
end
+
+ def check_uncompressed_size(pkginfo, os, src_path)
+ # get category
+ os_category = Utils.get_os_category( os )
+
+ pkginfo.packages.each do |pkg|
+ # skip if not support the target os
+ if not pkg.os_list.include? os
+ next
+ end
+
+ cmd = "du --block-size=1 -s #{src_path}/package/#{pkg.package_name}.package.#{os}"
+
+ ret = Utils.execute_shell_return_ret(cmd)
+ if not ret.nil? then
+ uncompressed_size = ret.split(" ")[0]
+ pkg.uncompressed_size = uncompressed_size
+ end
+ end
+
+ return true
+
+ end
end
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