[glibmm] Do not complain about missing docs_override.xml



commit c5383f584cc2e52cdda95a65e40f3ab62ccdc8d0
Author: Daniel Elstner <danielk openismus com>
Date:   Wed Sep 16 15:26:10 2009 +0200

    Do not complain about missing docs_override.xml
    
    * tools/pm/DocsParser.pm (read_defs): Print error messages to
    standard error.  Do not complain if the docs_override.xml file
    is missing, since it is no longer necessary.

 ChangeLog              |    8 ++++++++
 tools/pm/DocsParser.pm |   17 ++++++++---------
 2 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d781985..be2f187 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-17  Daniel Elstner  <danielk openismus com>
+
+	Do not complain about missing docs_override.xml
+
+	* tools/pm/DocsParser.pm (read_defs): Print error messages to
+	standard error.  Do not complain if the docs_override.xml file
+	is missing, since it is no longer necessary.
+
 2009-09-13  Daniel Elstner  <daniel kitta gmail com>
 
 	Enable verbose output of autoreconf
diff --git a/tools/pm/DocsParser.pm b/tools/pm/DocsParser.pm
index fed5d49..430cacb 100644
--- a/tools/pm/DocsParser.pm
+++ b/tools/pm/DocsParser.pm
@@ -78,7 +78,7 @@ sub read_defs($$$)
   $DocsParser::CurrentFile = "$path/$filename";
   if ( ! -r $DocsParser::CurrentFile)
   {
-     print "DocsParser.pm: Warning: Can't read file \"" . $DocsParser::CurrentFile . "\".\n";
+     print STDERR "DocsParser.pm: Warning: Can't read file \"" . $DocsParser::CurrentFile . "\".\n";
      return;
   }
   # Parse
@@ -86,23 +86,22 @@ sub read_defs($$$)
   if( $@ )
   {
     $@ =~ s/at \/.*?$//s;
-    print "\nError in \"" . $DocsParser::CurrentFile . "\":$ \n";
+    print STDERR "\nError in \"" . $DocsParser::CurrentFile . "\":$ \n";
     return;
   }
 
   # C++ overide documentation:
-  $DocsParser::CurrentFile = "$path/$filename_override";
-  if ( ! -r $DocsParser::CurrentFile)
-  {
-     print "DocsParser.pm: Warning: Can't read file \"" . $DocsParser::CurrentFile . "\".\n";
-     return;
-  }
+  $DocsParser::CurrentFile = $path . '/' . $filename_override;
+
+  # It is not an error if the documentation override file does not exist.
+  return unless (-r $DocsParser::CurrentFile);
+
   # Parse
   eval { $objParser->parsefile($DocsParser::CurrentFile) };
   if( $@ )
   {
     $@ =~ s/at \/.*?$//s;
-    print "\nError in \"" . $DocsParser::CurrentFile . "\":$@";
+    print STDERR "\nError in \"" . $DocsParser::CurrentFile . "\":$@";
     return;
   }
 }



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