log = log + "## Extract file : #{package_file_path}\n"
result = extract_file(package_name, package_file_path, path, target_path, logger)
- if result == "" or result.nil? then return false
+ if result == "" or result.nil? then
+ write_log(target_path, package_name, log)
+ return false
else log = log + result end
log = log + "## Move files : \"#{path}\" to \"#{target_path}\"\n"
result = move_dir(package_name, path, target_path, logger)
- if result.nil? then return false
+ if result.nil? then
+ write_log(target_path, package_name, log)
+ return false
else log = log + result end
log = log + "## Execute install script\n"
result = execute_install_script(package_name, path, target_path, logger)
- if result.nil? then return false
+ if result.nil? then
+ write_log(target_path, package_name, log)
+ return false
else log = log + result end
log = log + "## Move remove script\n"
result = move_remove_script(package_name, path, target_path, logger)
- if result.nil? then return false
+ if result.nil? then
+ write_log(target_path, package_name, log)
+ return false
else log = log + result end
log = log + "## Remove temporary dir : #{path} #####\n"
logger.info "Removed #{path}"
raise Interrupt
end
-
+ write_log(target_path, package_name, log)
+=begin
target_config_path = target_path + "/#{PACKAGE_INFO_DIR}/#{package_name}"
if not File.exist? target_config_path then FileUtils.mkdir_p(target_config_path) end
pkg_inst_log = "#{package_name}_inst.log"
File.open(pkg_inst_log_path, "a+") do |f|
f.puts log
end
-
+=end
when "source" then
end
logger.info "Installed \"#{package_name}\" package.. OK"
logger.info " [path: #{target_path}]"
return true;
- end
+ end
+
+ def FileInstaller.write_log(target_path, package_name, log)
+ target_config_path = target_path + "/#{PACKAGE_INFO_DIR}/#{package_name}"
+ if not File.exist? target_config_path then FileUtils.mkdir_p(target_config_path) end
+ pkg_inst_log = "#{package_name}_inst.log"
+ pkg_inst_log_path = File.join(target_config_path, pkg_inst_log)
+
+ File.open(pkg_inst_log_path, "a+") do |f|
+ f.puts log
+ end
+ end
def FileInstaller.move_remove_script(package_name, path, target_path, logger)
target_path = target_path + "/#{PACKAGE_INFO_DIR}/#{package_name}"
show_file_list_command = nil
extrach_file_list_command = nil
+ log = ""
case ext
when ".zip" then
if Utils.is_windows_like_os( Utils::HOST_OS ) then
log = unzip_file(package_file_path, path)
else
- result = Utils.execute_shell_return(extract_file_list_command)
- if result.nil? then log = nil
- else log = result.join("") end
+ #result = Utils.execute_shell_return(extract_file_list_command)
+ #if result.nil? then log = nil
+ #else log = result.join("") end
+ log = `#{extract_file_list_command}`
end
when ".tar" then
- result = Utils.execute_shell_return(extract_file_list_command)
- if result.nil? then log = nil
- else log = result.join("") end
+ #result = Utils.execute_shell_return(extract_file_list_command)
+ #if result.nil? then log = nil
+ #else log = result.join("") end
+ log = `#{extract_file_list_command}`
end
if log == "" then log = nil end