[WINESYNC] Fail gracefully when unable to delete a file 4392/head
authorMark Jansen <mark.jansen@reactos.org>
Sun, 13 Mar 2022 23:03:40 +0000 (00:03 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Fri, 8 Apr 2022 23:26:30 +0000 (01:26 +0200)
sdk/tools/winesync/winesync.py

index 44fbf1e..8547ee9 100644 (file)
@@ -186,7 +186,10 @@ class wine_sync:
                     warning_message += 'Error while applying patch to ' + new_reactos_path + '\n'
 
                 if delta.status == pygit2.GIT_DELTA_DELETED:
-                    self.reactos_index.remove(old_reactos_path)
+                    try:
+                        self.reactos_index.remove(old_reactos_path)
+                    except IOError as err:
+                        warning_message += 'Error while removing file ' + old_reactos_path + '\n'
                 # here we check if the file exists. We don't complain, because applying the patch already failed anyway
                 elif os.path.isfile(os.path.join(self.reactos_src, new_reactos_path)):
                     self.reactos_index.add(new_reactos_path)