summaryrefslogtreecommitdiff
path: root/buildstream/_ostree.py
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-03 22:06:18 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-03 22:06:18 +0900
commit70cc9515d392cb859d99135c847f67fb926b42ed (patch)
tree40369f30c55320d37001719e9cc78d3eac765b83 /buildstream/_ostree.py
parentc3ef5b226cc51bafd04842693ec8dd3a68413b11 (diff)
downloadbuildstream-70cc9515d392cb859d99135c847f67fb926b42ed.tar.gz
_ostree.py: Added mountdir option to ostree push/pull apis
So that we dont dirty the CWD
Diffstat (limited to 'buildstream/_ostree.py')
-rw-r--r--buildstream/_ostree.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py
index 71c55d79e..2ac3ce95f 100644
--- a/buildstream/_ostree.py
+++ b/buildstream/_ostree.py
@@ -299,13 +299,15 @@ def fetch(repo, remote="origin", ref=None, progress=None):
#
# Args:
# repo (OSTree.Repo): The repo
+# mountdir (str): The directory to create mounts at
# remote (str): The url of the remote ostree repo
-# ref (str): A ref to push
+# ref (str): A ref to pull
#
-def fetch_ssh(repo, remote, ref):
+def fetch_ssh(repo, mountdir, remote, ref):
exit_code, output = utils._call([
_site.ostree_pull_ssh,
'--repo=' + repo.get_path().get_path(),
+ '--basedir=' + mountdir,
remote,
ref],
terminate=True,
@@ -322,10 +324,11 @@ def fetch_ssh(repo, remote, ref):
#
# Args:
# repo (OSTree.Repo): The repo
+# mountdir (str): The directory to create mounts at
# remote (str): The url of the remote ostree repo
# ref (str): A ref to push
#
-def push(repo, remote, ref):
+def push(repo, mountdir, remote, ref):
if remote.startswith("/"):
# local repository
push_repo = ensure(remote, True)
@@ -334,6 +337,7 @@ def push(repo, remote, ref):
exit_code, output = utils._call([
_site.ostree_push,
'--repo=' + repo.get_path().get_path(),
+ '--basedir=' + mountdir,
remote,
ref],
terminate=True,