summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/svn.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/fetch2/svn.py')
-rw-r--r--bitbake/lib/bb/fetch2/svn.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index 9a779d2448..123aa136eb 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -27,6 +27,7 @@ import os
27import sys 27import sys
28import logging 28import logging
29import bb 29import bb
30import re
30from bb import data 31from bb import data
31from bb.fetch2 import FetchMethod 32from bb.fetch2 import FetchMethod
32from bb.fetch2 import FetchError 33from bb.fetch2 import FetchError
@@ -91,6 +92,8 @@ class Svn(FetchMethod):
91 92
92 if command == "info": 93 if command == "info":
93 svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module) 94 svncmd = "%s info %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
95 elif command == "log1":
96 svncmd = "%s log --limit 1 %s %s://%s/%s/" % (ud.basecmd, " ".join(options), proto, svnroot, ud.module)
94 else: 97 else:
95 suffix = "" 98 suffix = ""
96 if ud.revision: 99 if ud.revision:
@@ -167,14 +170,13 @@ class Svn(FetchMethod):
167 """ 170 """
168 Return the latest upstream revision number 171 Return the latest upstream revision number
169 """ 172 """
170 bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "info")) 173 bb.fetch2.check_network_access(d, self._buildsvncommand(ud, d, "log1"))
171 174
172 output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "info"), d, True) 175 output = runfetchcmd("LANG=C LC_ALL=C " + self._buildsvncommand(ud, d, "log1"), d, True)
173 176
174 revision = None 177 # skip the first line, as per output of svn log
175 for line in output.splitlines(): 178 # then we expect the revision on the 2nd line
176 if "Last Changed Rev" in line: 179 revision = re.search('^r([0-9]*)', output.splitlines()[1]).group(1)
177 revision = line.split(":")[1].strip()
178 180
179 return revision 181 return revision
180 182