]> git.openstreetmap.org Git - chef.git/commitdiff
Always rebuild Makefile for quad_tile extension before using it
authorTom Hughes <tom@compton.nu>
Fri, 30 Dec 2016 07:58:19 +0000 (07:58 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 30 Dec 2016 08:19:35 +0000 (08:19 +0000)
cookbooks/web/definitions/rails_port.rb

index 75d22d271164c53ba454aa391e73676ea0d95280..06a68504b2847b9ec0b38f7e41bc1b6fa44dae0d 100644 (file)
@@ -274,20 +274,21 @@ define :rails_port, :action => [:create, :enable] do
     cwd "#{rails_directory}/lib/quad_tile"
     user rails_user
     group rails_group
-    not_if { File.exist?("#{rails_directory}/lib/quad_tile/Makefile") && File.mtime("#{rails_directory}/lib/quad_tile/Makefile") >= File.mtime("#{rails_directory}/lib/quad_tile/extconf.rb") }
+    not_if do
+      File.exist?("#{rails_directory}/lib/quad_tile/quad_tile_so.so") &&
+        File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/extconf.rb") &&
+        File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/quad_tile.c") &&
+        File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/quad_tile.h")
+    end
+    notifies :run, "execute[#{rails_directory}/lib/quad_tile/Makefile]"
   end
 
   execute "#{rails_directory}/lib/quad_tile/Makefile" do
+    action :nothing
     command "make"
     cwd "#{rails_directory}/lib/quad_tile"
     user rails_user
     group rails_group
-    not_if do
-      File.exist?("#{rails_directory}/lib/quad_tile/quad_tile_so.so") &&
-        File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/Makefile") &&
-        File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/quad_tile.c") &&
-        File.mtime("#{rails_directory}/lib/quad_tile/quad_tile_so.so") >= File.mtime("#{rails_directory}/lib/quad_tile/quad_tile.h")
-    end
     notifies :run, "execute[#{rails_directory}]"
   end