# get dependent list
if trace then
- dependent_pkg_list = get_install_dependent_packages(pkg_name, os, true, false)
+ dependent_pkg_list = get_install_dependent_packages(pkg_name, os, true, true)
if dependent_pkg_list.nil? then
@log.error "Failed to get dependency for \"#{pkg_name}\" package"
return nil
else dependent_pkg_list = [pkg_name] end
surl = @server_addr
-
# download files
file_local_path = []
dependent_pkg_list.each do |p|
filename = pkg_path.split('/')[-1]
if not FileDownLoader.download(url, loc, @log) then
- @log.error "Failed download #{pkg_name} [#{pkg_ver}]"
- return nil
end
file_path = File.join(loc, filename)
if trace then
@log.info "Downloaded \"#{pkg_name}\" package with all dependent packages.. OK"
- else
- @log.info "Downloaded only \"#{pkg_name}\" package.. OK"
end
- @log.info " [path : #{file_local_path.join(", ")}]"
+ @log.info " [path: #{file_local_path.join(", ")}]"
return file_local_path
end
filename = filepath.split('/')[-1]
if not File.exist? distpath then FileUtils.mkdir_p "#{distpath}" end
distfile = File.join(distpath, filename)
+ @log.info "Moving \"#{filename}\" to download cache directory"
+ @log.info " [path: #{distpath}]"
$filemove_mutex.synchronize {
if not File.exist? distfile then
Utils.execute_shell("mv #{filepath} #{distfile}")
}
if File.exist? distfile then return distfile
- else return nil end
+ else
+ @log.info "Failed to move [#{filenamae}] to "
+ @log.info " [#{distpath}]"
+ return nil
+ end
end
private
end
file_local_path = File.join(@location, file_name)
@log.info "Downloaded \"#{file_name}\" source file.. OK"
- @log.info " [path : #{file_local_path}]"
+ @log.info " [path: #{file_local_path}]"
return file_local_path
end
if not force then
case compare_result
when -1 then
- @log.warn "\"#{pkg_name}\" package version is bigger then remote package version"
+ @log.warn "Checked \"#{pkg_name}\" package version : it is bigger then remote package version"
return true
when 0 then
- @log.warn "\"#{pkg_name}\" package version is same with remote package version"
+ @log.warn "Checked \"#{pkg_name}\" package version : it is same with remote package version"
return true
when 1, 2 then
end
public
# install local package (ignore dependent packages)
- def install_local_pkg(pkg_path, trace, force, repos_path)
+ def install_local_pkg(pkg_path, trace, force, repos_path = nil)
ret = install_local_pkg_internal(pkg_path, trace, force, repos_path)
return ret
if not force then
case compare_result
when -1 then
- @log.warn "installed \"#{pkg_name}\" package version is bigger.."
+ @log.warn "Installed \"#{pkg_name}\" package version is bigger.."
return true
when 0 then
- @log.warn "\"#{pkg_name}\" package version is same with installed package version.."
+ @log.warn "Checked \"#{pkg_name}\" package version : it is same with installed package version"
return true
when 1, 2 then
end
new_pkg_os = pkg.os
install_dep_pkgs.each do |p|
# check local path first
- binpkgs = Dir.glob("#{repos_path}/#{p.package_name}_*_#{new_pkg_os}.zip")
- if not binpkgs.empty? then
- if not install_local_pkg_internal(binpkgs[0], true, false, repos_path) then
- @log.warn "#{p} package is not installed"
+ if not repos_path.nil? then
+ binpkgs = Dir.glob("#{repos_path}/#{p.package_name}_*_#{new_pkg_os}.zip")
+ if not binpkgs.empty? then
+ if not install_local_pkg_internal(binpkgs[0], true, false, repos_path) then
+ @log.warn "#{p} package is not installed"
+ end
+ else
+ if not install_internal(p.package_name, new_pkg_os, true, false) then
+ @log.warn "#{p} package is not installed"
+ end
end
- else
+ else
if not install_internal(p.package_name, new_pkg_os, true, false) then
@log.warn "#{p} package is not installed"
end
- end
+ end
end
end
i = i + 1
end
- @log.info "Get install dependent packages for #{pkg_name} package.. OK"
+ @log.info "Get install dependent packages for \"#{pkg_name}\" package.. OK"
if reverse then return result.reverse.uniq.push(pkg_name)
else return result.uniq.insert(0, pkg_name) end
end
if not force then
case compare_result
when -1 then
- @log.warn "\"#{pkg_name}\" package version is bigger then remote package version"
+ @log.warn "Checked \"#{pkg_name}\" package version : it is bigger then remote package version"
return true
when 0 then
- @log.warn "\"#{pkg_name}\" package version is same with remote package version"
+ @log.warn "Checked \"#{pkg_name}\" package version : it is same with remote package version"
return true
end
end
# install package
cached_filepath = nil
if Utils.is_linux_like_os( Utils::HOST_OS ) then
- @log.info "Checking cached #{pkg_name} package file"
cached_filepath = get_cached_filepath(filename, pkg_checksum, pkg_size)
end
if not cached_filepath.nil? then
- @log.info "Installing #{pkg_name} package to [#{@location}] (using cached file)"
+ @log.info "Cached #{pkg_name} package file.. OK"
ret = FileInstaller.install(pkg_name, cached_filepath, type, @location, @log)
else
- @log.info "Downloading #{pkg_name} package to [#{@tmp_path}]"
filepath = download(pkg_name, os, false, @tmp_path)
if filepath.nil? then
- @log.info "Failed to download #{pkg_name}"
return false
end
- @log.info "Moving package file [#{@download_path}]"
filepath = move_downloaded_pkg(filepath[0], @download_path)
if filepath.nil? then
- @log.info "Failed to move [#{filepath[0]}] to "
- @log.info " [#{@download_path}]"
return false
end
- @log.info "Installing #{pkg_name} package to [#{@location}]"
ret = FileInstaller.install(pkg_name, filepath, type, @location, @log)
remove_downloaded_pkgs(pkg_name, os)
end
else pkg_hash[pkg_name] = get_pkg_from_list(pkg_name, os) end
@installed_pkg_hash_loc[installed_pkg_hash_key] = pkg_hash
- @log.info "Added information for \"#{pkg_name}\" package.. OK"
+ #@log.info "Added information for \"#{pkg_name}\" package.. OK"
return pkg_hash
end
private
# add package manifest info
def add_local_pkg_info(pkg_name)
-
+
config_path = File.join(@location, PACKAGE_INFO_DIR, "#{pkg_name}")
pkg = read_pkginfo_file(pkg_name, config_path)
else pkg_hash[pkg_name] = pkg end
@installed_pkg_hash_loc[installed_pkg_hash_key] = pkg_hash
- @log.info "Added information for \"#{pkg_name}\" package.. OK"
+ #@log.info "Added information for \"#{pkg_name}\" package.. OK"
return pkg_hash
end