| |
@@ -26,6 +26,10 @@
|
| |
help="Should we commit translated sources?")
|
| |
parser.add_argument("--component", required=False,
|
| |
help="Antora component to convert, all if unset")
|
| |
+ parser.add_argument("--clone-po4a", action='store_true',
|
| |
+ help="Use a local checkout of po4a")
|
| |
+ parser.add_argument("--clone-po4a-version", default='v0.57',
|
| |
+ help="Set the version for checkout of po4a")
|
| |
args = parser.parse_args()
|
| |
|
| |
SELECTED_COMPONENT = args.component
|
| |
@@ -39,6 +43,9 @@
|
| |
|
| |
open("errors.txt", "w").close()
|
| |
|
| |
+ if args.clone_po4a:
|
| |
+ clone_po4a(args.clone_po4a_version)
|
| |
+
|
| |
if args.clone_sources == "true":
|
| |
clone_sources()
|
| |
|
| |
@@ -51,6 +58,20 @@
|
| |
if args.commit_tsources == "true":
|
| |
commit_translated_source()
|
| |
|
| |
+
|
| |
+ def clone_po4a(version):
|
| |
+ """Clone po4a, since the one in RHEL 7 is too old"""
|
| |
+ print("Clone po4a version %s" % version)
|
| |
+ repo_dir = '%s/po4a' % os.getcwd()
|
| |
+
|
| |
+ if os.path.exists(repo_dir):
|
| |
+ subprocess.run(['git', 'fetch'], check=True, cwd=repo_dir)
|
| |
+ else:
|
| |
+ subprocess.run(["git", "clone", "https://github.com/mquinson/po4a" ], check=True)
|
| |
+ subprocess.run(['git', 'checkout', version], check=True, cwd=repo_dir)
|
| |
+ os.environ['PATH'] = "%s/:%s" % (repo_dir, os.environ['PATH'])
|
| |
+ os.environ['PERL5LIB'] = repo_dir + '/lib'
|
| |
+
|
| |
def call_src_to_pot(url, branch='master', basedir='/', module="ROOT"):
|
| |
"""Call src-to-ot.sh to convert english source (adoc) content to pot files"""
|
| |
print("call_src_to_pot: "+url +" b:"+ branch +" bd:"+ basedir +" m:"+ module)
|
| |
Since EL7 do not have a recent enough po4a, we need that
so we can build the pot file on sundries. Once this move to
a newer platform, this code can be removed.