]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/mediawiki/providers/extension.rb
Update to chef server 12
[chef.git] / cookbooks / mediawiki / providers / extension.rb
index 959940b9395efb829eefc37816d977a4fa1a5fd6..cb4cc5c84b3670edde1267887c6c4109fc721c0a 100644 (file)
@@ -40,7 +40,7 @@ action :create do
     extension_reference = if new_resource.tag
                             "refs/tags/#{new_resource.tag}"
                           else
-                            "refs/heads/REL#{extension_version}".tr(".", "_")
+                            "REL#{extension_version}".tr(".", "_")
                           end
 
     git extension_directory do
@@ -63,17 +63,17 @@ action :create do
       mode 0664
       variables new_resource.variables
     end
-  end
-
-  extension_script = "#{extension_directory}/#{new_resource.name}.php"
+  else
+    extension_script = "#{extension_directory}/#{new_resource.name}.php"
 
-  file "#{mediawiki_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do
-    action :create
-    content "<?php require_once('#{extension_script}');\n"
-    user node[:mediawiki][:user]
-    group node[:mediawiki][:group]
-    mode 0664
-    only_if { ::File.exist?(extension_script) }
+    file "#{mediawiki_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do
+      action :create
+      content "<?php require_once('#{extension_script}');\n"
+      user node[:mediawiki][:user]
+      group node[:mediawiki][:group]
+      mode 0664
+      only_if { ::File.exist?(extension_script) }
+    end
   end
 end
 
@@ -83,12 +83,6 @@ action :delete do
     recursive true
   end
 
-  if new_resource.template # ~FC023
-    file "#{mediawiki_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do
-      action :delete
-    end
-  end
-
   file "#{mediawiki_directory}/LocalSettings.d/Ext-#{new_resource.name}.inc.php" do
     action :delete
   end