Skip to content

Commit d57bcd8

Browse files
committed
Allow for having multiple patches per release
1 parent b460f41 commit d57bcd8

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

docs/build_old_docs.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ def clone_repo_to(dest: Path):
2525
os.symlink(REPO_ROOT / "target", dest / "target")
2626

2727

28+
def apply_patches_for_release(release: str, repo_path: Path) -> None:
29+
"""Apply patches (if any) for the given release."""
30+
patches_dir = DOCS_DIR / "release" / "patches" / release
31+
for patch_path in sorted(patches_dir.glob("*.patch")):
32+
sp.run(("git", "-C", str(repo_path), "am", str(patch_path)), check=True)
33+
34+
2835
def build_docs_for_release(release: str, repo_path: Path, outdir: Path) -> None:
2936
"""Build documentation for a given release."""
3037
print(f"Building docs for {release}")
@@ -36,10 +43,8 @@ def build_docs_for_release(release: str, repo_path: Path, outdir: Path) -> None:
3643
capture_output=True,
3744
)
3845

39-
# Apply patch, if there is one
40-
patch_path = DOCS_DIR / "release" / "patches" / f"{release}.patch"
41-
if patch_path.exists():
42-
sp.run(("git", "-C", str(repo_path), "am", str(patch_path)), check=True)
46+
# Apply patches, if any
47+
apply_patches_for_release(release, repo_path)
4348

4449
# Build docs
4550
sp.run(("just", f"{repo_path!s}/build-docs"), capture_output=True, check=True)

docs/release/patches/v2.0.0.patch renamed to docs/release/patches/v2.0.0/0001-remove-unrecognised-parameter.patch

File renamed without changes.

0 commit comments

Comments
 (0)