22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj#!/bin/sh
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein#
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# Find all config files (config*.m4) and map them into lines with the
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# form: NUM? '0' ' ' PATH
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein#
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# For example:
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein#
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# 50 ./modules/generators/config5.m4
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# 0 ./modules/aaa/config.m4
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# 10 ./example/config1.m4
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein#
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# These lines are sorted, then the first field is removed. Thus, we
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# have a set of paths sorted on the config-number (if present). All
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein# config files without a number are sorted before those with a number.
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein#
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein
2540bc483021296863cfff2d77b7d3c05b217e0fsfconfigfiles=`find os server modules support -name "config*.m4" | \
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein sed 's#\(.*/config\)\(.*\).m4#\20 \1\2.m4#' | \
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein sort | \
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein sed 's#.* ##'`
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgsteinfor configfile in $configfiles; do
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein if [ -r $configfile ]; then
a3d4338d74be03b3ecc9381c55aa2e76215c3edbgstein echo "sinclude($configfile)"
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanoj fi
22ad84685642948ad15cc1e881ecbc4ac8cbf98cmanojdone