[gtk-doc] common: delete the new file if files are the same



commit b9e1cacfea553c9e9b9ffd202e032467181d6d40
Author: Stefan Sauer <ensonic users sf net>
Date:   Mon May 15 22:30:28 2017 +0200

    common: delete the new file if files are the same
    
    When the new file has no changes, keep the old one.

 gtkdoc/common.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gtkdoc/common.py b/gtkdoc/common.py
index a7b1f61..bb441b8 100644
--- a/gtkdoc/common.py
+++ b/gtkdoc/common.py
@@ -69,6 +69,7 @@ def UpdateFileIfChanged(old_file, new_file, make_backup):
         old_contents = open(old_file, 'rb').read()
         new_contents = open(new_file, 'rb').read()
         if old_contents == new_contents:
+            os.unlink(new_file)
             return False
 
         if make_backup:


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