summaryrefslogtreecommitdiff
path: root/buildstream/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/utils.py')
-rw-r--r--buildstream/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py
index 8e7219631..b81a6c852 100644
--- a/buildstream/utils.py
+++ b/buildstream/utils.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python3
#
# Copyright (C) 2016-2018 Codethink Limited
#
@@ -307,7 +306,7 @@ def safe_remove(path):
"""Removes a file or directory
This will remove a file if it exists, and will
- remove a directory if the directory is not empty.
+ remove a directory if the directory is empty.
Args:
path (str): The path to remove
@@ -472,6 +471,10 @@ def get_bst_version():
from . import __version__
versions = __version__.split('.')[:2]
+ if versions[0] == '0+untagged':
+ raise UtilError("Your git repository has no tags - BuildStream can't "
+ "determine its version. Please run `git fetch --tags`.")
+
return (int(versions[0]), int(versions[1]))