From 4a8045ecfbbf3e957eea4ea6193c33e1644266b6 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Fri, 11 Jan 2013 16:27:29 +0400 Subject: [PATCH] #780: small refactoring --- lib/tasks/new_core.rake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/tasks/new_core.rake b/lib/tasks/new_core.rake index c486815cf..698a686fe 100644 --- a/lib/tasks/new_core.rake +++ b/lib/tasks/new_core.rake @@ -76,8 +76,7 @@ namespace :new_core do next unless sha1 dir = Dir.mktmpdir('update-packages-', "#{APP_CONFIG['root_path']}") begin - system "cd #{dir} && curl -L -O #{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{sha1}" - system "cd #{dir} && tar -xzf #{sha1}" + system "cd #{dir} && curl -L -O #{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{sha1}; tar -xzf #{sha1}" system "rm -f #{dir}/#{sha1}" extract_rpms_and_update_packages("#{dir}/archives/SRC_RPM", bl, 'source', token) @@ -94,8 +93,7 @@ namespace :new_core do def extract_rpms_and_update_packages(dir, bl, package_type, token) Dir.glob("#{dir}/*.rpm") do |rpm_file| fullname = File.basename rpm_file - package = bl.packages.by_package_type(package_type). - find{ |p| p.fullname == fullname } + package = bl.packages.by_package_type(package_type).find{ |p| p.fullname == fullname } next unless package package.sha1 = Digest::SHA1.file(rpm_file).hexdigest