[gimp/wip/Jehan/incremental-win-installer-improvements: 6/6] build: test.




commit a4be3be34002e12ca44d6420a72123197a83d8f9
Author: Jehan <jehan girinstud io>
Date:   Mon Jun 28 15:07:47 2021 +0200

    build: test.

 build/windows/gitlab-ci/dll_link.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
---
diff --git a/build/windows/gitlab-ci/dll_link.py b/build/windows/gitlab-ci/dll_link.py
index 61528e7ed9..c3e02bb811 100755
--- a/build/windows/gitlab-ci/dll_link.py
+++ b/build/windows/gitlab-ci/dll_link.py
@@ -14,6 +14,7 @@
 # Windows environnment should be passed, here /winenv/.
 
 import argparse
+import filecmp
 import os
 import subprocess
 import re
@@ -35,6 +36,8 @@ bindir = 'bin'
 
 # Main function
 def main(binary, srcdir, destdir, debug):
+  sys.stdout.write("{} (INFO): searching for dependencies of {} in {}",
+                   os.path.basename(__file__), binary)
   find_dependencies(binary, srcdir)
   if args.debug:
     print("Running in debug mode (no DLL moved)")
@@ -105,7 +108,21 @@ def copy_dlls(dll_list, srcdir, destdir):
   for dll in dll_list:
     full_file_name = os.path.join(srcdir, bindir, dll)
     if os.path.isfile(full_file_name):
+      sys.stdout.write("{} (INFO): copying {} to {}",
+                       os.path.basename(__file__), full_file_name,
+                       destbin)
+      dest_existed = False
+      if os.path.exists(os.path.join(destbin, dll)):
+        sys.stderr.write("WAAAAA: {} exists!", os.path.join(destbin, dll))
+        dest_existed = True
       shutil.copy(full_file_name, destbin)
+      if dest_existed:
+        if filecmp.cmp(full_file_name, os.path.join(destbin, dll), shallow=False):
+          sys.stderr.write("YEAH {} and {} are equal!",
+                           full_file_name, os.path.join(destbin, dll))
+        else:
+          sys.stderr.write("OUPS {} and {} are different!",
+                           full_file_name, os.path.join(destbin, dll))
     else:
       sys.stderr.write("Missing DLL: {}\n".format(full_file_name))
       sys.exit(os.EX_DATAERR)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]