[mojosetup] [12/13] Make sure obsolete files still exist before deleting them.

Francois Gouget fgouget at codeweavers.com
Mon May 21 14:41:28 EDT 2012


---
 scripts/mojosetup_mainline.lua |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/mojosetup_mainline.lua b/scripts/mojosetup_mainline.lua
index a162d56..21585d1 100644
--- a/scripts/mojosetup_mainline.lua
+++ b/scripts/mojosetup_mainline.lua
@@ -1862,8 +1862,11 @@ local function do_install(install)
         --  succeeds, and restore them if it fails.
         for path,file in pairs(MojoSetup.oldfiles) do
             if file.seen == nil and file.type == 'file' then
-                MojoSetup.loginfo("Obsoleting file '" .. path .. "'")
-                backup_file(MojoSetup.destination .. "/" .. path)
+                local fullpath = MojoSetup.destination .. "/" .. path
+                if MojoSetup.platform.exists(fullpath) then
+                    MojoSetup.loginfo("Obsoleting file '" .. path .. "'")
+                    backup_file(fullpath)
+                end
             end
         end
 
-- 
1.7.10


More information about the mojosetup mailing list