INNER CODE UNIT · Python
read_version
XRPLF/rippled · package/build_pkg.py:148
def read_version(xrpld: Path) -> str:
"""Read the version from the binary that is about to be packaged."""
fields = capture(xrpld, "--version").partition("\n")[0].split()
assert len(fields) >= 3, f"cannot read a version from {xrpld} --version"
return fields[2]
def check_binaries(build_dir: Path) -> None:
"""Fail unless the binaries and their notices are present and runnable."""
missing = [
name
for name in ("xrpld", "validator-keys")
if not os.access(build_dir / name, os.X_OK)
]
assert not missing, (
f"missing or not executable in {build_dir}: {' '.join(missing)}. "
"Both binaries come from a single CMake build directory configured with "
"-Dxrpld=ON -Dvalidator_keys=ON."