gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: taler-terms-generator: support i


From: gnunet
Subject: [taler-exchange] branch master updated: taler-terms-generator: support incremental builds
Date: Wed, 10 Jan 2024 13:37:31 +0100

This is an automated email from the git hooks/post-receive script.

dold pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new e0cc5c9c taler-terms-generator: support incremental builds
e0cc5c9c is described below

commit e0cc5c9caf3953ee8409fad854ab894fd1a521e7
Author: Florian Dold <florian@dold.me>
AuthorDate: Wed Jan 10 13:35:57 2024 +0100

    taler-terms-generator: support incremental builds
---
 contrib/taler-terms-generator | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/contrib/taler-terms-generator b/contrib/taler-terms-generator
index 34659953..4f348ae7 100755
--- a/contrib/taler-terms-generator
+++ b/contrib/taler-terms-generator
@@ -95,9 +95,10 @@ LOCALE_DIR=$(taler-config -s "PATHS" -o "LOCALEDIR" -f)
 OUTPUT=$(taler-config -s "EXCHANGE" -o "TERMS_DIR" -f)
 PAPER="a4"
 COPYRIGHT="2014-2023 Taler Systems SA (GPLv3+ or GFDL 1.3+)"
+INCREMENTAL=0
 
 # Parse command-line options
-while getopts ':a:C:hi:l:L:o:p:t:' OPTION; do
+while getopts ':a:C:hKi:l:L:o:p:t:' OPTION; do
     case "$OPTION" in
         a)
             AUTHOR="$OPTARG"
@@ -110,6 +111,7 @@ while getopts ':a:C:hi:l:L:o:p:t:' OPTION; do
             echo '  -a AUTHOR     -- set author header' "(default: $AUTHOR)"
             echo '  -C COPYRIGHT  -- set copyright header' "(default: 
$COPYRIGHT)"
             echo '  -h            -- print this help'
+            echo '  -K            -- rebuild only if input is older than 
output'
             echo '  -i INPUT      -- input file to convert' "(default: 
$VERSION)"
             echo '  -l LANGUAGE   -- target language to add'
             echo '  -L LOCALE_DIR -- directory with resources for translation' 
"(default: $LOCALE_DIR)"
@@ -144,6 +146,9 @@ while getopts ':a:C:hi:l:L:o:p:t:' OPTION; do
         t)
             TITLE="$OPTARG"
             ;;
+        K)
+            INCREMENTAL=1
+            ;;
         ?)
         echo "Unrecognized command line option" 1>&2
         exit 1
@@ -163,6 +168,12 @@ then
     exit 1
 fi
 
+if ! which make > /dev/null
+then
+    echo "Command 'make' not found, but required. Please install make." 1>&2
+    exit 1
+fi
+
 # We append ".rst" if needed, remove if given on command-line
 # shellcheck disable=SC2001
 VERSION=$(echo "${VERSION}" | sed -e "s/\.rst$//")
@@ -220,6 +231,17 @@ then
     exit 0
 fi
 
+# As a heuristic for incremental builds, we only check the text output file.
+if [[ "$INCREMENTAL" -eq 1 ]]
+then
+  if [[ "$VERSION" -ot "${OUTPUT}/buildstamp" ]];
+  then
+    echo "Not rebuilding, input file $VERSION is older than 
$OUTPUT/buildstamp."
+    exit 0
+  fi
+fi
+
+
 # shellcheck disable=SC2086
 for d in en $(ls -d ${LOCALE_DIR}/?? | grep -v "en" 2> /dev/null || true)
 do
@@ -306,5 +328,10 @@ do
     mv "${BUILDDIR}/pdf/${VERSION_BASENAME}.pdf" 
"${OUTPUT}/${LANGUAGE}/${VERSION_BASENAME}.pdf"
 done
 
+if [[ "$INCREMENTAL" -eq 1 ]]
+then
+  touch "${OUTPUT}/buildstamp";
+fi
+
 echo "Done" 1>&2
 exit 0

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]