From e1bbc39237c27e0eb97d7061ca003e58e76a7833 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 20 Mar 2013 17:21:29 +0000 Subject: [PATCH] update.py: improve handling of machine descriptions Fall back to NAME if DESCRIPTION is not specified and remove more preamble from the string. Signed-off-by: Paul Eggleton --- layerindex/update.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/layerindex/update.py b/layerindex/update.py index 8e7acce..0cb8012 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -114,13 +114,16 @@ def update_recipe_file(data, path, recipe, layerdir_start, repodir): def update_machine_conf_file(path, machine): logger.debug('Updating machine %s' % path) + desc = "" with open(path, 'r') as f: for line in f: + if line.startswith('#@NAME:'): + desc = line[7:].strip() if line.startswith('#@DESCRIPTION:'): desc = line[14:].strip() - desc = re.sub(r'Machine configuration for (the )*', '', desc) - machine.description = desc + desc = re.sub(r'Machine configuration for( running)*( an)*( the)*', '', desc) break + machine.description = desc def parse_layer_conf(layerdir, data): data.setVar('LAYERDIR', str(layerdir))