[Libreoffice-commits] dev-tools.git: test-bugzilla-files/test-bugzilla-files.py

Gülşah Köse (via logerrit) logerrit at kemper.freedesktop.org
Fri Aug 27 14:37:01 UTC 2021


 test-bugzilla-files/test-bugzilla-files.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 1788875b6a2cbe30b3398dc358a96d8e1bed13f8
Author:     Gülşah Köse <gulsah.kose at collabora.com>
AuthorDate: Fri Aug 27 14:09:01 2021 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Aug 27 16:36:42 2021 +0200

    Check if source file and destination dir exist.
    
    Before creating 'previous' directory, check if
    source file and destination dir exist.
    
    Change-Id: I77f70fff388d704717766799e278d0e7693368e3
    Reviewed-on: https://gerrit.libreoffice.org/c/dev-tools/+/121140
    Tested-by: Miklos Vajna <vmiklos at collabora.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/test-bugzilla-files/test-bugzilla-files.py b/test-bugzilla-files/test-bugzilla-files.py
index 9d712c6..82fba62 100644
--- a/test-bugzilla-files/test-bugzilla-files.py
+++ b/test-bugzilla-files/test-bugzilla-files.py
@@ -401,7 +401,7 @@ def isPreviousExist():
     return False
 
 def saveAsPreviousState(exported_files):
-    odf_file_ext = ['odt', 'ods', 'odp', 'odb']
+    odf_file_ext = ['odt']
     previous_path = "/srv/crashtestdata/previous/srv/crashtestdata/files/odt"
     if os.path.exists(previous_path):
         rmtree("/srv/crashtestdata/previous")
@@ -409,7 +409,8 @@ def saveAsPreviousState(exported_files):
 
     for file in exportedFiles:
         ext = file[-3:]
-        if ext in odf_file_ext:
+        if ext in odf_file_ext and os.path.exists("/srv/crashtestdata/current"+file):
+            os.makedirs(os.path.dirname("/srv/crashtestdata/previous"+file), exist_ok=True)
             copyfile("/srv/crashtestdata/current"+file, "/srv/crashtestdata/previous"+file)
 
 def getODFunDiffCommand():


More information about the Libreoffice-commits mailing list