aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-07-14 19:30:58 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-07-22 08:04:34 +0100
commit8d454646cbe1b04758ca178d8c6fcfd02b818b7b (patch)
tree893203983a04dd19609bd41bab66a246de65add4
parentfd175dc90024c503134c11cbd83e77d88c406ac8 (diff)
downloadbitbake-8d454646cbe1b04758ca178d8c6fcfd02b818b7b.tar.gz
fetch2/wget.py: latest_versionstring now returns (version, revision)
Now latest_versionstring method returns (version, revision) for comply the new return convention needed by SCM's like git get the current revision. bb/tests/fetch.py: Updated wget latest_versionstring test for comply new convention. [YOCTO #7605] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/wget.py12
-rw-r--r--lib/bb/tests/fetch.py3
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index 545f02dcf..425b6b9a2 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -507,12 +507,12 @@ class Wget(FetchMethod):
if not re.search("\d+", package):
current_version[1] = re.sub('_', '.', current_version[1])
current_version[1] = re.sub('-', '.', current_version[1])
- return current_version[1]
+ return (current_version[1], '')
package_regex = self._init_regexes(package, ud, d)
if package_regex is None:
bb.warn("latest_versionstring: package %s don't match pattern" % (package))
- return ""
+ return ('', '')
bb.debug(3, "latest_versionstring, regex: %s" % (package_regex.pattern))
uri = ""
@@ -530,12 +530,12 @@ class Wget(FetchMethod):
dirver_pn_regex = re.compile("%s\d?" % (re.escape(pn)))
if not dirver_pn_regex.search(dirver):
- return self._check_latest_version_by_dir(dirver,
- package, package_regex, current_version, ud, d)
+ return (self._check_latest_version_by_dir(dirver,
+ package, package_regex, current_version, ud, d), '')
uri = bb.fetch.encodeurl([ud.type, ud.host, path, ud.user, ud.pswd, {}])
else:
uri = regex_uri
- return self._check_latest_version(uri, package, package_regex,
- current_version, ud, d)
+ return (self._check_latest_version(uri, package, package_regex,
+ current_version, ud, d), '')
diff --git a/lib/bb/tests/fetch.py b/lib/bb/tests/fetch.py
index 8dd8ddb07..bfa31d02a 100644
--- a/lib/bb/tests/fetch.py
+++ b/lib/bb/tests/fetch.py
@@ -708,7 +708,8 @@ class FetchMethodTest(FetcherTest):
self.d.setVar("REGEX_URI", k[2])
self.d.setVar("REGEX", k[3])
ud = bb.fetch2.FetchData(k[1], self.d)
- verstring = ud.method.latest_versionstring(ud, self.d)
+ pupver = ud.method.latest_versionstring(ud, self.d)
+ verstring = pupver[0]
r = bb.utils.vercmp_string(v, verstring)
self.assertTrue(r == -1 or r == 0, msg="Package %s, version: %s <= %s" % (k[0], v, verstring))