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 1
1
import os
2
+ import re
2
3
import shutil
3
4
import subprocess
4
5
import sys
5
6
import tempfile
6
7
from pathlib import Path
7
8
8
9
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" :
13
12
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 )
15
21
16
22
17
23
def clone (branch : str , tmp_dir : str ) -> None :
@@ -71,11 +77,12 @@ def build_site(version: str):
71
77
72
78
73
79
def main ():
74
- version = sys .argv [1 ]
80
+ branch = sys .argv [1 ]
81
+ version = get_version_from_branch (branch )
75
82
clean_docs ()
76
83
create_dirs ()
77
84
with tempfile .TemporaryDirectory () as tmp_dir :
78
- clone (get_branch ( version ) , tmp_dir )
85
+ clone (branch , tmp_dir )
79
86
if version not in ["1.0.2" , "1.1.1" ]:
80
87
build_manpages (tmp_dir )
81
88
convert_pod_to_md (tmp_dir )
You can’t perform that action at this time.
0 commit comments