Kouhei Sutou
null+****@clear*****
Thu May 16 14:28:35 JST 2013
Kouhei Sutou 2013-05-16 14:28:35 +0900 (Thu, 16 May 2013) New Revision: 69a689f44e3008e076b276c2a9b53488cdb7c02a https://github.com/groonga/chef-cookbooks/commit/69a689f44e3008e076b276c2a9b53488cdb7c02a Message: Remove duplications by defines variables Modified files: groonga/recipes/repository.rb Modified: groonga/recipes/repository.rb (+7 -5) =================================================================== --- groonga/recipes/repository.rb 2013-05-16 14:25:19 +0900 (e3008af) +++ groonga/recipes/repository.rb 2013-05-16 14:28:35 +0900 (73a732c) @@ -52,21 +52,23 @@ elsif platform_family?("rhel", "fedora") family = "fedora" end - remote_file "#{Chef::Config[:file_cache_path]}/groonga-release-1.1.0-1.noarch.rpm" do + rpm_base_name = "groonga-release-1.1.0-1.noarch.rpm" + cached_rpm_path = "#{Chef::Config[:file_cache_path]}/#{base_name}" + remote_file cached_rpm_path do base_url = "http://packages.groonga.org/#{family}" - source "#{base_url}/groonga-release-1.1.0-1.noarch.rpm" + source "#{base_url}/#{base_name}" not_if "rpm -qa | egrep -qx 'groonga-release-1.1.0-1(|.noarch)'" notifies :install, "rpm_package[groonga-release]", :immediately end rpm_package "groonga-release" do - source "#{Chef::Config[:file_cache_path]}/groonga-release-1.1.0-1.noarch.rpm" - only_if {::File.exists?("#{Chef::Config[:file_cache_path]}/groonga-release-1.1.0-1.noarch.rpm")} + source cached_rpm_path + only_if {::File.exists?(cached_rpm_path)} action :nothing end file "groonga-release-cleanup" do - path "#{Chef::Config[:file_cache_path]}/groonga-release-1.1.0-1.noarch.rpm" + path cached_rpm_path action :delete end end -------------- next part -------------- HTML����������������������������... ダウンロード