jhbuild r2705 - in trunk: . jhbuild/modtypes



Author: fpeters
Date: Thu Feb  5 17:24:13 2009
New Revision: 2705
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2705&view=rev

Log:
* jhbuild/modtypes/tarball.py: warn about invalid file sizes, instead
of aborting with a Python trace.


Modified:
   trunk/ChangeLog
   trunk/jhbuild/modtypes/tarball.py

Modified: trunk/jhbuild/modtypes/tarball.py
==============================================================================
--- trunk/jhbuild/modtypes/tarball.py	(original)
+++ trunk/jhbuild/modtypes/tarball.py	Thu Feb  5 17:24:13 2009
@@ -19,6 +19,8 @@
 
 __metaclass__ = type
 
+import sys
+
 from jhbuild.modtypes import register_module_type, get_dependencies
 
 def parse_tarball(node, config, uri, repositories, default_repo):
@@ -53,7 +55,12 @@
         if childnode.nodeName == 'source':
             source_url = childnode.getAttribute('href')
             if childnode.hasAttribute('size'):
-                source_size = int(childnode.getAttribute('size'))
+                try:
+                    source_size = int(childnode.getAttribute('size'))
+                except ValueError:
+                    print >> sys.stderr, uencode(
+                            _('W: module \'%s\' has invalid size attribute (\'%s\')') % (
+                                name, childnode.getAttribute('size')))
             if childnode.hasAttribute('md5sum'):
                 source_md5 = childnode.getAttribute('md5sum')
         elif childnode.nodeName == 'patches':



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