[gtk-doc] scan: remove types file if empty



commit e1aafbfcab57af90b4fe8fb548c65bd1168e0d92
Author: Stefan Kost <ensonic users sf net>
Date:   Sun Jan 3 15:23:13 2010 +0200

    scan: remove types file if empty

 gtkdoc-scan.in               |    7 ++++++-
 tests/bugs/docs/tester.types |    2 --
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/gtkdoc-scan.in b/gtkdoc-scan.in
index 2db8a0e..ece8d99 100755
--- a/gtkdoc-scan.in
+++ b/gtkdoc-scan.in
@@ -167,11 +167,16 @@ if ($REBUILD_TYPES) {
        print TYPES "$func\n"; 
     }
     close (TYPES);
+    &UpdateFileIfChanged ($old_types, $new_types, 1);
+    
+    # remove the file if empty
+    if (scalar (@get_types) == 0) {
+        unlink ("$new_types");
+    }
 }
 
 &UpdateFileIfChanged ($old_decl_list, $new_decl_list, 1);
 &UpdateFileIfChanged ($old_decl, $new_decl, 1);
-&UpdateFileIfChanged ($old_types, $new_types, 1) if ($REBUILD_TYPES);
 
 # If there is no MODULE-sections.txt file yet or we are asked to rebuild it,
 # we copy the MODULE-decl-list.txt file into its place. The user can tweak it



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