def _write_manifest(source_dir_one, source_dir_two, dest_dir):
    'Writes a manifest file resulting from the merge of the manifest files for\n    the two given SDK directories.\n    '
    manifest_one = _get_manifest(source_dir_one)
    manifest_two = _get_manifest(source_dir_two)
    parts_one = set([Part(p) for p in manifest_one['parts']])
    parts_two = set([Part(p) for p in manifest_two['parts']])
    manifest = {'arch': {}}
    if (manifest_one['schema_version'] != manifest_two['schema_version']):
        print('Error: mismatching schema version')
        return False
    manifest['schema_version'] = manifest_one['schema_version']
    host_archs = set()
    if _has_host_content(parts_one):
        host_archs.add(manifest_one['arch']['host'])
    if _has_host_content(parts_two):
        host_archs.add(manifest_two['arch']['host'])
    if (not host_archs):
        host_archs.add(manifest_one['arch']['host'])
    if (len(host_archs) != 1):
        print(('Error: mismatching host architecture: %s' % ', '.join(host_archs)))
        return False
    manifest['arch']['host'] = list(host_archs)[0]
    if (manifest_one['id'] != manifest_two['id']):
        print('Error: mismatching id')
        return False
    manifest['id'] = manifest_one['id']
    if (manifest_one['root'] != manifest_two['root']):
        print('Error: mismatching root')
        return False
    manifest['root'] = manifest_one['root']
    manifest['arch']['target'] = sorted((set(manifest_one['arch']['target']) | set(manifest_two['arch']['target'])))
    manifest['parts'] = [vars(p) for p in sorted((parts_one | parts_two))]
    manifest_path = os.path.join(dest_dir, 'meta', 'manifest.json')
    _ensure_directory(manifest_path)
    with open(manifest_path, 'w') as manifest_file:
        json.dump(manifest, manifest_file, indent=2, sort_keys=True, separators=(',', ': '))
    return True
Writes a manifest file resulting from the merge of the manifest files for
the two given SDK directories.
def _write_manifest(source_dir_one, source_dir_two, dest_dir):
    'Writes a manifest file resulting from the merge of the manifest files for\n    the two given SDK directories.\n    '
    manifest_one = _get_manifest(source_dir_one)
    manifest_two = _get_manifest(source_dir_two)
    parts_one = set([Part(p) for p in manifest_one['parts']])
    parts_two = set([Part(p) for p in manifest_two['parts']])
    manifest = {'arch': {}}
    if (manifest_one['schema_version'] != manifest_two['schema_version']):
        print('Error: mismatching schema version')
        return False
    manifest['schema_version'] = manifest_one['schema_version']
    host_archs = set()
    if _has_host_content(parts_one):
        host_archs.add(manifest_one['arch']['host'])
    if _has_host_content(parts_two):
        host_archs.add(manifest_two['arch']['host'])
    if (not host_archs):
        host_archs.add(manifest_one['arch']['host'])
    if (len(host_archs) != 1):
        print(('Error: mismatching host architecture: %s' % ', '.join(host_archs)))
        return False
    manifest['arch']['host'] = list(host_archs)[0]
    if (manifest_one['id'] != manifest_two['id']):
        print('Error: mismatching id')
        return False
    manifest['id'] = manifest_one['id']
    if (manifest_one['root'] != manifest_two['root']):
        print('Error: mismatching root')
        return False
    manifest['root'] = manifest_one['root']
    manifest['arch']['target'] = sorted((set(manifest_one['arch']['target']) | set(manifest_two['arch']['target'])))
    manifest['parts'] = [vars(p) for p in sorted((parts_one | parts_two))]
    manifest_path = os.path.join(dest_dir, 'meta', 'manifest.json')
    _ensure_directory(manifest_path)
    with open(manifest_path, 'w') as manifest_file:
        json.dump(manifest, manifest_file, indent=2, sort_keys=True, separators=(',', ': '))
    return True