[elbe-devel] [PATCH 3/7] elbepack: efilesystem: correctly undo excursions with custom destination

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Dec 17 13:24:26 CET 2024


If the destination has been modified, make sure to use that path to
tests for modifications and the later cleanup actions.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/efilesystem.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index 32dc19fa0494937f60f6654eb9565459e65bb5d9..305a9d2d6f96b3725a003efa613bda883d802856 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -285,13 +285,13 @@ class Excursion:
     def _undo_excursion(self, rfs):
         saved_to = self._saved_to()
 
-        if not _file_or_directory_seem_equal(rfs.fname(self.origin), self.origin):
+        if not _file_or_directory_seem_equal(rfs.fname(self.dst), self.origin):
             # Excursed file was modified, keep the changes.
             return
 
-        self._del_rfs_file(self.origin, rfs)
+        self._del_rfs_file(self.dst, rfs)
         if self.restore is True and rfs.lexists(saved_to):
-            shutil.move(rfs.fname(saved_to), rfs.fname(self.origin))
+            shutil.move(rfs.fname(saved_to), rfs.fname(self.dst))
 
 
 class ChRootFilesystem(ElbeFilesystem):

-- 
2.47.1



More information about the elbe-devel mailing list