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-12-25 17:39:56 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-25 17:39:56 (GMT)
commit3022a9c90a374a9c6ba402b6aede0a503bf6315e (patch)
tree86129b34ecb5655a7b22f2bb1cc4e45d734fd01c
parent1226f3dabfef23217d6052b42e18eb7340f5a7f4 (diff)
Allow the config to require a full build
-rw-r--r--Makefile.config6
-rw-r--r--config/config.json3
-rw-r--r--config/modules/sugar.json4
-rw-r--r--devbot/build.py5
-rw-r--r--devbot/config.py9
-rw-r--r--devbot/state.py15
6 files changed, 36 insertions, 6 deletions
diff --git a/Makefile.config b/Makefile.config
index 95883c1..5959c60 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -19,11 +19,13 @@ CONFIG_MODULES= \
CONFIG_PACKAGES_DIR=config/packages
-OONFIG_PACKAGES= \
+CONFIG_PACKAGES= \
$(CONFIG_PACKAGES_DIR)/basesystem.json \
$(CONFIG_PACKAGES_DIR)/buildslave.json \
$(CONFIG_PACKAGES_DIR)/deps.json
+CONFIG_MAIN=config/config.json
+
config-normalize:
- @$(JSON_NORMALIZE) $(CONFIG_MODULES) $(OONFIG_PACKAGES)
+ @$(JSON_NORMALIZE) $(CONFIG_MODULES) $(CONFIG_PACKAGES) $(CONFIG_MAIN)
@$(JSON_NORMALIZE) --sort-by name $(CONFIG_DEPS)
diff --git a/config/config.json b/config/config.json
new file mode 100644
index 0000000..126e679
--- /dev/null
+++ b/config/config.json
@@ -0,0 +1,3 @@
+{
+ "full_build": "1"
+}
diff --git a/config/modules/sugar.json b/config/modules/sugar.json
index 20a54c3..d3585c1 100644
--- a/config/modules/sugar.json
+++ b/config/modules/sugar.json
@@ -43,8 +43,8 @@
"repo": "git://git.sugarlabs.org/gst-plugins-espeak/mainline.git"
},
{
+ "distribute": true,
"name": "sugar-runner",
- "repo": "git://git.sugarlabs.org/sugar-runner/sugar-runner.git",
- "distribute": true
+ "repo": "git://git.sugarlabs.org/sugar-runner/sugar-runner.git"
}
]
diff --git a/devbot/build.py b/devbot/build.py
index 640ba01..06d6874 100644
--- a/devbot/build.py
+++ b/devbot/build.py
@@ -48,6 +48,11 @@ def build():
_ccache_reset()
+ if state.full_build_is_required():
+ clean()
+
+ state.full_build_touch()
+
for module in config.load_modules():
if state.built_module_is_unchanged(module):
print "\n* Skipping unchanged module %s *" % module.name
diff --git a/devbot/config.py b/devbot/config.py
index dba6709..3a396cd 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -247,7 +247,14 @@ def _read_index(dir_name, extra=[]):
with open(os.path.join(index_dir, "index.json")) as f:
files.extend(json.load(f))
return [os.path.join(index_dir, json_file) for json_file in files]
-
+
+def get_full_build():
+ config = None
+ with open(os.path.join(config_dir, "config.json")) as f:
+ config = json.load(f)
+
+ return config["full_build"]
+
def load_packages():
packages = {}
diff --git a/devbot/state.py b/devbot/state.py
index 3cb3e42..b44652f 100644
--- a/devbot/state.py
+++ b/devbot/state.py
@@ -6,6 +6,7 @@ from devbot import config
from devbot import git
_BUILT_MODULES = "builtmodules"
+_FULL_BUILD = "fullbuild"
_SYSTEM_CHECK = "syscheck"
def _get_state_path(name):
@@ -76,13 +77,25 @@ def system_check_touch():
system_check["commit"] = _get_root_commit_id()
_save_state(_SYSTEM_CHECK, system_check)
+def full_build_is_required():
+ full_build = _load_state(_FULL_BUILD)
+ if not full_build:
+ return True
+
+ return not (full_build["last"] == config.get_full_build())
+
+def full_build_touch():
+ full_build = _load_state(_FULL_BUILD, {})
+ full_build["last"] = config.get_full_build()
+ _save_state(_FULL_BUILD, full_build)
+
def clean():
_state = None
print "Deleting state"
try:
- for name in _BUILT_MODULES, _SYSTEM_CHECK:
+ for name in _BUILT_MODULES, _SYSTEM_CHECK, _FULL_BUILD:
os.unlink(_get_state_path(name))
except OSError:
pass