Rebase flatpak_repo

parent a9937729
......@@ -29,11 +29,11 @@ The flatpak_repo default configuration:
from buildstream import ScriptElement, Scope, ElementError
class FlatpakRepoElement(ScriptElement):
BST_FORMAT_VERSION = 1
BST_ARTIFACT_VERSION = 1
def configure(self, node):
self.node_validate(node, ['environment', 'copy-refs', 'arch', 'branch'])
self.node_validate(node, ['environment', 'copy-refs', 'repo-mode', 'arch', 'branch'])
self._env = self.node_get_member(node, list, 'environment')
......@@ -47,9 +47,13 @@ class FlatpakRepoElement(ScriptElement):
self._branch = self.node_subst_member(node, 'branch')
self.set_work_dir()
self.set_install_root('/buildstream/repo')
self.set_root_read_only(True)
self._repo_mode = self.node_subst_member(node, 'repo-mode')
self.set_install_root('/buildstream/repo')
self.add_commands('init repository',
['ostree init --repo=/buildstream/repo --mode={}'.format(self._repo_mode)])
def _layout_flatpaks(self, elements):
def staging_dir(elt):
return '/buildstream/input/{}'.format(elt.name)
......@@ -82,6 +86,15 @@ class FlatpakRepoElement(ScriptElement):
super(FlatpakRepoElement, self).stage(sandbox)
def get_unique_key(self):
return {
'environment': self._env,
'copy-refs': self._copy_refs,
'repo-mode': self._repo_mode,
'arch': self._arch,
'branch': self._branch
}
# Plugin entry point
def setup():
......
......@@ -4,5 +4,7 @@ config:
# refs of which a copy is to be made using flatpak build-commit-from
# a list of mappings containing keys `src` and `dest`
copy-refs: []
# the mode of the ostree repo (one of archive, bare, bare-user, bare-user-only)
repo-mode: 'archive'
arch: '%{arch}'
branch: '%{branch}'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment