From d17f585bc4004549b4c3d45b3d7d8613c3f0a6a0 Mon Sep 17 00:00:00 2001 From: Cyril Romain Date: Tue, 12 Sep 2006 21:40:28 +0000 Subject: contrib/sanitize.py: Fix a hang when processing comment block and fix some erroneous for loop usage. --- contrib/sanitize.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'contrib') diff --git a/contrib/sanitize.py b/contrib/sanitize.py index 028b2cc535..41264a56e3 100755 --- a/contrib/sanitize.py +++ b/contrib/sanitize.py @@ -362,9 +362,8 @@ if __name__ == "__main__": continue if seen_vars.has_key(var): - for c in commentBloc: - seen_vars[var].append(c) - commentBloc = [] + for c in commentBloc: seen_vars[var].append(c) + commentBloc = [] seen_vars[var].append(line) else: for k in OE_vars: @@ -382,17 +381,15 @@ if __name__ == "__main__": if not in_routine: print "## Warning: unknown variable/routine \"%s\"" % originalLine var = 'others' - for c in commentBloc: - seen_vars[var].append(c) - commentBloc = [] + for c in commentBloc: seen_vars[var].append(c) + commentBloc = [] seen_vars[var].append(line) if not keep and not in_routine: var = "" # -- dump the sanitized .bb file -- addEmptyLine = False # write comments that are not related to variables nor routines - for l in olines: - olines.append(l) + for l in commentBloc: olines.append(l) # write variables and routines previourVarPrefix = "unknown" for k in OE_vars: -- cgit v1.2.3