From 107b6416edf602859578e7592abb0c4e457936dc Mon Sep 17 00:00:00 2001 From: midipix Date: Tue, 15 Jun 2021 12:43:10 +0000 Subject: project: pydist overhaul: integrated the new m4-based logic. --- project/pydist.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100755 project/pydist.sh (limited to 'project/pydist.sh') diff --git a/project/pydist.sh b/project/pydist.sh new file mode 100755 index 0000000..d5dd8f1 --- /dev/null +++ b/project/pydist.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# pydist.sh: a reference-only, development-time script +# objective: generate pydist.in based on the scripts found +# under $PYTHON_SRCDIR/Lib, excluding the 'test' +# and 'plat-*' sub-directories. + +set -eu + +export LC_ALL=C + +if [ -z "${PYTHON_SRCDIR:-}" ]; then + printf 'Variable PYTHON_SRCDIR is not set!\n' + exit 2 +fi + +cd -- "$PYTHON_SRCDIR/Lib" + +pydirs=$(find . -type d | grep -v -e '^\./test' -e '^./plat-' | sort) + +for pydir in $pydirs; do + if [ $pydir = '.' ]; then + pysrcs=*.py + printf 'PYCDIR(,1)_\n' + else + pydir=${pydir#./} + + if ls $pydir/*.py > /dev/null 2>&1; then + pysrcs=$pydir/*.py + printf 'PYCDIR(%s,1)\n' $pydir + else + pysrcs= + printf 'PYCDIR(%s,0)\n' $pydir + fi + + fi + + for pysrc in $(printf '%s' "$pysrcs" | sort); do + if [ "${pysrc##*/}" != 'py3_test_grammar.py' ]; then + printf 'PYCSRC(%s)\n' "$pysrc" + fi + done + + printf '\n' +done -- cgit v1.2.3