From a9f94c552f1e06eda91f6f7ff1c5313a4ed1d43b Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 24 Jul 2014 21:41:20 +0400 Subject: [PATCH] #416: rollback changes --- app/models/build_list.rb | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/app/models/build_list.rb b/app/models/build_list.rb index 69b3acc62..f6617bc14 100644 --- a/app/models/build_list.rb +++ b/app/models/build_list.rb @@ -627,41 +627,8 @@ class BuildList < ActiveRecord::Base end end - def add_job_to_abf_worker_queue - if permitted_arch? - super - else - unpermitted_arch - end - end - protected - def permitted_arch? - blob, raw = project.find_blob_and_raw_of_spec_file(commit_hash) - return true unless blob - - permitted = true - file = Tempfile.new(blob.name, File.join(Rails.root, 'tmp')) - filename = file.path - begin - file.puts raw.content - file.rewind - exclusivearch = `rpm -q --qf="[%{EXCLUSIVEARCH}\n]" --specfile #{file.path}` - exitstatus = $?.exitstatus - permitted = false if exitstatus == 0 && exclusivearch.present? && exclusivearch !~ /^#{arch.name}$/ - - excludearch = `rpm -q --qf="[%{EXCLUDEARCH}\n]" --specfile #{file.path}` - exitstatus = $?.exitstatus - permitted = false if exitstatus == 0 && excludearch.present? && excludearch =~ /^#{arch.name}$/ - ensure - file.close - file.unlink # deletes the temp file - end - - permitted - end - def create_container Resque.enqueue(BuildLists::CreateContainerJob, id) end