]> code.ossystems Code Review - openembedded-core.git/commitdiff
metadata_scm: Avoid crashing on new svn version layouts
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Nov 2013 15:07:34 +0000 (15:07 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 22 Nov 2013 15:12:33 +0000 (15:12 +0000)
This avoids crashing on newer svn layouts where the entries files
don't contain three lines. If someone wants to fix this to
get the right version on newer subversion checkouts, patches
welcome but this at least stops things crashing.

[YOCTO #5363]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/metadata_scm.bbclass

index 8d3988ace8e8a5679f29011e6d941c16b398ead1..ba0edf9486deda033845307e377631bad7a4ac23 100644 (file)
@@ -54,11 +54,13 @@ def base_get_metadata_monotone_revision(path, d):
     return monotone_revision
 
 def base_get_metadata_svn_revision(path, d):
+    # This only works with older subversion. For newer versions 
+    # this function will need to be fixed by someone interested
     revision = "<unknown>"
     try:
         with open("%s/.svn/entries" % path) as f:
             revision = f.readlines()[3].strip()
-    except IOError:
+    except IOError, IndexError:
         pass
     return revision