diff options
author | Bill Randle <william.c.randle@intel.com> | 2016-03-21 13:24:33 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-25 10:29:15 +0000 |
commit | 421289cbcc422d8a45018f69660a1ed3b1018cb3 (patch) | |
tree | b5322e20eb1f35593d2bec799fb6d820e3fd7d3b /meta | |
parent | 93e411ee00805c0d37b68317a5916acdbe58d951 (diff) | |
download | poky-421289cbcc422d8a45018f69660a1ed3b1018cb3.tar.gz |
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]
(From OE-Core rev: 7c1e53bb802f021f06231243077d0e007a64274c)
Signed-off-by: Bill Randle <william.c.randle@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sanity.bbclass | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass index e72a007078..029c6e4fbe 100644 --- a/meta/classes/sanity.bbclass +++ b/meta/classes/sanity.bbclass | |||
@@ -20,7 +20,7 @@ def sanity_conf_find_line(pattern, lines): | |||
20 | if re.search(pattern, line)), (None, None)) | 20 | if re.search(pattern, line)), (None, None)) |
21 | 21 | ||
22 | def sanity_conf_update(fn, lines, version_var_name, new_version): | 22 | def sanity_conf_update(fn, lines, version_var_name, new_version): |
23 | index, line = sanity_conf_find_line(version_var_name, lines) | 23 | index, line = sanity_conf_find_line(r"^%s" % version_var_name, lines) |
24 | lines[index] = '%s = "%d"\n' % (version_var_name, new_version) | 24 | lines[index] = '%s = "%d"\n' % (version_var_name, new_version) |
25 | with open(fn, "w") as f: | 25 | with open(fn, "w") as f: |
26 | f.write(''.join(lines)) | 26 | f.write(''.join(lines)) |
@@ -125,12 +125,14 @@ is a good way to visualise the changes.""" | |||
125 | 125 | ||
126 | current_lconf += 1 | 126 | current_lconf += 1 |
127 | sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) | 127 | sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) |
128 | bb.note("Your conf/bblayers.conf has been automatically updated.") | ||
128 | return | 129 | return |
129 | 130 | ||
130 | elif current_lconf == 5 and lconf_version > 5: | 131 | elif current_lconf == 5 and lconf_version > 5: |
131 | # Null update, to avoid issues with people switching between poky and other distros | 132 | # Null update, to avoid issues with people switching between poky and other distros |
132 | current_lconf = 6 | 133 | current_lconf = 6 |
133 | sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) | 134 | sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) |
135 | bb.note("Your conf/bblayers.conf has been automatically updated.") | ||
134 | return | 136 | return |
135 | 137 | ||
136 | if not status.reparse: | 138 | if not status.reparse: |
@@ -141,7 +143,7 @@ is a good way to visualise the changes.""" | |||
141 | # This marks the start of separate version numbers but code is needed in OE-Core | 143 | # This marks the start of separate version numbers but code is needed in OE-Core |
142 | # for the migration, one last time. | 144 | # for the migration, one last time. |
143 | layers = d.getVar('BBLAYERS', True).split() | 145 | layers = d.getVar('BBLAYERS', True).split() |
144 | layers = [ os.path.basename(path) for path in layers ] | 146 | layers = [ os.path.basename(path) for path in layers ] |
145 | if 'meta-yocto' in layers: | 147 | if 'meta-yocto' in layers: |
146 | found = False | 148 | found = False |
147 | while True: | 149 | while True: |
@@ -160,9 +162,11 @@ is a good way to visualise the changes.""" | |||
160 | raise NotImplementedError(failmsg) | 162 | raise NotImplementedError(failmsg) |
161 | with open(bblayers_fn, "w") as f: | 163 | with open(bblayers_fn, "w") as f: |
162 | f.write(''.join(lines)) | 164 | f.write(''.join(lines)) |
165 | bb.note("Your conf/bblayers.conf has been automatically updated.") | ||
163 | return | 166 | return |
164 | current_lconf += 1 | 167 | current_lconf += 1 |
165 | sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) | 168 | sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf) |
169 | bb.note("Your conf/bblayers.conf has been automatically updated.") | ||
166 | return | 170 | return |
167 | 171 | ||
168 | raise NotImplementedError(failmsg) | 172 | raise NotImplementedError(failmsg) |
@@ -564,7 +568,6 @@ def sanity_check_conffiles(status, d): | |||
564 | success = False | 568 | success = False |
565 | status.addresult(e.msg) | 569 | status.addresult(e.msg) |
566 | if success: | 570 | if success: |
567 | bb.note("Your %s file has been automatically updated." % conffile) | ||
568 | status.reparse = True | 571 | status.reparse = True |
569 | 572 | ||
570 | def sanity_handle_abichanges(status, d): | 573 | def sanity_handle_abichanges(status, d): |