diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-01-15 14:21:49 -0500 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-01-16 16:13:00 -0500 |
commit | 3e5a0347468fe106076cbf8d1b44e2fa754b9da6 (patch) | |
tree | d2aca08f523504df0ef61bbd1ceb7f376aabc5e3 /setup.py | |
parent | 5700ebe231507629a49c8bff615f3c491f7120ea (diff) | |
download | buildstream-3e5a0347468fe106076cbf8d1b44e2fa754b9da6.tar.gz |
setup.py: Ensure OSTree version >= v2016.8
There is no easy way to check the version we need for
OSTree with introspection, we only have version "1.0".
So we try to access a method directly and bail out
if it doesnt exist.
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 21 |
1 files changed, 18 insertions, 3 deletions
@@ -32,6 +32,17 @@ except ImportError: " install setuptools).") sys.exit(1) + +################################################################## +# We require at least v2016.8 of OSTree, which contain the +# fixes in this bug: +# https://github.com/ostreedev/ostree/pull/417 +################################################################## +def exit_ostree(reason): + print(reason + ": BuildStream requires OSTree >= v2016.8 with Python bindings. " + "Install it using your package manager (usually ostree or gir1.2-ostree-1.0).") + sys.exit(1) + try: import gi except ImportError: @@ -43,9 +54,13 @@ try: gi.require_version('OSTree', '1.0') from gi.repository import OSTree except: - print("BuildStream requires OSTree with Python bindings. Install it using" - " your package manager (usually ostree or gir1.2-ostree-1.0).") - sys.exit(1) + exit_ostree("OSTree not found") + +try: + checkout_at = OSTree.Repo.checkout_at +except AttributeError: + exit_ostree("OSTree too old") + setup(name='buildstream', version='0.1', |