mirror of
https://git.yoctoproject.org/poky
synced 2026-09-19 09:49:33 +02:00
bitbake: fetch/wget: latest_versionstring create _init_regex method for have one place when regex'es are defined
(Bitbake rev: 6989193a875afd0b1f0f88c95e28cb81bfdb4eaf) 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:
committed by
Richard Purdie
parent
6cecdd1f36
commit
35b7089b34
@@ -273,12 +273,9 @@ class Wget(FetchMethod):
|
|||||||
if valid and version:
|
if valid and version:
|
||||||
return re.sub('_', '.', version[1])
|
return re.sub('_', '.', version[1])
|
||||||
|
|
||||||
def latest_versionstring(self, ud, d):
|
def _init_regexes(self):
|
||||||
"""
|
"""
|
||||||
Manipulate the URL and try to obtain the latest package version
|
Match as many patterns as possible such as:
|
||||||
|
|
||||||
sanity check to ensure same name and type. 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)
|
||||||
gtk+-2.90.1.tar.gz
|
gtk+-2.90.1.tar.gz
|
||||||
xf86-input-synaptics-12.6.9.tar.gz
|
xf86-input-synaptics-12.6.9.tar.gz
|
||||||
@@ -310,10 +307,18 @@ class Wget(FetchMethod):
|
|||||||
# match name, version and archive type of a package
|
# match name, version and archive type of a package
|
||||||
self.name_version_type_regex = re.compile("(?P<name>%s?)\.?v?(?P<ver>%s)(\-source)?[\.\-](?P<type>%s$)" % (self.pn_regex, version_regex, suffixlist))
|
self.name_version_type_regex = re.compile("(?P<name>%s?)\.?v?(?P<ver>%s)(\-source)?[\.\-](?P<type>%s$)" % (self.pn_regex, version_regex, suffixlist))
|
||||||
|
|
||||||
|
def latest_versionstring(self, ud, d):
|
||||||
|
"""
|
||||||
|
Manipulate the URL and try to obtain the latest package version
|
||||||
|
|
||||||
|
sanity check to ensure same name and type.
|
||||||
|
"""
|
||||||
regex_uri = d.getVar("REGEX_URI", True)
|
regex_uri = d.getVar("REGEX_URI", True)
|
||||||
newpath = ud.path
|
newpath = ud.path
|
||||||
pupver = ""
|
pupver = ""
|
||||||
|
|
||||||
|
self._init_regexes()
|
||||||
|
|
||||||
# search for version matches on folders inside the path, like:
|
# search for version matches on folders inside the path, like:
|
||||||
# "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
|
||||||
m = re.search("(?P<dirver>[^/]*(\d+\.)*\d+([\-_]r\d+)*)/", ud.path)
|
m = re.search("(?P<dirver>[^/]*(\d+\.)*\d+([\-_]r\d+)*)/", ud.path)
|
||||||
|
|||||||
Reference in New Issue
Block a user