Permalink
Browse files

[webui] Fix wrong repo names in PackageController#rpmlint_log...

...valid XML id generation was wrong for repository names like '12.1'.
  • Loading branch information...
saschpe committed Apr 13, 2012
1 parent 847d4d1 commit 402a4b9a68edc05e39f484d6804245e7231580bb
@@ -1026,13 +1026,18 @@ def buildresult
def rpmlint_result
render :text => 'no ajax', :status => 400 and return unless request.xhr?
- @repo_arch_hash = {}
- @buildresult = find_cached(Buildresult, :project => @project, :package => @package, :view => 'status', :expires_in => 5.minutes )
- @buildresult.each('result') do |result|
- hash_key = valid_xml_id(result.value('repository'))
+ @repo_list, @repo_arch_hash = [], {}
+ @buildresult = find_hashed(Buildresult, :project => @project, :package => @package, :view => 'status', :expires_in => 5.minutes )
+ repos = [] # Temp var
+ @buildresult.elements('result') do |result|
+ hash_key = valid_xml_id(elide(result.value('repository'), 30))
@repo_arch_hash[hash_key] ||= []
- @repo_arch_hash[hash_key] << result.value('arch')
+ @repo_arch_hash[hash_key] << result['arch']
+ repos << result.value('repository')
end if @buildresult
+ repos.uniq.each do |repo_name|
+ @repo_list << [repo_name, valid_xml_id(elide(repo_name, 30))]
+ end
render :partial => 'rpmlint_result', :locals => {:index => params[:index]}
end
@@ -1,6 +1,6 @@
<% index ||= '' %>
<p>
- <%= select_tag("rpmlint_repo_select_#{index}", options_for_select(@repo_arch_hash.keys, @project.value('name').gsub(':', '_'))) %>
+ <%= select_tag("rpmlint_repo_select_#{index}", options_for_select(@repo_list)) %>
<% i = 0 %>
<% @repo_arch_hash.each do |repo, arches| %>
<%= select_tag("rpmlint_arch_select_#{index}_#{repo}", options_for_select(arches.sort), :class => "rpmlint_arch_select_#{index}") %>

0 comments on commit 402a4b9

Please sign in to comment.