#794: refactoring of #detele_repositories_directory

This commit is contained in:
Vokhmin Alexey V 2013-01-18 16:32:47 +04:00
parent 218374f7a6
commit d0b288fe37
1 changed files with 2 additions and 4 deletions

View File

@ -77,10 +77,8 @@ class Repository < ActiveRecord::Base
end
def detele_repositories_directory(repository_path)
Arch.pluck(:name).each do |arch|
system("rm -rf #{repository_path}/#{arch}/#{name}")
end
system("rm -rf #{repository_path}/SRPMS/#{name}")
srpm_and_arches = (['SRPM'] << Arch.pluck(:name)).join(',')
`bash -c 'rm -rf #{repository_path}/{#{srpm_and_arches}}/#{name}'`
end
end