diff options
| author | Richard Purdie <richard@openedhand.com> | 2008-04-27 11:22:54 +0000 |
|---|---|---|
| committer | Richard Purdie <richard@openedhand.com> | 2008-04-27 11:22:54 +0000 |
| commit | 748039c0e195da2ab3de76ab818a88352921b170 (patch) | |
| tree | c71a94c4f88b9265d0b3c060bd786e671b29259c /bitbake/lib/bb/fetch/wget.py | |
| parent | 192e4fb821f7158fdeeee129f8c3d8f27dd2ea1a (diff) | |
| download | poky-748039c0e195da2ab3de76ab818a88352921b170.tar.gz | |
bitbake: Sync with bitbake 1.8 branch
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@4352 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'bitbake/lib/bb/fetch/wget.py')
| -rw-r--r-- | bitbake/lib/bb/fetch/wget.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch/wget.py b/bitbake/lib/bb/fetch/wget.py index f8ade45da7..a5979dead8 100644 --- a/bitbake/lib/bb/fetch/wget.py +++ b/bitbake/lib/bb/fetch/wget.py | |||
| @@ -48,11 +48,13 @@ class Wget(Fetch): | |||
| 48 | 48 | ||
| 49 | return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile) | 49 | return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile) |
| 50 | 50 | ||
| 51 | def go(self, uri, ud, d): | 51 | def go(self, uri, ud, d, checkonly = False): |
| 52 | """Fetch urls""" | 52 | """Fetch urls""" |
| 53 | 53 | ||
| 54 | def fetch_uri(uri, ud, d): | 54 | def fetch_uri(uri, ud, d): |
| 55 | if os.path.exists(ud.localpath): | 55 | if checkonly: |
| 56 | fetchcmd = data.getVar("FETCHCOMMAND", d, 1) + " " + data.getVar("FETCHOPTION_checkonly", d, 1) | ||
| 57 | elif os.path.exists(ud.localpath): | ||
| 56 | # file exists, but we didnt complete it.. trying again.. | 58 | # file exists, but we didnt complete it.. trying again.. |
| 57 | fetchcmd = data.getVar("RESUMECOMMAND", d, 1) | 59 | fetchcmd = data.getVar("RESUMECOMMAND", d, 1) |
| 58 | else: | 60 | else: |
| @@ -83,10 +85,10 @@ class Wget(Fetch): | |||
| 83 | newuri = uri_replace(uri, find, replace, d) | 85 | newuri = uri_replace(uri, find, replace, d) |
| 84 | if newuri != uri: | 86 | if newuri != uri: |
| 85 | if fetch_uri(newuri, ud, localdata): | 87 | if fetch_uri(newuri, ud, localdata): |
| 86 | return | 88 | return True |
| 87 | 89 | ||
| 88 | if fetch_uri(uri, ud, localdata): | 90 | if fetch_uri(uri, ud, localdata): |
| 89 | return | 91 | return True |
| 90 | 92 | ||
| 91 | # try mirrors | 93 | # try mirrors |
| 92 | mirrors = [ i.split() for i in (data.getVar('MIRRORS', localdata, 1) or "").split('\n') if i ] | 94 | mirrors = [ i.split() for i in (data.getVar('MIRRORS', localdata, 1) or "").split('\n') if i ] |
| @@ -94,6 +96,10 @@ class Wget(Fetch): | |||
| 94 | newuri = uri_replace(uri, find, replace, d) | 96 | newuri = uri_replace(uri, find, replace, d) |
| 95 | if newuri != uri: | 97 | if newuri != uri: |
| 96 | if fetch_uri(newuri, ud, localdata): | 98 | if fetch_uri(newuri, ud, localdata): |
| 97 | return | 99 | return True |
| 98 | 100 | ||
| 99 | raise FetchError(uri) | 101 | raise FetchError(uri) |
| 102 | |||
| 103 | |||
| 104 | def checkstatus(self, uri, ud, d): | ||
| 105 | return self.go(uri, ud, d, True) | ||
