summaryrefslogtreecommitdiff
path: root/buildstream/_ostree.py
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-09-28 13:20:33 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2017-10-12 17:55:51 +0100
commit59c14af228a3cf3e5155e932cff01ebca4a4a44b (patch)
tree24b8c687da891e09606775f686fa3a99f6c08752 /buildstream/_ostree.py
parenta580a4a032c2e492c5287a976ced1db178467549 (diff)
downloadbuildstream-81-non-empty-read-only-directories-not-handled-during-bst-build-and-others.tar.gz
Ensure that artifact file permissions are set in the right order81-non-empty-read-only-directories-not-handled-during-bst-build-and-others
Diffstat (limited to 'buildstream/_ostree.py')
-rw-r--r--buildstream/_ostree.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/buildstream/_ostree.py b/buildstream/_ostree.py
index 40bfda644..89d59b342 100644
--- a/buildstream/_ostree.py
+++ b/buildstream/_ostree.py
@@ -26,7 +26,7 @@ import os
import subprocess
from . import _site
from . import utils
-from .exceptions import _BstError
+from .exceptions import _BstError, _ArtifactError, _ArtifactErrorReason
import gi
gi.require_version('OSTree', '1.0')
@@ -153,6 +153,13 @@ def commit(repo, dir, ref, branch=None):
# complete repo transaction
repo.commit_transaction(None)
+ except GLib.IOError as e:
+ repo.abort_transaction()
+
+ if e.code == Gio.IOErrorEnum.PERMISSION_DENIED:
+ raise _ArtifactError(e.message, _ArtifactErrorReason.PERMISSION_DENIED) from e
+ else:
+ raise
except:
repo.abort_transaction()
raise