def CheckVintfFromExtractedTargetFiles(input_tmp, info_dict=None):
    '\n  Checks VINTF metadata of an extracted target files directory.\n\n  Args:\n    inp: path to the directory that contains the extracted target files archive.\n    info_dict: The build-time info dict. If None, it will be loaded from inp.\n\n  Returns:\n    True if VINTF check is skipped or compatible, False if incompatible. Raise\n    a RuntimeError if any error occurs.\n  '
    if (info_dict is None):
        info_dict = common.LoadInfoDict(input_tmp)
    if (info_dict.get('vintf_enforce') != 'true'):
        logger.warning('PRODUCT_ENFORCE_VINTF_MANIFEST is not set, skipping checks')
        return True
    dirmap = GetDirmap(input_tmp)
    args_for_skus = GetArgsForSkus(info_dict)
    shipping_api_level_args = GetArgsForShippingApiLevel(info_dict)
    kernel_args = GetArgsForKernel(input_tmp)
    common_command = ['checkvintf', '--check-compat']
    for (device_path, real_path) in dirmap.items():
        common_command += ['--dirmap', '{}:{}'.format(device_path, real_path)]
    common_command += kernel_args
    common_command += shipping_api_level_args
    success = True
    for sku_args in args_for_skus:
        command = (common_command + sku_args)
        proc = common.Run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (out, err) = proc.communicate()
        if (proc.returncode == 0):
            logger.info("Command `%s` returns 'compatible'", ' '.join(command))
        elif (out.strip() == 'INCOMPATIBLE'):
            logger.info("Command `%s` returns 'incompatible'", ' '.join(command))
            success = False
        else:
            raise common.ExternalError("Failed to run command '{}' (exit code {}):\nstdout:{}\nstderr:{}".format(' '.join(command), proc.returncode, out, err))
        logger.info('stdout: %s', out)
        logger.info('stderr: %s', err)
    return success
Checks VINTF metadata of an extracted target files directory.

Args:
  inp: path to the directory that contains the extracted target files archive.
  info_dict: The build-time info dict. If None, it will be loaded from inp.

Returns:
  True if VINTF check is skipped or compatible, False if incompatible. Raise
  a RuntimeError if any error occurs.
def CheckVintfFromExtractedTargetFiles(input_tmp, info_dict=None):
    '\n  Checks VINTF metadata of an extracted target files directory.\n\n  Args:\n    inp: path to the directory that contains the extracted target files archive.\n    info_dict: The build-time info dict. If None, it will be loaded from inp.\n\n  Returns:\n    True if VINTF check is skipped or compatible, False if incompatible. Raise\n    a RuntimeError if any error occurs.\n  '
    if (info_dict is None):
        info_dict = common.LoadInfoDict(input_tmp)
    if (info_dict.get('vintf_enforce') != 'true'):
        logger.warning('PRODUCT_ENFORCE_VINTF_MANIFEST is not set, skipping checks')
        return True
    dirmap = GetDirmap(input_tmp)
    args_for_skus = GetArgsForSkus(info_dict)
    shipping_api_level_args = GetArgsForShippingApiLevel(info_dict)
    kernel_args = GetArgsForKernel(input_tmp)
    common_command = ['checkvintf', '--check-compat']
    for (device_path, real_path) in dirmap.items():
        common_command += ['--dirmap', '{}:{}'.format(device_path, real_path)]
    common_command += kernel_args
    common_command += shipping_api_level_args
    success = True
    for sku_args in args_for_skus:
        command = (common_command + sku_args)
        proc = common.Run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        (out, err) = proc.communicate()
        if (proc.returncode == 0):
            logger.info("Command `%s` returns 'compatible'", ' '.join(command))
        elif (out.strip() == 'INCOMPATIBLE'):
            logger.info("Command `%s` returns 'incompatible'", ' '.join(command))
            success = False
        else:
            raise common.ExternalError("Failed to run command '{}' (exit code {}):\nstdout:{}\nstderr:{}".format(' '.join(command), proc.returncode, out, err))
        logger.info('stdout: %s', out)
        logger.info('stderr: %s', err)
    return success