mirror of
https://git.yoctoproject.org/poky
synced 2026-02-20 08:29:42 +01:00
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 master rev: e850c53d4d8cb877a704a23f9ce02d6185ba3ffa) (From OE-Core rev: 9fdea109d65c338913caa22e3a09f0408c361536) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -52,10 +52,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:
|
||||
revision = file( "%s/.svn/entries" % path ).readlines()[3].strip()
|
||||
except IOError:
|
||||
with open("%s/.svn/entries" % path) as f:
|
||||
revision = f.readlines()[3].strip()
|
||||
except IOError, IndexError:
|
||||
pass
|
||||
return revision
|
||||
|
||||
|
||||
Reference in New Issue
Block a user