summaryrefslogtreecommitdiffstats
path: root/meta/classes/metadata_scm.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-22 15:07:34 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-11-24 12:25:36 +0000
commitb62bdbd135d3c2cf02b62d68e46b76a5ccda3331 (patch)
treea96bb0e9021a6d6edb8319e59356f59d3d69a371 /meta/classes/metadata_scm.bbclass
parent6e8a4eff5f7525182bcb05f845dce14a4c88f71b (diff)
downloadpoky-b62bdbd135d3c2cf02b62d68e46b76a5ccda3331.tar.gz
metadata_scm: Avoid crashing on new svn version layouts
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] (From OE-Core rev: e850c53d4d8cb877a704a23f9ce02d6185ba3ffa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/metadata_scm.bbclass')
-rw-r--r--meta/classes/metadata_scm.bbclass4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 8d3988ace8..ba0edf9486 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -54,11 +54,13 @@ def base_get_metadata_monotone_revision(path, d):
54 return monotone_revision 54 return monotone_revision
55 55
56def base_get_metadata_svn_revision(path, d): 56def base_get_metadata_svn_revision(path, d):
57 # This only works with older subversion. For newer versions
58 # this function will need to be fixed by someone interested
57 revision = "<unknown>" 59 revision = "<unknown>"
58 try: 60 try:
59 with open("%s/.svn/entries" % path) as f: 61 with open("%s/.svn/entries" % path) as f:
60 revision = f.readlines()[3].strip() 62 revision = f.readlines()[3].strip()
61 except IOError: 63 except IOError, IndexError:
62 pass 64 pass
63 return revision 65 return revision
64 66