3 # mkconffiles - create _distribution and _patchlevel files in preparation
4 # for recreating `configure' from `configure.in'
7 # -s srcdir directory where `configure' resides (defaults to `.')
8 # -d outdir directory where the files should be written (defaults
11 # -n nocreate - don't create the output files
21 distname="_distribution"
22 patchname="_patchlevel"
24 while [ $# -gt 0 ]; do
26 -s) shift; srcdir="$1"; shift;;
27 -d) shift; outdir="$1"; shift;;
28 -v) shift; verbose=yes ;;
29 -n) shift; nocreate=yes;;
31 *) echo "${PROG}: usage: ${PROG} [-s srcdir] [-d outdir] [-nv]" >&2; exit 2;;
35 if [ ! -f ${srcdir}/configure ]; then
36 echo "${PROG}: ${srcdir}/configure not found" >&2
40 # default output directory to source directory
41 if [ -z "$outdir" ]; then
45 DISTRIB=`grep '^BASHVERS' ${srcdir}/configure | sed 's:.*=::'`
46 PATCH=`grep '^BASHPATCH' ${srcdir}/configure | sed 's:.*=::'`
48 if [ -n "$verbose" ]; then
49 echo "${PROG}: creating new distribution files for bash-${DISTRIB}.${PATCH} in ${outdir}"
52 distout=${outdir}/${distname}
53 patchout=${outdir}/${patchname}
55 if [ -z "$nocreate" ]; then
56 echo "$DISTRIB" > $distout
57 echo "$PATCH" > $patchout
60 if [ -n "$verbose" ]; then
61 echo "${PROG}: created $distout and $patchout"