if (action == 'reinstall') or (action == 'remove'):
            match = reinstall_regex.match(line)
            if match:
                result[action][match.group(1)] = {
                    'version': {