diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2014-11-27 19:12:04 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-28 13:57:12 +0000 |
commit | a69d5d48c4bf9a3df3121cc4e69ba5d7e947ad8d (patch) | |
tree | d9d483a865efb71ecb6cd65712f29d97c4acf914 /lib | |
parent | afc33ec7cdb7d8ee3602a23fa973551ca5510ac4 (diff) | |
download | bitbake-a69d5d48c4bf9a3df3121cc4e69ba5d7e947ad8d.tar.gz |
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.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/fetch2/wget.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py index 85485bfa2..1a585a574 100644 --- a/lib/bb/fetch2/wget.py +++ b/lib/bb/fetch2/wget.py @@ -233,7 +233,7 @@ class Wget(FetchMethod): If error or no version, return "" """ 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)) soup = BeautifulSoup(self._fetch_index(url, ud, d)) @@ -258,7 +258,7 @@ class Wget(FetchMethod): else: continue else: - newver = self._parse_path(self.package_regex_comp, line['href']) + newver = self._parse_path(self.package_custom_regex_comp, line['href']) valid = 1 if newver and self._vercmp(version, newver) == True: version = newver @@ -275,7 +275,7 @@ class Wget(FetchMethod): return None - def _init_regexes(self): + def _init_regexes(self, package): """ Match as many patterns as possible such as: 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 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): """ Manipulate the URL and try to obtain the latest package version @@ -328,7 +335,7 @@ class Wget(FetchMethod): newpath = regex_uri or ud.path pupver = "" - self._init_regexes() + self._init_regexes(package) if not regex_uri: # generate the new uri with the appropriate latest directory |