]> code.ossystems Code Review - openembedded-core.git/commitdiff
sanity.bbclass: version each of the files in the build/conf/ directory
authorJoshua Lock <josh@linux.intel.com>
Mon, 7 Jun 2010 15:10:48 +0000 (16:10 +0100)
committerJoshua Lock <josh@linux.intel.com>
Mon, 7 Jun 2010 15:16:35 +0000 (16:16 +0100)
We already have versioning of the local.conf file but it's entirely plausible
for the bblayers.conf and site.conf to change incompatibly so we should version
those too.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
build/conf/bblayers.conf.sample
build/conf/site.conf.sample
meta/classes/sanity.bbclass
meta/conf/sanity.conf

index 3ea6eda66a7578d3c32a78839cfcc8c7ed7ae3fa..dff44e49c46f577ed248666f50a5dd27d45a0707 100644 (file)
@@ -1,3 +1,7 @@
+# LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
+# changes incompatibly
+LCONF_VERSION = "1"
+
 BBFILES ?= ""
 BBLAYERS = " \
   ${OEROOT}/meta \
index 0ed70c6d790f775b330ad02201f1ba67215688e6..060dca087cd1f54877323a8e2f5fbe387169c60f 100644 (file)
@@ -2,6 +2,9 @@
 # local.conf covers user settings, site.conf covers site specific information
 # such as proxy server addresses and optionally any shared download location
 #
+# SITE_CONF_VERSION is increased each time build/conf/site.conf
+# changes incompatibly
+SCONF_VERSION = "1"
 
 # Uncomment to cause CVS to use the proxy host specified
 #CVS_PROXY_HOST = "proxy.example.com"
index ab929ad61d5b282f64a6e1c001933111edcfe780..8ed8975edd0676bcf3dab1727c1d12e9cf6a2a59 100644 (file)
@@ -54,12 +54,25 @@ def check_sanity(e):
        if data.getVar('TARGET_OS', e.data, True) == 'INVALID':
                messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n'
 
-        # Check we are using a valid conf setup
-        current_conf = data.getVar('CONF_VERSION', e.data, True)
-        conf_version = data.getVar('POKY_CONF_VERSION', e.data, True)
+        # Check we are using a valid lacal.conf
+        current_conf  = data.getVar('CONF_VERSION', e.data, True)
+        conf_version =  data.getVar('POKY_CONF_VERSION', e.data, True)
 
         if current_conf != conf_version:
-                messages = messages + "Poky has noticed your version of local.conf was generated from an older version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf conf/local.conf.sample\" is a good way to visualise the changes"
+                messages = messages + "Poky has noticed your version of local.conf was generated from an older version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf conf/local.conf.sample\" is a good way to visualise the changes.\n"
+
+        # Check bblayers.conf is valid
+        current_lconf = data.getVar('LCONF_VERSION', e.data, True)
+        lconf_version = data.getVar('LAYER_CONF_VERSION', e.data, True)
+        if current_lconf != lconf_version:
+                messages = messages + "Poky has noticed your version of bblayers.conf was generated from an older version of bblayers.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/bblayers.conf conf/bblayers.conf.sample\" is a good way to visualise the changes.\n"
+
+        # If we have a site.conf, check it's valid
+        if check_conf_exists("conf/site.conf", e.data):
+                current_sconf = data.getVar('SCONF_VERSION', e.data, True)
+                sconf_version = data.getVar('SITE_CONF_VERSION', e.data, True)
+                if current_sconf != sconf_version:
+                        messages = messages + "Poky has noticed your version of site.conf was generated from an older version of site.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/site.conf conf/site.conf.sample\" is a good way to visualise the changes.\n"
 
        assume_provided = data.getVar('ASSUME_PROVIDED', e.data , True).split()
        # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
index c9d77794cf9f20e856d99c55c86f90d0fa849307..abe5eee01efb44a38827e65a5fd743197f6b50f0 100644 (file)
@@ -7,7 +7,9 @@ BB_MIN_VERSION = "1.8.10"
 
 SANITY_ABIFILE = "${TMPDIR}/abi_version"
 
-POKY_CONF_VERSION = "1"
+POKY_CONF_VERSION  = "1"
+LAYER_CONF_VERSION = "1"
+SITE_CONF_VERSION  = "1"
 
 INHERIT += "sanity"