Blame project/pydist.sh

107b64
#!/bin/sh
107b64
107b64
# pydist.sh: a reference-only, development-time script
107b64
# objective: generate pydist.in based on the scripts found
107b64
#            under $PYTHON_SRCDIR/Lib, excluding the 'test'
107b64
#            and 'plat-*' sub-directories.
107b64
107b64
set -eu
107b64
107b64
export LC_ALL=C
107b64
107b64
if [ -z "${PYTHON_SRCDIR:-}" ]; then
107b64
	printf 'Variable PYTHON_SRCDIR is not set!\n'
107b64
	exit 2
107b64
fi
107b64
107b64
cd -- "$PYTHON_SRCDIR/Lib"
107b64
107b64
pydirs=$(find . -type d | grep -v -e '^\./test' -e '^./plat-' | sort)
107b64
107b64
for pydir in $pydirs; do
107b64
	if [ $pydir = '.' ]; then
107b64
		pysrcs=*.py
107b64
		printf 'PYCDIR(,1)_\n'
107b64
	else
107b64
		pydir=${pydir#./}
107b64
107b64
		if ls $pydir/*.py > /dev/null 2>&1; then
107b64
			pysrcs=$pydir/*.py
107b64
			printf 'PYCDIR(%s,1)\n' $pydir
107b64
		else
107b64
			pysrcs=
107b64
			printf 'PYCDIR(%s,0)\n' $pydir
107b64
		fi
107b64
107b64
	fi
107b64
107b64
	for pysrc in $(printf '%s' "$pysrcs" | sort); do
107b64
		if [ "${pysrc##*/}" != 'py3_test_grammar.py' ]; then
107b64
			printf 'PYCSRC(%s)\n' "$pysrc"
107b64
		fi
107b64
	done
107b64
107b64
	printf '\n'
107b64
done