if File.exist? @download_path then
FileUtils.rm_rf @download_path
FileUtils.rm_rf @original_path
- else
- FileUtils.mkdir_p @download_path
- FileUtils.mkdir_p @original_path
end
+ FileUtils.mkdir_p @download_path
+ FileUtils.mkdir_p @original_path
+
# create client
@pkgsvr_client = Client.new( @pkgsvr_url, @download_path, @server.log )
pkgs.each do |pkg|
pkg_name=pkg[0]; os=pkg[1]; prj=pkg[2]
- downloaded_files = @pkgsvr_client.download(pkg_name, os, false)
- downloaded_files.each do |file_path|
+ file_paths = @pkgsvr_client.download(pkg_name, os, false)
+ if file_paths.nil? then next end
+ downloaded_files += file_paths
+
+ file_paths.each do |file_path|
@server.log.info "Creating new job for registering \"#{file_path}\""
new_job = @server.jobmgr.create_new_register_job( file_path, @dist_name )
if new_job.nil? then
next
end
new_job.priority = CommonJob::AUTO_JOB_PRIORITY
- new_job.create_logger( nil )
+ new_job.create_logger( nil )
# add
@server.jobmgr.add_job( new_job )
if loc.nil? then loc = @location end
+ if not File.exist? loc then FileUtils.mkdir_p "#{loc}" end
+
dependent_pkg_list = []
# get dependent list
filename = pkg_path.split('/')[-1]
if not FileDownLoader.download(url, loc, @log) then
+ @log.Error "File Download Failed!!"
+ @log.Error "* #{url} -> #{loc}"
+ return nil
end
file_path = File.join(loc, filename)