[gtk-doc] scan: copy the decl-list to sctions



commit 5ad97e79c5d06a007b41b6e5e61050e32edb6b85
Author: Stefan Sauer <ensonic users sf net>
Date:   Wed Aug 9 11:03:44 2017 +0200

    scan: copy the decl-list to sctions
    
    In the perl version we copied the file. This was changed when poting to python.
    Now we copy again and only update the section file if it changed.

 gtkdoc/scan.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index 5f05c71..22a697b 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -39,6 +39,7 @@ from six import iteritems, iterkeys
 import logging
 import os
 import re
+import shutil
 
 from . import common
 
@@ -104,7 +105,9 @@ def Run(options):
     # we copy the MODULE-decl-list.txt file into its place. The user can tweak it
     # later if they want.
     if options.rebuild_sections or not os.path.exists(sections_file):
-        common.UpdateFileIfChanged(sections_file, old_decl_list, False)
+        new_sections_file = base_filename + '-sections.new'
+        shutil.copyfile(old_decl_list, new_sections_file)
+        common.UpdateFileIfChanged(sections_file, new_sections_file, False)
 
     # If there is no MODULE-overrides.txt file we create an empty one
     # because EXTRA_DIST in gtk-doc.make requires it.


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