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-10 23:36:57 +0000
commite793a2ded0f037390375328fda2aea3441f1efe8 (patch)
tree2a3d8972b94d2ca42c102ee6ceeed94575c0243e
parentfdab13939be23227d49db7bd5b9c01cd10737a47 (diff)
downloadbitbake-e793a2ded0f037390375328fda2aea3441f1efe8.tar.gz
bitbake/fetch2: Define a sane localpath function and remove code duplication
(From Poky rev: 5a52cb80d6d62c704692ad6cfa93426c4a17bc52) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py3
-rw-r--r--lib/bb/fetch2/bzr.py3
-rw-r--r--lib/bb/fetch2/cvs.py3
-rw-r--r--lib/bb/fetch2/git.py3
-rw-r--r--lib/bb/fetch2/hg.py3
-rw-r--r--lib/bb/fetch2/osc.py3
-rw-r--r--lib/bb/fetch2/perforce.py3
-rw-r--r--lib/bb/fetch2/repo.py3
-rw-r--r--lib/bb/fetch2/svk.py3
-rw-r--r--lib/bb/fetch2/svn.py3
-rw-r--r--lib/bb/fetch2/wget.py3
11 files changed, 2 insertions, 31 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index c80760197..e8eaebe9d 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -621,7 +621,8 @@ class Fetch(object):
Can also setup variables in urldata for use in go (saving code duplication
and duplicate code execution)
"""
- return url
+ return os.path.join(data.getVar("DL_DIR", d, True), urldata.localfile)
+
def _strip_leading_slashes(self, relpath):
"""
Remove leading slash as os.path.join can't cope
diff --git a/lib/bb/fetch2/bzr.py b/lib/bb/fetch2/bzr.py
index cc0035790..1e25207b1 100644
--- a/lib/bb/fetch2/bzr.py
+++ b/lib/bb/fetch2/bzr.py
@@ -47,9 +47,6 @@ class Bzr(Fetch):
ud.localfile = data.expand('bzr_%s_%s_%s.tar.gz' % (ud.host, ud.path.replace('/', '.'), ud.revision), d)
- def localpath (self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def _buildbzrcommand(self, ud, d, command):
"""
Build up an bzr commandline based on ud
diff --git a/lib/bb/fetch2/cvs.py b/lib/bb/fetch2/cvs.py
index 6a7cdf2a8..907812d71 100644
--- a/lib/bb/fetch2/cvs.py
+++ b/lib/bb/fetch2/cvs.py
@@ -65,9 +65,6 @@ class Cvs(Fetch):
ud.localfile = data.expand('%s_%s_%s_%s%s%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.tag, ud.date, norecurse, fullpath), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def forcefetch(self, url, ud, d):
if (ud.date == "now"):
return True
diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index f38058bbc..392491ed8 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -77,9 +77,6 @@ class Git(Fetch):
ud.localfile = ud.mirrortarball
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def forcefetch(self, url, ud, d):
for name in ud.names:
if not self._contains_ref(ud.revisions[name], d):
diff --git a/lib/bb/fetch2/hg.py b/lib/bb/fetch2/hg.py
index 53eeea9a8..6929d971f 100644
--- a/lib/bb/fetch2/hg.py
+++ b/lib/bb/fetch2/hg.py
@@ -68,9 +68,6 @@ class Hg(Fetch):
revTag = ud.parm.get('rev', 'tip')
return revTag == "tip"
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def _buildhgcommand(self, ud, d, command):
"""
Build up an hg commandline based on ud
diff --git a/lib/bb/fetch2/osc.py b/lib/bb/fetch2/osc.py
index 93deb458e..14bde82fd 100644
--- a/lib/bb/fetch2/osc.py
+++ b/lib/bb/fetch2/osc.py
@@ -49,9 +49,6 @@ class Osc(Fetch):
ud.localfile = data.expand('%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.path.replace('/', '.'), ud.revision), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def _buildosccommand(self, ud, d, command):
"""
Build up an ocs commandline based on ud
diff --git a/lib/bb/fetch2/perforce.py b/lib/bb/fetch2/perforce.py
index aefc20784..5c128b3fd 100644
--- a/lib/bb/fetch2/perforce.py
+++ b/lib/bb/fetch2/perforce.py
@@ -118,9 +118,6 @@ class Perforce(Fetch):
ud.localfile = data.expand('%s+%s+%s.tar.gz' % (host, base.replace('/', '.'), cset), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, 1), ud.localfile)
-
def download(self, loc, ud, d):
"""
Fetch urls
diff --git a/lib/bb/fetch2/repo.py b/lib/bb/fetch2/repo.py
index f742591fd..9d890a5e9 100644
--- a/lib/bb/fetch2/repo.py
+++ b/lib/bb/fetch2/repo.py
@@ -53,9 +53,6 @@ class Repo(Fetch):
ud.localfile = data.expand("repo_%s%s_%s_%s.tar.gz" % (ud.host, ud.path.replace("/", "."), ud.manifest, ud.branch), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def download(self, loc, ud, d):
"""Fetch url"""
diff --git a/lib/bb/fetch2/svk.py b/lib/bb/fetch2/svk.py
index ef1cf4deb..95206f52f 100644
--- a/lib/bb/fetch2/svk.py
+++ b/lib/bb/fetch2/svk.py
@@ -53,9 +53,6 @@ class Svk(Fetch):
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def forcefetch(self, url, ud, d):
return ud.date == "now"
diff --git a/lib/bb/fetch2/svn.py b/lib/bb/fetch2/svn.py
index ded7cd005..5ff064ebf 100644
--- a/lib/bb/fetch2/svn.py
+++ b/lib/bb/fetch2/svn.py
@@ -78,9 +78,6 @@ class Svn(Fetch):
ud.localfile = data.expand('%s_%s_%s_%s_%s.tar.gz' % (ud.module.replace('/', '.'), ud.host, ud.path.replace('/', '.'), ud.revision, ud.date), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def _buildsvncommand(self, ud, d, command):
"""
Build up an svn commandline based on ud
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index a281bdcb4..8d623721a 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -45,9 +45,6 @@ class Wget(Fetch):
ud.basename = os.path.basename(ud.path)
ud.localfile = data.expand(urllib.unquote(ud.basename), d)
- def localpath(self, url, ud, d):
- return os.path.join(data.getVar("DL_DIR", d, True), ud.localfile)
-
def download(self, uri, ud, d, checkonly = False):
"""Fetch urls"""