#860: small refactoring

This commit is contained in:
Vokhmin Alexey V 2013-01-29 01:50:27 +04:00
parent ba132b0824
commit 52cd67e1c3
3 changed files with 7 additions and 5 deletions

View File

@ -76,8 +76,11 @@ module BuildListsHelper
end end
end end
def container_url def container_url(full_path = true)
"http://#{request.host_with_port}/downloads/#{@build_list.save_to_platform.name}/container/#{@build_list.id}".html_safe p = ''
p << "http://#{request.host_with_port}" if full_path
p << "/downloads/#{@build_list.save_to_platform.name}/container/#{@build_list.id}"
p.html_safe
end end
def log_reload_time_options def log_reload_time_options

View File

@ -6,7 +6,7 @@ json.build_list do |json|
json.build_log_url log_build_list_path(@build_list) json.build_log_url log_build_list_path(@build_list)
if @build_list.container_published? if @build_list.container_published?
json.container_path container_url json.container_path container_url(false)
else else
json.container_path '' json.container_path ''
end end

View File

@ -68,8 +68,7 @@ module AbfWorker
def create_container_for(build_list) def create_container_for(build_list)
platform_path = "#{build_list.save_to_platform.path}/container/#{build_list.id}" platform_path = "#{build_list.save_to_platform.path}/container/#{build_list.id}"
system "rm -rf #{platform_path}" system "rm -rf #{platform_path} && mkdir -p #{platform_path}"
system "mkdir -p #{platform_path}"
packages = {:sources => [], :binaries => {:x86_64 => [], :i586 => []}} packages = {:sources => [], :binaries => {:x86_64 => [], :i586 => []}}
packages[:sources] = build_list.packages.by_package_type('source').pluck(:sha1).compact packages[:sources] = build_list.packages.by_package_type('source').pluck(:sha1).compact