From bdca700e9298dcb9b1f54c1fbfc48ee850c9bc3f Mon Sep 17 00:00:00 2001 From: Jesse Zhang Date: Mon, 21 May 2012 16:11:34 -0700 Subject: [PATCH 1/2] [dev_setup] set owner of mongo tarball Correcting my stupidity of commenting out the ownership and permission attributes in commit 2abb03a9. Change-Id: I7ddc6b070cb167d3285ece9aba3390a837fe4114 --- dev_setup/cookbooks/mongodb/recipes/default.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dev_setup/cookbooks/mongodb/recipes/default.rb b/dev_setup/cookbooks/mongodb/recipes/default.rb index 9e80176..65d6862 100644 --- a/dev_setup/cookbooks/mongodb/recipes/default.rb +++ b/dev_setup/cookbooks/mongodb/recipes/default.rb @@ -6,9 +6,8 @@ # cf_remote_file File.join("", "tmp", "mongodb-linux-#{node[:kernel][:machine]}-#{node[:mongodb][:version]}.tgz") do - # owner node[:deployment][:user] + owner node[:deployment][:user] source node[:mongodb][:source] - # not_if { ::File.exists?(File.join("", "tmp", "mongodb-linux-#{node[:kernel][:machine]}-#{node[:mongodb][:version]}.tgz")) } checksum '8f6a58293068e0fb28b463b955f3660f492094e53129fb88af4a7efcfc7995da' end From 0f4be4814f2031cab52c5be30915b16f07247aa2 Mon Sep 17 00:00:00 2001 From: Jesse Zhang Date: Mon, 21 May 2012 14:08:09 -0700 Subject: [PATCH 2/2] [dev_setup] Use github for lua-cjson source This change switches to downloading the source from github to avoid outage of lua-cjson's author's homepage. Test plan: Run dev_setup on a vanilla VM and pass BVTs Change-Id: I8068a5060014b46847cfa288916e282de22fb88a --- dev_setup/cookbooks/nginx/attributes/default.rb | 2 +- dev_setup/cookbooks/nginx/recipes/default.rb | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/dev_setup/cookbooks/nginx/attributes/default.rb b/dev_setup/cookbooks/nginx/attributes/default.rb index 8c46b7d..590af7b 100644 --- a/dev_setup/cookbooks/nginx/attributes/default.rb +++ b/dev_setup/cookbooks/nginx/attributes/default.rb @@ -15,7 +15,7 @@ default[:lua][:version] = "5.1.4" default[:lua][:simple_version] = lua[:version].match(/\d+\.\d+/).to_s # something like 5.1 default[:lua][:source] = "http://www.lua.org/ftp/lua-#{lua[:version]}.tar.gz" default[:lua][:path] = File.join(node[:deployment][:home], "deploy", "lua", "lua-#{lua[:version]}") -default[:lua][:cjson_source] = "http://www.kyne.com.au/~mark/software/lua-cjson-1.0.3.tar.gz" +default[:lua][:cjson_source] = "http://github.com/mpx/lua-cjson/tarball/ddbb686f535accac1e3cc375994191883fbe35d8" default[:lua][:module_path] = File.join(lua[:path], 'lib', 'lua', lua[:simple_version]) default[:lua][:plugin_source_path] = File.join(node["cloudfoundry"]["path"], "router", "ext", "nginx") diff --git a/dev_setup/cookbooks/nginx/recipes/default.rb b/dev_setup/cookbooks/nginx/recipes/default.rb index 04fbc29..1d1b26a 100644 --- a/dev_setup/cookbooks/nginx/recipes/default.rb +++ b/dev_setup/cookbooks/nginx/recipes/default.rb @@ -28,10 +28,11 @@ when "ubuntu" not_if { ::File.exists?(File.join("", "tmp", "lua-#{lua_version}.tar.gz")) } end - remote_file File.join("", "tmp", "lua-cjson-1.0.3.tar.gz") do + lua_cjson_tarball = File.join(node[:deployment][:setup_cache], "lua-cjson-1.0.3.tar.gz") + remote_file lua_cjson_tarball do owner node[:deployment][:user] source node[:lua][:cjson_source] - not_if { ::File.exists?(File.join("", "tmp", "lua-cjson-1.0.3.tar.gz")) } + checksum 'b4e3495dde10d087a9550d3a6f364e8998a5dda4f5f4722c69ff89420c9a8c09' end # Nginx related packages @@ -110,8 +111,8 @@ when "ubuntu" cwd File.join("", "tmp") user node[:deployment][:user] code <<-EOH - tar xzf lua-cjson-1.0.3.tar.gz - cd lua-cjson-1.0.3 + tar xzf #{lua_cjson_tarball} + cd mpx-lua-cjson-ddbb686 sed 's!^PREFIX ?=.*!PREFIX ?='#{lua_path}'!' Makefile > tmp mv tmp Makefile make