Updating branch refs/heads/master
         to 3a77fb799bdf4cde2312d9a37764b612142d3d27 (commit)
       from fbef29cd07377921e01791d892c60bc26c363c15 (commit)

commit 3a77fb799bdf4cde2312d9a37764b612142d3d27
Author: Brian J. Tarricone <[email protected]>
Date:   Sun Aug 16 04:27:35 2009 +0000

    handle exception from REXML when module.xml file is invalid

 gen-cgit-repos.rb |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gen-cgit-repos.rb b/gen-cgit-repos.rb
index aba0ea1..d9293b7 100755
--- a/gen-cgit-repos.rb
+++ b/gen-cgit-repos.rb
@@ -15,11 +15,15 @@ $cur_repo_group = ''
 def parse_module_xml(modulexml)
   metadata = {}
 
-  xml = REXML::Document.new modulexml
+  begin
+    xml = REXML::Document.new modulexml
+  rescue
+    return { 'desc' => '(module.xml file is not valid)' }
+  end
   return {} unless xml
 
   project = xml.elements['Project']
-  return {} unless project
+  return { 'desc' => '(module.xml file is not valid)' } unless project
 
   project.elements.each do |elem|
     if elem.name == 'name'
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to