1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 13:09:50 +00:00

bitbake: toastergui: provide download file capability

We add, for the localhost environments, the capability to
download build artifacts. This is a pontentially dangerous API,
because it gives unrestricted read access to the build environment
file system - do not expose the functionality directly to the
web layer, but use filtering/translation code, such as
exemplified in the build_artifact view.

The capability for remote build environments is dependent
on bug 6835, as to use the collect storage as intermediary
storage for serving files.

[YOCTO #6834]

(Bitbake rev: 5fce7f6e83c6143244faa9618b7ed20c1106e08f)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Alexandru DAMIAN
2014-10-14 13:57:33 +01:00
committed by Richard Purdie
parent 2837b110ae
commit 298c3d52ba
5 changed files with 65 additions and 1 deletions
+13
View File
@@ -40,6 +40,19 @@ class BuildEnvironment(models.Model):
updated = models.DateTimeField(auto_now = True)
def get_artifact_type(self, path):
if self.betype == BuildEnvironment.TYPE_LOCAL:
import magic
m = magic.open(magic.MAGIC_MIME_TYPE)
m.load()
return m.file(path)
raise Exception("FIXME: not implemented")
def get_artifact(self, path):
if self.betype == BuildEnvironment.TYPE_LOCAL:
return open(path, "r")
raise Exception("FIXME: not implemented")
# a BuildRequest is a request that the scheduler will build using a BuildEnvironment
# the build request queue is the table itself, ordered by state