INNER CODE UNIT · Python
conan_list_has
ExplosionEngine/Explosion · ThirdParty/ConanRecipes/build_recipes.py:165
def conan_list_has(args: argparse.Namespace, reference: str, package_id: str, remote: str | None) -> bool:
cmd = [args.conan, "list", f"{reference}:{package_id}", "--format=json"]
if remote:
cmd += ["-r", remote]
code, out = run_capture(cmd, cwd=args.recipes_root)
if code != 0:
return False
return list_has_binary(out, reference, package_id)
def package_status(args: argparse.Namespace, recipe: Recipe, create_extra: list[str]) -> str:
# Export so the local recipe revision (a hash of the recipe's contents) lands in the cache, then
# resolve the package id for the current profile via 'conan graph info'. With both in hand, query the
# local cache and (when a remote is configured) the remote for that exact recipe-revision +
# package-id binary -- 'conan graph info' alone cannot tell the two apart, since a cache hit masks the
# remote. Returns "remote" if published, "local" if only cached locally, else "build". Any
# uncertainty -- a failed export/query, unparseable output, a missing id -- yields "build", so the
# pre-check only ever short-circuits a sure hit, never a guess.