diff --git a/app/models/build_list/package.rb b/app/models/build_list/package.rb index 891fe239b..20a0b1734 100644 --- a/app/models/build_list/package.rb +++ b/app/models/build_list/package.rb @@ -11,6 +11,7 @@ class BuildList::Package < ActiveRecord::Base :package_type, :name, :release, :version, :presence => true validates :package_type, :inclusion => PACKAGE_TYPES + validates :sha1, :presence => true, :if => Proc.new { |p| p.build_list.new_core? } default_scope order('lower(name) ASC, length(name) ASC') diff --git a/app/views/projects/build_lists/show.html.haml b/app/views/projects/build_lists/show.html.haml index 8fa595f99..6c6858ada 100644 --- a/app/views/projects/build_lists/show.html.haml +++ b/app/views/projects/build_lists/show.html.haml @@ -167,7 +167,10 @@ %tbody - @build_list.packages.each do |package| %tr - %td= package.fullname + - if package.sha1.present? + %td= link_to package.fullname, "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{package.sha1}" + - else + %td= package.fullname %td= package.name %td= package.version %td= package.release diff --git a/db/migrate/20130110104600_abb_sha1_to_build_list_package.rb b/db/migrate/20130110104600_abb_sha1_to_build_list_package.rb new file mode 100644 index 000000000..57dcc84db --- /dev/null +++ b/db/migrate/20130110104600_abb_sha1_to_build_list_package.rb @@ -0,0 +1,5 @@ +class AbbSha1ToBuildListPackage < ActiveRecord::Migration + def change + add_column :build_list_packages, :sha1, :string + end +end diff --git a/lib/abf_worker/rpm_worker_observer.rb b/lib/abf_worker/rpm_worker_observer.rb index 925373791..f709f1233 100644 --- a/lib/abf_worker/rpm_worker_observer.rb +++ b/lib/abf_worker/rpm_worker_observer.rb @@ -46,14 +46,6 @@ module AbfWorker package.platform_id = bl.save_to_platform_id package.save! end - - container = (options['results'] || []). - select{ |r| r['file_name'] !~ /.*\.log$/ }.first - sha1 = container ? container['sha1'] : nil - if sha1 - bl.container_path = "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{sha1}" - bl.save! - end update_results(bl, options) end end