aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-14 21:38:17 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-15 12:12:36 +0000
commit804d1d57a2ea8ecde8adc9bf20c6460e039837c4 (patch)
treea4bd4038b936717cb8449ac696f3f28ef039e1bd /bitbake
parent95e7dae968d83e7fa793dd72444e60338b801ecd (diff)
downloadopenembedded-core-contrib-804d1d57a2ea8ecde8adc9bf20c6460e039837c4.tar.gz
bitbake: fetch2: Improve lock/done stamp file paths for local files
Currently stamps end up at the top level of DL_DIR even if the files themselves are in a directory structure. This patch preserves path components allowing the top level directory to be less populated which is an advantage for large sstate caches. (Bitbake rev: 59921ce3ed7a4c0b7f8ef1a101ad9127469bf1fd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 3f5de990de..90c894f60f 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/lib/bb/fetch2/__init__.py
@@ -756,6 +756,7 @@ class FetchData(object):
self.lockfile = None
self.mirrortarball = None
self.basename = None
+ self.basepath = None
(self.type, self.host, self.path, self.user, self.pswd, self.parm) = decodeurl(data.expand(url, d))
self.date = self.getSRCDate(d)
self.url = url
@@ -812,8 +813,14 @@ class FetchData(object):
elif self.localfile:
self.localpath = self.method.localpath(self.url, self, d)
- # Note: These files should always be in DL_DIR whereas localpath may not be.
- basepath = d.expand("${DL_DIR}/%s" % os.path.basename(self.localpath or self.basename))
+ dldir = d.getVar("DL_DIR", True)
+ # Note: .done and .lock files should always be in DL_DIR whereas localpath may not be.
+ if self.localpath and self.localpath.startswith(dldir):
+ basepath = self.localpath
+ elif self.localpath:
+ basepath = dldir + os.sep + os.path.basename(self.localpath)
+ else:
+ basepath = dldir + os.sep + (self.basepath or self.basename)
self.donestamp = basepath + '.done'
self.lockfile = basepath + '.lock'