diff options
author | Florian Dold <florian@dold.me> | 2024-01-10 12:56:33 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-01-10 12:56:33 +0100 |
commit | 2d4d0e7ef13016fd876c288096d4d62575403f76 (patch) | |
tree | 446396794563e3ac30e0852105b1d9dc7a7b0300 /contrib | |
parent | 6660627634096ec695bebab5663667b19212e5f7 (diff) |
terms generator: accept input file path instead of just a basename
The taler-terms-generator broke when an actual path instead of just a
basename was passed.
Also, the usage of sed was wrong and unnecessary.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/taler-terms-generator | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/contrib/taler-terms-generator b/contrib/taler-terms-generator index 0e6946eaf..346599535 100755 --- a/contrib/taler-terms-generator +++ b/contrib/taler-terms-generator @@ -26,14 +26,7 @@ set -eu # Call with target language as first argument. function make_config() { - XLOC=$(echo "$LOCALE_DIR" | sed -e "s/\//\\\\\\//g") - sed -e "s/%VERSION%/$VERSION/g" \ - -e "s/%TITLE%/$TITLE/g" \ - -e "s/%AUTHOR%/$AUTHOR/g" \ - -e "s/%LOCALE_DIR%/$XLOC/g" \ - -e "s/%COPYRIGHT%/$COPYRIGHT/g" \ - -e "s/%LANGUAGE%/$1/g" \ - > "${BUILDDIR}/conf.py" <<EOF + cat > "${BUILDDIR}/conf.py" <<EOF import sys import os sys.path.append(os.path.abspath('_exts')) @@ -47,14 +40,14 @@ templates_path = ['_templates'] source_suffix = { '.rst': 'restructuredtext', } -master_doc = '%VERSION%' -project = u'%VERSION%' -copyright = u'%COPYRIGHT%' -version = '%VERSION%' -release = '%VERSION%' -language = "%LANGUAGE%" +master_doc = '$VERSION_BASENAME' +project = u'$VERSION_BASENAME' +copyright = u'$COPYRIGHT' +version = '$VERSION_BASENAME' +release = '$VERSION_BASENAME' +language = "$LANGUAGE" exclude_patterns = ['_build', '_exts', 'cf', 'prebuilt'] -locale_dirs = ['%LOCALE_DIR%/'] +locale_dirs = ['$LOCALE_DIR/'] gettext_compact = False pygments_style = 'sphinx' html_theme = 'epub' @@ -64,8 +57,8 @@ html_theme_options = { "relbar1": "false", "footer": "false", } -html_title = "%TITLE%" -html_short_title = "%TITLE%" +html_title = "$TITLE" +html_short_title = "$TITLE" html_use_index = True html_show_sphinx = False latex_elements = { @@ -79,11 +72,11 @@ latex_elements = { #'preamble': '', } latex_documents = [ - ('%VERSION%', '%VERSION%.tex', - '%TITLE%', '%AUTHOR%', 'manual'), + ('$VERSION_BASENAME', '$VERSION_BASENAME.tex', + '$VERSION_BASENAME', '$VERSION_BASENAME', 'manual'), ] -epub_basename = "%VERSION%" -epub_title = "%TITLE%" +epub_basename = "$VERSION_BASENAME" +epub_title = "$TITLE" EOF } |