diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-26 00:22:01 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-26 00:22:01 (GMT) |
commit | 9c6636a761d2bc627e744e6b0efc45cc7672c485 (patch) | |
tree | 9140286204564cc901ef645caeac3155e0fd2b19 /devbot/config.py | |
parent | 15980e294fcb70ce8e04efb198b26f66c4241ecb (diff) |
On run check the system only if something changed
Diffstat (limited to 'devbot/config.py')
-rw-r--r-- | devbot/config.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/devbot/config.py b/devbot/config.py index df037d6..123958a 100644 --- a/devbot/config.py +++ b/devbot/config.py @@ -3,6 +3,7 @@ import os import tempfile from devbot import distro +from devbot import utils config_dir = None logs_dir = None @@ -41,10 +42,20 @@ class Module: def get_build_dir(self): return os.path.join(get_build_dir(), self.name) + def get_commit_id(self): + return utils.get_commit_id(get_source_dir()) + def _ensure_dir(dir): if not os.path.exists(dir): os.mkdir(dir) +def get_commit_id(): + commit_id = utils.get_commit_id(config_dir) + if commit_id is None: + commit_id = "snapshot" + + return commit_id + def set_config_dir(dir): global config_dir config_dir = dir |