1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

bitbake/fetch2: Define a sane localpath function and remove code duplication

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2011-02-03 21:20:39 +00:00
parent 972eb5faba
commit 5a52cb80d6
11 changed files with 2 additions and 31 deletions
+2 -1
View File
@@ -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
-3
View File
@@ -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
-3
View File
@@ -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
-3
View File
@@ -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):
-3
View File
@@ -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
-3
View File
@@ -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
-3
View File
@@ -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
-3
View File
@@ -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"""
-3
View File
@@ -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"
-3
View File
@@ -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
-3
View File
@@ -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"""