[oe-commits] [openembedded-core] 45/69: sanity.bbclass cleanup

git at git.openembedded.org git at git.openembedded.org
Wed Mar 23 14:26:33 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 8dba5a546ef681762214036b206c4a3df5f81ede
Author: Bill Randle <william.c.randle at intel.com>
AuthorDate: Mon Mar 21 13:24:33 2016 -0700

    sanity.bbclass cleanup
    
    Limit search for a version var name to start at the beginning of a line,
    otherwise, if the var name is used in a comment, that comment line will
    be replaced, rather than the desired assignment line.
    Move bblayer update message into function where it's actually updated,
    rather than assuming all successful config file update are to the
    bblayers.conf file.
    Replace a stray tab with spaces for consistency.
    
    [Fixes YOCTO #9318]
    
    Signed-off-by: Bill Randle <william.c.randle at intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/sanity.bbclass | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index e72a007..029c6e4 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -20,7 +20,7 @@ def sanity_conf_find_line(pattern, lines):
         if re.search(pattern, line)), (None, None))
 
 def sanity_conf_update(fn, lines, version_var_name, new_version):
-    index, line = sanity_conf_find_line(version_var_name, lines)
+    index, line = sanity_conf_find_line(r"^%s" % version_var_name, lines)
     lines[index] = '%s = "%d"\n' % (version_var_name, new_version)
     with open(fn, "w") as f:
         f.write(''.join(lines))
@@ -125,12 +125,14 @@ is a good way to visualise the changes."""
 
         current_lconf += 1
         sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+        bb.note("Your conf/bblayers.conf has been automatically updated.")
         return
 
     elif current_lconf == 5 and lconf_version > 5:
         # Null update, to avoid issues with people switching between poky and other distros
         current_lconf = 6
         sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+        bb.note("Your conf/bblayers.conf has been automatically updated.")
         return
 
         if not status.reparse:
@@ -141,7 +143,7 @@ is a good way to visualise the changes."""
         # This marks the start of separate version numbers but code is needed in OE-Core
         # for the migration, one last time.
         layers = d.getVar('BBLAYERS', True).split()
-	layers = [ os.path.basename(path) for path in layers ]
+        layers = [ os.path.basename(path) for path in layers ]
         if 'meta-yocto' in layers:
             found = False
             while True:
@@ -160,9 +162,11 @@ is a good way to visualise the changes."""
                 raise NotImplementedError(failmsg)
             with open(bblayers_fn, "w") as f:
                 f.write(''.join(lines))
+            bb.note("Your conf/bblayers.conf has been automatically updated.")
             return
         current_lconf += 1
         sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+        bb.note("Your conf/bblayers.conf has been automatically updated.")
         return
 
     raise NotImplementedError(failmsg)
@@ -564,7 +568,6 @@ def sanity_check_conffiles(status, d):
                 success = False
                 status.addresult(e.msg)
             if success:
-                bb.note("Your %s file has been automatically updated." % conffile)
                 status.reparse = True
 
 def sanity_handle_abichanges(status, d):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list