1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-31 12:49:46 +00:00

bitbake: fetch/wget: latest_versionstring add package_custom_regex_comp

package_custom_regex_comp is built with the current package name and
then used to search upstream version this reduces custom regex'es in
sites that have different packages in the same directory.

(Bitbake rev: a69d5d48c4bf9a3df3121cc4e69ba5d7e947ad8d)

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Aníbal Limón
2014-11-27 19:12:04 -06:00
committed by Richard Purdie
parent cd40af6b1d
commit af47f14c71
+11 -4
View File
@@ -233,7 +233,7 @@ class Wget(FetchMethod):
If error or no version, return "" If error or no version, return ""
""" """
valid = 0 valid = 0
version = self._parse_path(self.package_regex_comp, package) version = self._parse_path(self.package_custom_regex_comp, package)
bb.debug(3, "VersionURL: %s" % (url)) bb.debug(3, "VersionURL: %s" % (url))
soup = BeautifulSoup(self._fetch_index(url, ud, d)) soup = BeautifulSoup(self._fetch_index(url, ud, d))
@@ -258,7 +258,7 @@ class Wget(FetchMethod):
else: else:
continue continue
else: else:
newver = self._parse_path(self.package_regex_comp, line['href']) newver = self._parse_path(self.package_custom_regex_comp, line['href'])
valid = 1 valid = 1
if newver and self._vercmp(version, newver) == True: if newver and self._vercmp(version, newver) == True:
version = newver version = newver
@@ -275,7 +275,7 @@ class Wget(FetchMethod):
return None return None
def _init_regexes(self): def _init_regexes(self, package):
""" """
Match as many patterns as possible such as: Match as many patterns as possible such as:
gnome-common-2.20.0.tar.gz (most common format) gnome-common-2.20.0.tar.gz (most common format)
@@ -317,6 +317,13 @@ class Wget(FetchMethod):
# "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz
self.dirver_regex_comp = re.compile("(?P<dirver>[^/]*(\d+\.)*\d+([\-_]r\d+)*)/") self.dirver_regex_comp = re.compile("(?P<dirver>[^/]*(\d+\.)*\d+([\-_]r\d+)*)/")
# get current version and make custom regex for search in uri's
version = self._parse_path(self.package_regex_comp, package)
if version:
self.package_custom_regex_comp = re.compile(
"(?P<name>%s)(?P<ver>%s)(?P<arch>%s)?[\.\-](?P<type>%s)$" %
(version[0], pver_regex, parch_regex, psuffix_regex))
def latest_versionstring(self, ud, d): def latest_versionstring(self, ud, d):
""" """
Manipulate the URL and try to obtain the latest package version Manipulate the URL and try to obtain the latest package version
@@ -328,7 +335,7 @@ class Wget(FetchMethod):
newpath = regex_uri or ud.path newpath = regex_uri or ud.path
pupver = "" pupver = ""
self._init_regexes() self._init_regexes(package)
if not regex_uri: if not regex_uri:
# generate the new uri with the appropriate latest directory # generate the new uri with the appropriate latest directory