File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 11import os
2+ import re
23import shutil
34import subprocess
45import sys
56import tempfile
67from pathlib import Path
78
89
9- def get_branch (version : str ) -> str :
10- if version in ["1.0.2" , "1.1.1" ]:
11- return f"OpenSSL_{ version .replace ('.' , '_' )} -stable"
12- if version == "master" :
10+ def get_version_from_branch (branch : str ) -> str :
11+ if branch == "master" :
1312 return "master"
14- return f"openssl-{ version } "
13+ if match := re .match (r"openssl-(3\.[0-9]+)" , branch ):
14+ return match .group (1 )
15+ if branch == "OpenSSL_1_1_1-stable" :
16+ return "1.1.1"
17+ if branch == "OpenSSL_1_0_2-stable" :
18+ return "1.0.2"
19+ print (f"Incorrect branch { branch } " )
20+ raise SystemExit (1 )
1521
1622
1723def clone (branch : str , tmp_dir : str ) -> None :
@@ -71,11 +77,12 @@ def build_site(version: str):
7177
7278
7379def main ():
74- version = sys .argv [1 ]
80+ branch = sys .argv [1 ]
81+ version = get_version_from_branch (branch )
7582 clean_docs ()
7683 create_dirs ()
7784 with tempfile .TemporaryDirectory () as tmp_dir :
78- clone (get_branch ( version ) , tmp_dir )
85+ clone (branch , tmp_dir )
7986 if version not in ["1.0.2" , "1.1.1" ]:
8087 build_manpages (tmp_dir )
8188 convert_pod_to_md (tmp_dir )
You can’t perform that action at this time.
0 commit comments