diff options
| -rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index db5f27b6f1..687d494fd5 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
| @@ -273,12 +273,9 @@ class Wget(FetchMethod): | |||
| 273 | if valid and version: | 273 | if valid and version: |
| 274 | return re.sub('_', '.', version[1]) | 274 | return re.sub('_', '.', version[1]) |
| 275 | 275 | ||
| 276 | def latest_versionstring(self, ud, d): | 276 | def _init_regexes(self): |
| 277 | """ | 277 | """ |
| 278 | Manipulate the URL and try to obtain the latest package version | 278 | Match as many patterns as possible such as: |
| 279 | |||
| 280 | sanity check to ensure same name and type. Match as many patterns as possible | ||
| 281 | such as: | ||
| 282 | gnome-common-2.20.0.tar.gz (most common format) | 279 | gnome-common-2.20.0.tar.gz (most common format) |
| 283 | gtk+-2.90.1.tar.gz | 280 | gtk+-2.90.1.tar.gz |
| 284 | xf86-input-synaptics-12.6.9.tar.gz | 281 | xf86-input-synaptics-12.6.9.tar.gz |
| @@ -310,10 +307,18 @@ class Wget(FetchMethod): | |||
| 310 | # match name, version and archive type of a package | 307 | # match name, version and archive type of a package |
| 311 | self.name_version_type_regex = re.compile("(?P<name>%s?)\.?v?(?P<ver>%s)(\-source)?[\.\-](?P<type>%s$)" % (self.pn_regex, version_regex, suffixlist)) | 308 | self.name_version_type_regex = re.compile("(?P<name>%s?)\.?v?(?P<ver>%s)(\-source)?[\.\-](?P<type>%s$)" % (self.pn_regex, version_regex, suffixlist)) |
| 312 | 309 | ||
| 310 | def latest_versionstring(self, ud, d): | ||
| 311 | """ | ||
| 312 | Manipulate the URL and try to obtain the latest package version | ||
| 313 | |||
| 314 | sanity check to ensure same name and type. | ||
| 315 | """ | ||
| 313 | regex_uri = d.getVar("REGEX_URI", True) | 316 | regex_uri = d.getVar("REGEX_URI", True) |
| 314 | newpath = ud.path | 317 | newpath = ud.path |
| 315 | pupver = "" | 318 | pupver = "" |
| 316 | 319 | ||
| 320 | self._init_regexes() | ||
| 321 | |||
| 317 | # search for version matches on folders inside the path, like: | 322 | # search for version matches on folders inside the path, like: |
| 318 | # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz | 323 | # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz |
| 319 | m = re.search("(?P<dirver>[^/]*(\d+\.)*\d+([\-_]r\d+)*)/", ud.path) | 324 | m = re.search("(?P<dirver>[^/]*(\d+\.)*\d+([\-_]r\d+)*)/", ud.path) |
