summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-03 21:20:39 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-07 09:06:35 +0000
commit5a52cb80d6d62c704692ad6cfa93426c4a17bc52 (patch)
tree94de3110a7575c5f10a89466ca0810e19021a227
parent972eb5fababb33b5537fcfbbaf8e33ea820f0fee (diff)
downloadpoky-5a52cb80d6d62c704692ad6cfa93426c4a17bc52.tar.gz
bitbake/fetch2: Define a sane localpath function and remove code duplication
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py3
-rw-r--r--bitbake/lib/bb/fetch2/bzr.py3
-rw-r--r--bitbake/lib/bb/fetch2/cvs.py3
-rw-r--r--bitbake/lib/bb/fetch2/git.py3
-rw-r--r--bitbake/lib/bb/fetch2/hg.py3
-rw-r--r--bitbake/lib/bb/fetch2/osc.py3
-rw-r--r--bitbake/lib/bb/fetch2/perforce.py3
-rw-r--r--bitbake/lib/bb/fetch2/repo.py3
-rw-r--r--bitbake/lib/bb/fetch2/svk.py3
-rw-r--r--bitbake/lib/bb/fetch2/svn.py3
-rw-r--r--bitbake/lib/bb/fetch2/wget.py3
11 files changed, 2 insertions, 31 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index c807601974..e8eaebe9dc 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -621,7 +621,8 @@ class Fetch(object):
621 Can also setup variables in urldata for use in go (saving code duplication 621 Can also setup variables in urldata for use in go (saving code duplication
622 and duplicate code execution) 622 and duplicate code execution)
623 """ 623 """
624 return url 624 return os.path.join(data.getVar("DL_DIR", d, True), urldata.localfile)
625
625 def _strip_leading_slashes(self, relpath): 626 def _strip_leading_slashes(self, relpath):
626 """ 627 """
627 Remove leading slash as os.path.join can't cope 628 Remove leading slash as os.path.join can't cope
diff --git a/bitbake/lib/bb/fetch2/bzr.py b/bitbake/lib/bb/fetch2/bzr.py
index cc00357904..1e25207b19 100644
--- a/bitbake/lib/bb/fetch2/bzr.py
+++ b/bitbake/lib/bb/fetch2/bzr.py
@@ -47,9 +47,6 @@ class Bzr(Fetch):
47 47
48 ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d) 48 ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
49 49
50 def localpath (self, url, ud, d):
51 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
52
53 def _buildbzrcommand(self, ud, d, command): 50 def _buildbzrcommand(self, ud, d, command):
54 """ 51 """
55 Build up an bzr commandline based on ud 52 Build up an bzr commandline based on ud
diff --git a/bitbake/lib/bb/fetch2/cvs.py b/bitbake/lib/bb/fetch2/cvs.py
index 6a7cdf2a89..907812d717 100644
--- a/bitbake/lib/bb/fetch2/cvs.py
+++ b/bitbake/lib/bb/fetch2/cvs.py
@@ -65,9 +65,6 @@ class Cvs(Fetch):
65 65
66 ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d) 66 ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
67 67
68 def localpath(self, url, ud, d):
69 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
70
71 def forcefetch(self, url, ud, d): 68 def forcefetch(self, url, ud, d):
72 if (ud.date == "now"): 69 if (ud.date == "now"):
73 return True 70 return True
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index f38058bbcc..392491ed87 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -77,9 +77,6 @@ class Git(Fetch):
77 77
78 ud.localfile = ud.mirrortarball 78 ud.localfile = ud.mirrortarball
79 79
80 def localpath(self, url, ud, d):
81 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
82
83 def forcefetch(self, url, ud, d): 80 def forcefetch(self, url, ud, d):
84 for name in ud.names: 81 for name in ud.names:
85 if not self._contains_ref(ud.revisions[name], d): 82 if not self._contains_ref(ud.revisions[name], d):
diff --git a/bitbake/lib/bb/fetch2/hg.py b/bitbake/lib/bb/fetch2/hg.py
index 53eeea9a89..6929d971f5 100644
--- a/bitbake/lib/bb/fetch2/hg.py
+++ b/bitbake/lib/bb/fetch2/hg.py
@@ -68,9 +68,6 @@ class Hg(Fetch):
68 revTag = ud.parm.get('rev', 'tip') 68 revTag = ud.parm.get('rev', 'tip')
69 return revTag == "tip" 69 return revTag == "tip"
70 70
71 def localpath(self, url, ud, d):
72 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
73
74 def _buildhgcommand(self, ud, d, command): 71 def _buildhgcommand(self, ud, d, command):
75 """ 72 """
76 Build up an hg commandline based on ud 73 Build up an hg commandline based on ud
diff --git a/bitbake/lib/bb/fetch2/osc.py b/bitbake/lib/bb/fetch2/osc.py
index 93deb458e8..14bde82fd7 100644
--- a/bitbake/lib/bb/fetch2/osc.py
+++ b/bitbake/lib/bb/fetch2/osc.py
@@ -49,9 +49,6 @@ class Osc(Fetch):
49 49
50 ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d) 50 ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
51 51
52 def localpath(self, url, ud, d):
53 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
54
55 def _buildosccommand(self, ud, d, command): 52 def _buildosccommand(self, ud, d, command):
56 """ 53 """
57 Build up an ocs commandline based on ud 54 Build up an ocs commandline based on ud
diff --git a/bitbake/lib/bb/fetch2/perforce.py b/bitbake/lib/bb/fetch2/perforce.py
index aefc207840..5c128b3fde 100644
--- a/bitbake/lib/bb/fetch2/perforce.py
+++ b/bitbake/lib/bb/fetch2/perforce.py
@@ -118,9 +118,6 @@ class Perforce(Fetch):
118 118
119 ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d) 119 ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
120 120
121 def localpath(self, url, ud, d):
122 return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
123
124 def download(self, loc, ud, d): 121 def download(self, loc, ud, d):
125 """ 122 """
126 Fetch urls 123 Fetch urls
diff --git a/bitbake/lib/bb/fetch2/repo.py b/bitbake/lib/bb/fetch2/repo.py
index f742591fdb..9d890a5e94 100644
--- a/bitbake/lib/bb/fetch2/repo.py
+++ b/bitbake/lib/bb/fetch2/repo.py
@@ -53,9 +53,6 @@ class Repo(Fetch):
53 53
54 ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d) 54 ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
55 55
56 def localpath(self, url, ud, d):
57 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
58
59 def download(self, loc, ud, d): 56 def download(self, loc, ud, d):
60 """Fetch url""" 57 """Fetch url"""
61 58
diff --git a/bitbake/lib/bb/fetch2/svk.py b/bitbake/lib/bb/fetch2/svk.py
index ef1cf4deb1..95206f52fb 100644
--- a/bitbake/lib/bb/fetch2/svk.py
+++ b/bitbake/lib/bb/fetch2/svk.py
@@ -53,9 +53,6 @@ class Svk(Fetch):
53 53
54 ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d) 54 ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
55 55
56 def localpath(self, url, ud, d):
57 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
58
59 def forcefetch(self, url, ud, d): 56 def forcefetch(self, url, ud, d):
60 return ud.date == "now" 57 return ud.date == "now"
61 58
diff --git a/bitbake/lib/bb/fetch2/svn.py b/bitbake/lib/bb/fetch2/svn.py
index ded7cd0057..5ff064ebf3 100644
--- a/bitbake/lib/bb/fetch2/svn.py
+++ b/bitbake/lib/bb/fetch2/svn.py
@@ -78,9 +78,6 @@ class Svn(Fetch):
78 78
79 ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d) 79 ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
80 80
81 def localpath(self, url, ud, d):
82 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
83
84 def _buildsvncommand(self, ud, d, command): 81 def _buildsvncommand(self, ud, d, command):
85 """ 82 """
86 Build up an svn commandline based on ud 83 Build up an svn commandline based on ud
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py
index a281bdcb4f..8d623721a9 100644
--- a/bitbake/lib/bb/fetch2/wget.py
+++ b/bitbake/lib/bb/fetch2/wget.py
@@ -45,9 +45,6 @@ class Wget(Fetch):
45 ud.basename = os.path.basename(ud.path) 45 ud.basename = os.path.basename(ud.path)
46 ud.localfile = data.expand(urllib.unquote(ud.basename), d) 46 ud.localfile = data.expand(urllib.unquote(ud.basename), d)
47 47
48 def localpath(self, url, ud, d):
49 return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
50
51 def download(self, uri, ud, d, checkonly = False): 48 def download(self, uri, ud, d, checkonly = False):
52 """Fetch urls""" 49 """Fetch urls"""
53 50