Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-24 22:51:41 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-24 22:51:41 (GMT)
commitc1613f76159e98ebd449ef557dbb9705bbf55b97 (patch)
tree78329120f2094717534bcb38be53ee6fab5da6ea
parentbd52a0b9840d30e46fc43a435c97497d6b7d1b2a (diff)
Create build and source dir on demand
Otherwise they are created in the snapshot
-rw-r--r--devbot/build.py4
-rw-r--r--devbot/config.py31
2 files changed, 21 insertions, 14 deletions
diff --git a/devbot/build.py b/devbot/build.py
index ca0bc07..de9e59a 100644
--- a/devbot/build.py
+++ b/devbot/build.py
@@ -66,7 +66,7 @@ def pull_source(module):
command.run(["git", "remote", "set-url", "origin", module.repo])
command.run(["git", "remote", "update", "origin"], retry=10)
else:
- os.chdir(config.source_dir)
+ os.chdir(config.get_source_dir())
command.run(["git", "clone", "--progress",
module.repo, module.name],
retry=10)
@@ -160,7 +160,7 @@ def build():
def clean():
rmtree(config.install_dir)
rmtree(config.prefix_dir)
- rmtree(config.build_dir)
+ rmtree(config.get_build_dir())
for module in config.load_modules():
if not module.out_of_source:
diff --git a/devbot/config.py b/devbot/config.py
index a5926fe..8a734d5 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -9,8 +9,6 @@ logs_dir = None
commands_dir = None
install_dir = None
prefix_dir = None
-source_dir = None
-build_dir = None
lib_dir = None
devbot_dir = None
share_dir = None
@@ -21,6 +19,9 @@ module_files = None
package_files = None
prefs_path = None
+_source_dir = None
+_build_dir = None
+
class Module:
def __init__(self, info):
self.name = info["name"]
@@ -35,10 +36,10 @@ class Module:
self.out_of_source = info.get("out-of-source", True)
def get_source_dir(self):
- return os.path.join(source_dir, self.name)
+ return os.path.join(get_source_dir(), self.name)
def get_build_dir(self):
- return os.path.join(build_dir, self.name)
+ return os.path.join(get_build_dir(), self.name)
def _ensure_dir(dir):
if not os.path.exists(dir):
@@ -109,16 +110,22 @@ def set_install_dir(dir, relocatable=False):
system_lib_dir = "/usr/lib"
def set_source_dir(dir):
- global source_dir
-
- source_dir = dir
- _ensure_dir(source_dir)
+ global _source_dir
+ _source_dir = dir
def set_build_dir(dir):
- global build_dir
-
- build_dir = dir
- _ensure_dir(build_dir)
+ global _build_dir
+ _build_dir = dir
+
+def get_source_dir():
+ global _source_dir
+ _ensure_dir(_source_dir)
+ return _source_dir
+
+def get_build_dir():
+ global _build_dir
+ _ensure_dir(_build_dir)
+ return _build_dir
def set_commands_dir(dir):
global commands_dir