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
16 # Copyright (C) 1996-2002 Free Software Foundation, Inc.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2, or (at your option)
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
37 distname="_distribution"
38 patchname="_patchlevel"
40 while [ $# -gt 0 ]; do
42 -s) shift; srcdir="$1"; shift;;
43 -d) shift; outdir="$1"; shift;;
44 -v) shift; verbose=yes ;;
45 -n) shift; nocreate=yes;;
47 *) echo "${PROG}: usage: ${PROG} [-s srcdir] [-d outdir] [-nv]" >&2; exit 2;;
51 if [ ! -f ${srcdir}/configure ]; then
52 echo "${PROG}: ${srcdir}/configure not found" >&2
56 # default output directory to source directory
57 if [ -z "$outdir" ]; then
61 DISTRIB=`grep '^BASHVERS' ${srcdir}/configure | sed 's:.*=::'`
62 PATCH=`grep '^BASHPATCH' ${srcdir}/configure | sed 's:.*=::'`
64 if [ -n "$verbose" ]; then
65 echo "${PROG}: creating new distribution files for bash-${DISTRIB}.${PATCH} in ${outdir}"
68 distout=${outdir}/${distname}
69 patchout=${outdir}/${patchname}
71 if [ -z "$nocreate" ]; then
72 echo "$DISTRIB" > $distout
73 echo "$PATCH" > $patchout
76 if [ -n "$verbose" ]; then
77 echo "${PROG}: created $distout and $patchout"