scripts: check-doc-rules tries local bin first

If the point is to check the docs for added changes, it makes sense to
that used binary is the one that comes with the doc changes. Thus, try
using the local binary first, before falling back to usr/bin installed
Suricata.
pull/16079/head
Juliana Fajardini 3 weeks ago committed by Victor Julien
parent 398687d5d4
commit f3e27b0e41

@ -90,6 +90,14 @@ def iter_rst_files(path: Path) -> Iterable[Path]:
def resolve_suricata_bin(repo_root: Path, configured: Optional[str]) -> Path:
candidates = [repo_root / "src" / "suricata", repo_root / "suricata"]
# First check for local repo, as there may be patches to test.
# Then look for the Path option.
for candidate in candidates:
if candidate.exists():
return candidate
if configured:
return Path(configured)
@ -97,11 +105,6 @@ def resolve_suricata_bin(repo_root: Path, configured: Optional[str]) -> Path:
if in_path:
return Path(in_path)
candidates = [repo_root / "src" / "suricata", repo_root / "suricata"]
for candidate in candidates:
if candidate.exists():
return candidate
raise SystemExit(
"Unable to find Suricata binary. Use --suricata-bin to provide it."
)

Loading…
Cancel
Save