about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/web-apps/discourse/use_mv_instead_of_rename.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/web-apps/discourse/use_mv_instead_of_rename.patch')
-rw-r--r--nixpkgs/pkgs/servers/web-apps/discourse/use_mv_instead_of_rename.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/web-apps/discourse/use_mv_instead_of_rename.patch b/nixpkgs/pkgs/servers/web-apps/discourse/use_mv_instead_of_rename.patch
new file mode 100644
index 000000000000..30493b543e38
--- /dev/null
+++ b/nixpkgs/pkgs/servers/web-apps/discourse/use_mv_instead_of_rename.patch
@@ -0,0 +1,22 @@
+diff --git a/lib/discourse.rb b/lib/discourse.rb
+index ea2a3cbafd..66454d9157 100644
+--- a/lib/discourse.rb
++++ b/lib/discourse.rb
+@@ -62,7 +62,7 @@ module Discourse
+         fd.fsync()
+       end
+ 
+-      File.rename(temp_destination, destination)
++      FileUtils.mv(temp_destination, destination)
+ 
+       nil
+     end
+@@ -76,7 +76,7 @@ module Discourse
+       FileUtils.mkdir_p(File.join(Rails.root, 'tmp'))
+       temp_destination = File.join(Rails.root, 'tmp', SecureRandom.hex)
+       execute_command('ln', '-s', source, temp_destination)
+-      File.rename(temp_destination, destination)
++      FileUtils.mv(temp_destination, destination)
+ 
+       nil
+     end