Update of /cvsroot/mingw/msys/packages/bash/2.05b/support In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10360/2.05b/support Added Files: Makefile.in SYMLINKS bash.xbm bashbug.sh bashversion.c config.guess config.sub fixlinks install.sh man2html.c missing mkclone mkconffiles mkdirs mksignames.c mkversion.sh printenv.c printenv.sh recho.c rlvers.sh shobj-conf texi2dvi texi2html xenix-link.sh zecho.c Log Message: Pristine source --- NEW FILE: SYMLINKS --- # # symlink map for bash source tree # # link name link target # lib/readline/tilde.c ../tilde/tilde.c lib/readline/tilde.h ../tilde/tilde.h # lib/readline/ansi_stdlib.h ../../include/ansi_stdlib.h lib/readline/posixdir.h ../../include/posixdir.h lib/readline/posixjmp.h ../../include/posixjmp.h lib/readline/posixstat.h ../../include/posixstat.h #lib/readline/rlstdc.h ../../include/stdc.h #lib/readline/xmalloc.c ../malloc/xmalloc.c # #lib/tilde/memalloc.h ../../include/memalloc.h # --- NEW FILE: fixlinks --- #! /bin/sh # # fixlinks - make symlinks in the bash source tree so that there is # exactly one version of any given source file. # # Copyright (C) 1996-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. SRCDIR=. while [ $# -gt 0 ]; do case "$1" in -s) shift; SRCDIR=$1 ;; -u) unfix=yes ;; -h) hardlinks=yes ;; -*) echo "$0: $1: bad option" 1>&2 echo "$0: usage: $0 [-hu] [-s srcdir] [linkmap]" 1>&2 exit 1;; *) break ;; esac shift done if [ ! -d $SRCDIR/builtins ]; then echo "$0: must be run with valid -s argument or from source directory" 1>&2 exit 1 fi if [ $# -eq 0 ]; then linkfile=$SRCDIR/support/SYMLINKS else linkfile=$1 fi if [ ! -f "$linkfile" ]; then echo "$0: symlink map file \`$linkfile' does not exist" exit 1 fi rm_ltmp=false LINKTEMP=`mktemp -t linktmp.XXXXXXXX 2>/dev/null` if [ -z "$LINKTEMP" ]; then : ${TMPDIR:=/tmp} LINKTEMP=${TMPDIR}/linktmp.$$ rm_ltmp=true fi $rm_ltmp && rm -f ${LINKTEMP} # if the user specified hard links, then do that. otherwise, try to use # symlinks if they're present if [ -n "$hardlinks" ]; then LN=ln elif (ln -s /dev/null ${LINKTEMP}) >/dev/null 2>&1; then LN="ln -s" else LN=ln fi rm -f ${LINKTEMP} while read name target do case "$name" in \#*) continue;; esac rm -f $name case "$unfix" in yes) dirname=`expr "$name" ':' '^\(.*\)/[^/]*'` [ -z "$dirname" ] && dirname=. cp $dirname/$target $name echo $target copied to $name ;; *) $LN $target $name ; echo "$name -> $target" ;; esac done < $linkfile exit 0 --- NEW FILE: rlvers.sh --- #! /bin/sh # # rlvers.sh -- run a program that prints out the readline version number # using locally-installed readline libraries # # Copyright (C) 1996-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. PROGNAME=`basename $0` : ${TMPDIR:=/tmp} TDIR=$TMPDIR/rlvers # defaults CC=cc RL_LIBDIR=/usr/local/lib RL_INCDIR=/usr/local/include TERMCAP_LIB="-ltermcap" # cannot rely on the presence of getopts while [ $# -gt 0 ]; do case "$1" in -C) shift ; CC="$1"; shift ;; -I) shift ; RL_INCDIR="$1" ; shift ;; -L) shift ; RL_LIBDIR="$1" ; shift ;; -T) shift ; TERMCAP_LIB="$1" ; shift ;; -v) shift ; verbose=y ;; --) shift ; break ;; *) echo "${PROGNAME}: usage: $PROGNAME [-C compiler] [-L libdir] [-v]" >&2 ; exit 2;; esac done # if someone happened to install examples/rlversion, use it (it's not # installed by default) if test -f ${RL_LIBDIR}/rlversion ; then if [ -n "$verbose" ]; then echo "${PROGNAME}: using installed rlversion from ${RL_LIBDIR}/rlversion" fi v=`${RL_LIBDIR}/rlversion 2>/dev/null` case "$v" in unknown | "") echo 0 ;; *) echo "$v" ;; esac exit 0 fi if [ -n "$verbose" ]; then echo "${PROGNAME}: using ${RL_LIBDIR} to find libreadline" echo "${PROGNAME}: attempting program compilation" fi # make $TDIR mode 0700 mkdir $TDIR || { echo "${PROGNAME}: ${TDIR}: file exists" >&2 echo 0 exit 1 } chmod 700 $TDIR trap 'rm -f $TDIR/rlvers $TDIR/rlvers.? ; rmdir $TDIR' 0 1 2 3 6 15 cat > $TDIR/rlvers.c << EOF #include <stdio.h> extern char *rl_library_version; main() { printf("%s\n", rl_library_version ? rl_library_version : "0"); exit(0); } EOF opwd=`pwd` cd $TDIR || { echo "${PROGNAME}: cannot cd to $TDIR" >&2 echo 0 exit 1 } if eval ${CC} -L${RL_LIBDIR} -I${RL_INCDIR} -o $TDIR/rlvers $TDIR/rlvers.c -lreadline ${TERMCAP_LIB}; then v=`$TDIR/rlvers` else if [ -n "$verbose" ] ; then echo "${PROGNAME}: compilation failed: status $?" echo "${PROGNAME}: using version 0" fi v=0 fi case "$v" in unknown | "") echo 0 ;; *) echo "$v" ;; esac cd $opwd exit 0 --- NEW FILE: missing --- #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard <pi...@ir...>, 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing - GNU libit 0.0" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`configure.in'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` if test -z "$files"; then files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` test -z "$files" || files="$files.in" else files=`echo "$files" | sed -e 's/:/ /g'` fi test -z "$files" && files="config.h.in" touch $files ;; automake) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print \ | sed 's/^\(.*\).am$/touch \1.in/' \ | sh ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 --- NEW FILE: Makefile.in --- # # Simple Makefile for the support programs. # # documentation support: man2html # testing support: printenv recho zecho # # bashbug lives here but is created by the top-level makefile # # Currently only man2html is built # # # Copyright (C) 1998 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. # # Boilerplate # topdir = @top_srcdir@ srcdir = @srcdir@ VPATH = .:@srcdir@ BUILD_DIR = @BUILD_DIR@ RM = rm -f SHELL = @MAKE_SHELL@ CC = @CC@ EXEEXT = @EXEEXT@ # # Compiler options: # PROFILE_FLAGS = @PROFILE_FLAGS@ CFLAGS = @CFLAGS@ CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ DEFS = @DEFS@ LOCAL_DEFS = @LOCAL_DEFS@ LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS) LDFLAGS_FOR_BUILD = $(LDFLAGS) INCLUDES = -I${BUILD_DIR} -I${topdir} BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \ ${INCLUDES} $(LOCAL_CFLAGS) CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS) CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) SRC1 = man2html.c OBJ1 = man2html.o .c.o: $(RM) $@ $(CC_FOR_BUILD) -c $(CCFLAGS_FOR_BUILD) $< all: man2html$(EXEEXT) man2html$(EXEEXT): $(OBJ1) $(CC) $(CCFLAGS) $(OBJ1) -o $@ ${LIBS} clean: rm man2html man2html.o: man2html.c --- NEW FILE: bashversion.c --- /* bashversion.c -- Display bash version information. */ /* Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #include "config.h" #include "stdc.h" #include <stdio.h> #if defined (HAVE_UNISTD_H) # include <unistd.h> #endif #include "bashansi.h" #include "version.h" #include "conftypes.h" #define RFLAG 0x0001 #define VFLAG 0x0002 #define MFLAG 0x0004 #define PFLAG 0x0008 #define SFLAG 0x0010 #define LFLAG 0x0020 #define XFLAG 0x0040 extern int optind; extern char *optarg; extern char *dist_version; extern int patch_level; char *shell_name = "bash"; char *progname; static void usage() { fprintf(stderr, "%s: usage: %s [-hrvpmlsx]\n", progname, progname); } int main (argc, argv) int argc; char **argv; { int opt, oflags; char dv[128], *rv; if (progname = strrchr (argv[0], '/')) progname++; else progname = argv[0]; oflags = 0; while ((opt = getopt(argc, argv, "hrvmpslx")) != EOF) { switch (opt) { case 'h': usage (); exit (0); case 'r': oflags |= RFLAG; /* release */ break; case 'v': oflags |= VFLAG; /* version */ break; case 'm': oflags |= MFLAG; /* machtype */ break; case 'p': oflags |= PFLAG; /* patchlevel */ break; case 's': /* short version string */ oflags |= SFLAG; break; case 'l': /* long version string */ oflags |= LFLAG; break; case 'x': /* extended version information */ oflags |= XFLAG; break; default: usage (); exit (2); } } argc -= optind; argv += optind; if (argc > 0) { usage (); exit (2); } /* default behavior */ if (oflags == 0) oflags = SFLAG; if (oflags & (RFLAG|VFLAG)) { strcpy (dv, dist_version); rv = strchr (dv, '.'); if (rv) *rv++ = '\0'; else rv = "00"; } if (oflags & RFLAG) printf ("%s\n", dv); else if (oflags & VFLAG) printf ("%s\n", rv); else if (oflags & MFLAG) printf ("%s\n", MACHTYPE); else if (oflags & PFLAG) printf ("%d\n", patch_level); else if (oflags & SFLAG) printf ("%s\n", shell_version_string ()); else if (oflags & LFLAG) show_shell_version (0); else if (oflags & XFLAG) show_shell_version (1); exit (0); } --- NEW FILE: mkconffiles --- #! /bin/sh # # mkconffiles - create _distribution and _patchlevel files in preparation # for recreating `configure' from `configure.in' # # options: # -s srcdir directory where `configure' resides (defaults to `.') # -d outdir directory where the files should be written (defaults # to "$srcdir") # -v verbose # -n nocreate - don't create the output files # # Chet Ramey # ch...@po... # Copyright (C) 1996-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. PROG=`basename $0` # defaults srcdir=. distname="_distribution" patchname="_patchlevel" while [ $# -gt 0 ]; do case "$1" in -s) shift; srcdir="$1"; shift;; -d) shift; outdir="$1"; shift;; -v) shift; verbose=yes ;; -n) shift; nocreate=yes;; --) shift; break;; *) echo "${PROG}: usage: ${PROG} [-s srcdir] [-d outdir] [-nv]" >&2; exit 2;; esac done if [ ! -f ${srcdir}/configure ]; then echo "${PROG}: ${srcdir}/configure not found" >&2 exit 1 fi # default output directory to source directory if [ -z "$outdir" ]; then outdir=${srcdir} fi DISTRIB=`grep '^BASHVERS' ${srcdir}/configure | sed 's:.*=::'` PATCH=`grep '^BASHPATCH' ${srcdir}/configure | sed 's:.*=::'` if [ -n "$verbose" ]; then echo "${PROG}: creating new distribution files for bash-${DISTRIB}.${PATCH} in ${outdir}" fi distout=${outdir}/${distname} patchout=${outdir}/${patchname} if [ -z "$nocreate" ]; then echo "$DISTRIB" > $distout echo "$PATCH" > $patchout fi if [ -n "$verbose" ]; then echo "${PROG}: created $distout and $patchout" fi exit 0 --- NEW FILE: bashbug.sh --- #!/bin/sh - # # bashbug - create a bug report and mail it to the bug address # # The bug address depends on the release status of the shell. Versions # with status `devel', `alpha', `beta', or `rc' mail bug reports to # ch...@po... and, optionally, to bas...@po.... # Other versions send mail to bug...@gn.... # # Copyright (C) 1996-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. # # configuration section: # these variables are filled in by the make target in Makefile # MACHINE="!MACHINE!" OS="!OS!" CC="!CC!" CFLAGS="!CFLAGS!" RELEASE="!RELEASE!" PATCHLEVEL="!PATCHLEVEL!" RELSTATUS="!RELSTATUS!" MACHTYPE="!MACHTYPE!" PATH=/bin:/usr/bin:/usr/local/bin:$PATH export PATH # If the OS supplies a program to make temp files with semi-random names, # use it. : ${TMPDIR:=/tmp} rm_tmp1=false rm_tmp2=false # if we don't have mktemp or tempfile, we don't want to see error messages # like `mktemp: not found', so temporarily redirect stderr using {...} while # trying to run them. this may fail using old versions of the bourne shell # that run {...} blocks with redirections in subshells; in that case we're # no worse off than previous versions { TEMPFILE1=`mktemp "$TMPDIR/bbug.XXXXXX" 2>/dev/null` ; } 2>/dev/null if [ -z "$TEMPFILE1" ]; then { TEMPFILE1=`tempfile --prefix bbug --mode 600 2>/dev/null`; } 2>/dev/null fi if [ -z "$TEMPFILE1" ]; then TEMPFILE1=$TMPDIR/bbug.$$ rm_tmp1=true fi { TEMPFILE2=`mktemp "$TMPDIR/bbug.XXXXXX" 2>/dev/null`; } 2>/dev/null if [ -z "$TEMPFILE2" ]; then { TEMPFILE2=`tempfile --prefix bbug --mode 600 2>/dev/null`; } 2>/dev/null fi if [ -z "$TEMPFILE2" ]; then TEMPFILE2="$TMPDIR/bbug.$$.x" rm_tmp2=true fi USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]" VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}" do_help= do_version= while [ $# -gt 0 ]; do case "$1" in --help) shift ; do_help=y ;; --version) shift ; do_version=y ;; --) shift ; break ;; -*) echo "bashbug: ${1}: invalid option" >&2 echo "$USAGE" >& 2 exit 2 ;; *) break ;; esac done if [ -n "$do_version" ]; then echo "${VERSTR}" exit 0 fi if [ -n "$do_help" ]; then echo "${VERSTR}" echo "${USAGE}" echo cat << HERE_EOF Bashbug is used to send mail to the Bash maintainers for when Bash doesn't behave like you'd like, or expect. Bashbug will start up your editor (as defined by the shell's EDITOR environment variable) with a preformatted bug report template for you to fill in. The report will be mailed to the bash maintainers by default. See the manual for details. If you invoke bashbug by accident, just quit your editor without saving any changes to the template, and no bug report will be sent. HERE_EOF exit 0 fi # Figure out how to echo a string without a trailing newline N=`echo 'hi there\c'` case "$N" in *c) n=-n c= ;; *) n= c='\c' ;; esac BASHTESTERS="bas...@po..." case "$RELSTATUS" in alpha*|beta*|devel*|rc*) BUG...@po... ;; *) BUG...@gn... ;; esac case "$RELSTATUS" in alpha*|beta*|devel*|rc*) echo "$0: This is a testing release. Would you like your bug report" echo "$0: to be sent to the bash-testers mailing list?" echo $n "$0: Send to bash-testers? $c" read ans case "$ans" in y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;; esac ;; esac BUGADDR="${1-$BUGBASH}" if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then if [ -x /usr/bin/editor ]; then DEFEDITOR=editor elif [ -x /usr/local/bin/ce ]; then DEFEDITOR=ce elif [ -x /usr/local/bin/emacs ]; then DEFEDITOR=emacs elif [ -x /usr/contrib/bin/emacs ]; then DEFEDITOR=emacs elif [ -x /usr/bin/emacs ]; then DEFEDITOR=emacs elif [ -x /usr/bin/xemacs ]; then DEFEDITOR=xemacs elif [ -x /usr/contrib/bin/jove ]; then DEFEDITOR=jove elif [ -x /usr/local/bin/jove ]; then DEFEDITOR=jove elif [ -x /usr/bin/vi ]; then DEFEDITOR=vi else echo "$0: No default editor found: attempting to use vi" >&2 DEFEDITOR=vi fi fi : ${EDITOR=$DEFEDITOR} : ${USER=${LOGNAME-`whoami`}} trap 'rm -f "$TEMPFILE1" "$TEMPFILE2"; exit 1' 1 2 3 13 15 trap 'rm -f "$TEMPFILE1" "$TEMPFILE2"' 0 UN= if (uname) >/dev/null 2>&1; then UN=`uname -a` fi if [ -f /usr/lib/sendmail ] ; then RMAIL="/usr/lib/sendmail" SMARGS="-i -t" elif [ -f /usr/sbin/sendmail ] ; then RMAIL="/usr/sbin/sendmail" SMARGS="-i -t" else RMAIL=rmail SMARGS="$BUGADDR" fi INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]' # this is raceable unless (hopefully) we used mktemp(1) or tempfile(1) $rm_tmp1 && rm -f "$TEMPFILE1" cat > "$TEMPFILE1" <<EOF From: ${USER} To: ${BUGADDR} Subject: ${INITIAL_SUBJECT} Configuration Information [Automatically generated, do not change]: Machine: $MACHINE OS: $OS Compiler: $CC Compilation CFLAGS: $CFLAGS uname output: $UN Machine Type: $MACHTYPE Bash Version: $RELEASE Patch Level: $PATCHLEVEL Release Status: $RELSTATUS Description: [Detailed description of the problem, suggestion, or complaint.] Repeat-By: [Describe the sequence of events that causes the problem to occur.] Fix: [Description of how to fix the problem. If you don't know a fix for the problem, don't include this section.] EOF # this is still raceable unless (hopefully) we used mktemp(1) or tempfile(1) $rm_tmp2 && rm -f "$TEMPFILE2" cp "$TEMPFILE1" "$TEMPFILE2" chmod u+w "$TEMPFILE1" trap '' 2 # ignore interrupts while in editor edstat=1 while [ $edstat -ne 0 ]; do $EDITOR "$TEMPFILE1" edstat=$? if [ $edstat -ne 0 ]; then echo "$0: editor \`$EDITOR' exited with nonzero status." echo "$0: Perhaps it was interrupted." echo "$0: Type \`y' to give up, and lose your bug report;" echo "$0: type \`n' to re-enter the editor." echo $n "$0: Do you want to give up? $c" read ans case "$ans" in [Yy]*) exit 1 ;; esac continue fi # find the subject from the temp file and see if it's been changed CURR_SUB=`grep '^Subject: ' "$TEMPFILE1" | sed 's|^Subject:[ ]*||' | sed 1q` case "$CURR_SUB" in "${INITIAL_SUBJECT}") echo echo "$0: You have not changed the subject from the default." echo "$0: Please use a more descriptive subject header." echo "$0: Type \`y' to give up, and lose your bug report;" echo "$0: type \`n' to re-enter the editor." echo $n "$0: Do you want to give up? $c" read ans case "$ans" in [Yy]*) exit 1 ;; esac echo "$0: The editor will be restarted in five seconds." sleep 5 edstat=1 ;; esac done trap 'rm -f "$TEMPFILE1" "$TEMPFILE2"; exit 1' 2 # restore trap on SIGINT if cmp -s "$TEMPFILE1" "$TEMPFILE2" then echo "File not changed, no bug report submitted." exit fi echo $n "Send bug report? [y/n] $c" read ans case "$ans" in [Nn]*) exit 0 ;; esac ${RMAIL} $SMARGS < "$TEMPFILE1" || { cat "$TEMPFILE1" >> $HOME/dead.bashbug echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2 } exit 0 --- NEW FILE: printenv.sh --- #! /bin/sh - # Copyright (C) 1996-2002 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. if [ $# -eq 0 ]; then env exit elif eval [ "\${$1-unset}" = "unset" ]; then exit 1 else eval echo \$$1 exit 0 fi --- NEW FILE: texi2dvi --- #! /bin/sh # texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources. # $Id: texi2dvi,v 1.1 2005/05/22 10:13:25 earnie Exp $ # # Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, you can either send email to this # program's maintainer or write to: The Free Software Foundation, # Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. # # Original author: Noah Friedman <fri...@gn...>. # # Please send bug reports, etc. to bug...@gn.... # If possible, please send a copy of the output of the script called with # the `--debug' option when making a bug report. # This string is expanded by rcs automatically when this file is checked out. rcs_revision='$Revision: 1.1 $' rcs_version=`set - $rcs_revision; echo $2` program=`echo $0 | sed -e 's!.*/!!'` version="texi2dvi (GNU Texinfo 4.0) $rcs_version Copyright (C) 1999 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." usage="Usage: $program [OPTION]... FILE... Run each Texinfo or LaTeX FILE through TeX in turn until all cross-references are resolved, building all indices. The directory containing each FILE is searched for included files. The suffix of FILE is used to determine its language (LaTeX or Texinfo). Makeinfo is used to perform Texinfo macro expansion before running TeX when needed. Options: -@ Use @input instead of \input; for preloaded Texinfo. -b, --batch No interaction. -c, --clean Remove all auxiliary files. -D, --debug Turn on shell debugging (set -x). -e, --expand Force macro expansion using makeinfo. -I DIR Search DIR for Texinfo files. -h, --help Display this help and exit successfully. -l, --language=LANG Specify the LANG of FILE: LaTeX or Texinfo. -p, --pdf Use pdftex or pdflatex for processing. -q, --quiet No output unless errors (implies --batch). -s, --silent Same as --quiet. -t, --texinfo=CMD Insert CMD after @setfilename in copy of input file. Multiple values accumulate. -v, --version Display version information and exit successfully. -V, --verbose Report on what is done. The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO, TEX (or PDFTEX), and TEXINDEX environment variables are used to run those commands, if they are set. Email bug reports to <bug...@gn...>, general questions and discussion to <hel...@gn...>." # Initialize variables for option overriding and otherwise. # Don't use `unset' since old bourne shells don't have this command. # Instead, assign them an empty value. escape='\' batch=false # eval for batch mode clean= debug= expand= # t for expansion via makeinfo oformat=dvi set_language= miincludes= # makeinfo include path textra= tmpdir=${TMPDIR:-/tmp}/t2d$$ # avoid collisions on 8.3 filesystems. txincludes= # TEXINPUTS extensions txiprereq=19990129 # minimum texinfo.tex version to have macro expansion quiet= # by default let the tools' message be displayed verbose=false # echo for verbose mode orig_pwd=`pwd` # Systems which define $COMSPEC or $ComSpec use semicolons to separate # directories in TEXINPUTS. if test -n "$COMSPEC$ComSpec"; then path_sep=";" else path_sep=":" fi # Save this so we can construct a new TEXINPUTS path for each file. TEXINPUTS_orig="$TEXINPUTS" # Unfortunately makeindex does not read TEXINPUTS. INDEXSTYLE_orig="$INDEXSTYLE" export TEXINPUTS INDEXSTYLE # Push a token among the arguments that will be used to notice when we # ended options/arguments parsing. # Use "set dummy ...; shift" rather than 'set - ..." because on # Solaris set - turns off set -x (but keeps set -e). # Use ${1+"$@"} rather than "$@" because Digital Unix and Ultrix 4.3 # still expand "$@" to a single argument (the empty string) rather # than nothing at all. arg_sep="$$--$$" set dummy ${1+"$@"} "$arg_sep"; shift # # Parse command line arguments. while test x"$1" != x"$arg_sep"; do # Handle --option=value by splitting apart and putting back on argv. case "$1" in --*=*) opt=`echo "$1" | sed -e 's/=.*//'` val=`echo "$1" | sed -e 's/[^=]*=//'` shift set dummy "$opt" "$val" ${1+"$@"}; shift ;; esac # This recognizes --quark as --quiet. So what. case "$1" in -@ ) escape=@;; # Silently and without documentation accept -b and --b[atch] as synonyms. -b | --b*) batch=eval;; -q | -s | --q* | --s*) quiet=t; batch=eval;; -c | --c*) clean=t;; -D | --d*) debug=t;; -e | --e*) expand=t;; -h | --h*) echo "$usage"; exit 0;; -I | --I*) shift miincludes="$miincludes -I $1" txincludes="$txincludes$path_sep$1" ;; -l | --l*) shift; set_language=$1;; -p | --p*) oformat=pdf;; -t | --t*) shift; textra="$textra\\ $1";; -v | --vers*) echo "$version"; exit 0;; -V | --verb*) verbose=echo;; --) # What remains are not options. shift while test x"$1" != x"$arg_sep"; do set dummy ${1+"$@"} "$1"; shift shift done break;; -*) echo "$0: Unknown or ambiguous option \`$1'." >&2 echo "$0: Try \`--help' for more information." >&2 exit 1;; *) set dummy ${1+"$@"} "$1"; shift;; esac shift done # Pop the token shift # Interpret remaining command line args as filenames. if test $# = 0; then echo "$0: Missing file arguments." >&2 echo "$0: Try \`--help' for more information." >&2 exit 2 fi # Prepare the temporary directory. Remove it at exit, unless debugging. if test -z "$debug"; then trap "cd / && rm -rf $tmpdir" 0 1 2 15 fi # Create the temporary directory with strict rights (umask 077 && mkdir $tmpdir) || exit 1 # Prepare the tools we might need. This may be extra work in some # cases, but improves the readibility of the script. utildir=$tmpdir/utils mkdir $utildir || exit 1 # A sed script that preprocesses Texinfo sources in order to keep the # iftex sections only. We want to remove non TeX sections, and # comment (with `@c texi2dvi') TeX sections so that makeinfo does not # try to parse them. Nevertheless, while commenting TeX sections, # don't comment @macro/@end macro so that makeinfo does propagate # them. Unfortunately makeinfo --iftex --no-ifhtml --no-ifinfo # doesn't work well enough (yet) to use that, so work around with sed. comment_iftex_sed=$utildir/comment.sed cat <<EOF >$comment_iftex_sed /^@tex/,/^@end tex/{ s/^/@c texi2dvi/ } /^@iftex/,/^@end iftex/{ s/^/@c texi2dvi/ /^@c texi2dvi@macro/,/^@c texi2dvi@end macro/{ s/^@c texi2dvi// } } /^@html/,/^@end html/d /^@ifhtml/,/^@end ifhtml/d /^@ifnottex/,/^@end ifnottex/d /^@ifinfo/,/^@end ifinfo/{ /^@node/p /^@menu/,/^@end menu/p d } EOF # Uncommenting is simple: Remove any leading `@c texi2dvi'. uncomment_iftex_sed=$utildir/uncomment.sed cat <<EOF >$uncomment_iftex_sed s/^@c texi2dvi// EOF # A shell script that computes the list of xref files. # Takes the filename (without extension) of which we look for xref # files as argument. The index files must be reported last. get_xref_files=$utildir/get_xref.sh cat <<\EOF >$get_xref_files #! /bin/sh # Get list of xref files (indexes, tables and lists). # Find all files having root filename with a two-letter extension, # saves the ones that are really Texinfo-related files. .?o? catches # LaTeX tables and lists. for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do # If file is empty, skip it. test -s "$this_file" || continue # If the file is not suitable to be an index or xref file, don't # process it. The file can't be if its first character is not a # backslash or single quote. first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file` if test "x$first_character" = "x\\" \ || test "x$first_character" = "x'"; then xref_files="$xref_files ./$this_file" fi done echo "$xref_files" EOF chmod 500 $get_xref_files # File descriptor usage: # 0 standard input # 1 standard output (--verbose messages) # 2 standard error # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 5 tools output (turned off by --quiet) # Tools' output. If quiet, discard, else redirect to the message flow. if test "$quiet" = t; then exec 5>/dev/null else exec 5>&1 fi # Enable tracing test "$debug" = t && set -x # # TeXify files. for command_line_filename in ${1+"$@"}; do $verbose "Processing $command_line_filename ..." # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex), # prepend `./' in order to avoid that the tools take it as an option. echo "$command_line_filename" | egrep '^(/|[A-z]:/)' >/dev/null \ || command_line_filename="./$command_line_filename" # See if the file exists. If it doesn't we're in trouble since, even # though the user may be able to reenter a valid filename at the tex # prompt (assuming they're attending the terminal), this script won't # be able to find the right xref files and so forth. if test ! -r "$command_line_filename"; then echo "$0: Could not read $command_line_filename, skipping." >&2 continue fi # Get the name of the current directory. We want the full path # because in clean mode we are in tmp, in which case a relative # path has no meaning. filename_dir=`echo $command_line_filename | sed 's!/[^/]*$!!;s!^$!.!'` filename_dir=`cd "$filename_dir" >/dev/null && pwd` # Strip directory part but leave extension. filename_ext=`basename "$command_line_filename"` # Strip extension. filename_noext=`echo "$filename_ext" | sed 's/\.[^.]*$//'` ext=`echo "$filename_ext" | sed 's/^.*\.//'` # _src. Use same basename since we want to generate aux files with # the same basename as the manual. If --expand, then output the # macro-expanded file to here, else copy the original file. tmpdir_src=$tmpdir/src filename_src=$tmpdir_src/$filename_noext.$ext # _xtr. The file with the user's extra commands. tmpdir_xtr=$tmpdir/xtr filename_xtr=$tmpdir_xtr/$filename_noext.$ext # _bak. Copies of the previous xref files (another round is run if # they differ from the new one). tmpdir_bak=$tmpdir/bak # Make all those directories and give up if we can't succeed. mkdir $tmpdir_src $tmpdir_xtr $tmpdir_bak || exit 1 # Source file might include additional sources. Put `.' and # directory where source file(s) reside in TEXINPUTS before anything # else. `.' goes first to ensure that any old .aux, .cps, # etc. files in ${directory} don't get used in preference to fresher # files in `.'. Include orig_pwd in case we are in clean mode, where # we've cd'd to a temp directory. common=".$path_sep$orig_pwd$path_sep$filename_dir$path_sep$txincludes$path_sep" TEXINPUTS="$common$TEXINPUTS_orig" INDEXSTYLE="$common$INDEXSTYLE_orig" # If the user explicitly specified the language, use that. # Otherwise, if the first line is \input texinfo, assume it's texinfo. # Otherwise, guess from the file extension. if test -n "$set_language"; then language=$set_language elif sed 1q "$command_line_filename" | fgrep 'input texinfo' >/dev/null; then language=texinfo else language= fi # Get the type of the file (latex or texinfo) from the given language # we just guessed, or from the file extension if not set yet. case ${language:-$filename_ext} in [lL]a[tT]e[xX] | *.ltx | *.tex) # Assume a LaTeX file. LaTeX needs bibtex and uses latex for # compilation. No makeinfo. bibtex=${BIBTEX:-bibtex} makeinfo= # no point in running makeinfo on latex source. texindex=${MAKEINDEX:-makeindex} if test $oformat = dvi; then tex=${LATEX:-latex} else tex=${PDFLATEX:-pdflatex} fi ;; *) # Assume a Texinfo file. Texinfo files need makeinfo, texindex and tex. bibtex= texindex=${TEXINDEX:-texindex} if test $oformat = dvi; then tex=${TEX:-tex} else tex=${PDFTEX:-pdftex} fi # Unless required by the user, makeinfo expansion is wanted only # if texinfo.tex is too old. if test "$expand" = t; then makeinfo=${MAKEINFO:-makeinfo} else # Check if texinfo.tex performs macro expansion by looking for # its version. The version is a date of the form YEAR-MO-DA. # We don't need to use [0-9] to match the digits since anyway # the comparison with $txiprereq, a number, will fail with non # digits. txiversion_tex=txiversion.tex echo '\input texinfo.tex @bye' >$tmpdir/$txiversion_tex # Run in the tmpdir to avoid leaving files. eval `cd $tmpdir >/dev/null \ && $tex $txiversion_tex 2>/dev/null \ | sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p'` $verbose "texinfo.tex preloaded as \`$txiformat', version is \`$txiversion' ..." if test "$txiprereq" -le "$txiversion" >/dev/null 2>&1; then makeinfo= else makeinfo=${MAKEINFO:-makeinfo} fi # As long as we had to run TeX, offer the user this convenience if test "$txiformat" = Texinfo; then escape=@ fi fi ;; esac # Expand macro commands in the original source file using Makeinfo. # Always use `end' footnote style, since the `separate' style # generates different output (arguably this is a bug in -E). # Discard main info output, the user asked to run TeX, not makeinfo. if test -n "$makeinfo"; then $verbose "Macro-expanding $command_line_filename to $filename_src ..." sed -f $comment_iftex_sed "$command_line_filename" \ | $makeinfo --footnote-style=end -I "$filename_dir" $miincludes \ -o /dev/null --macro-expand=- \ | sed -f $uncomment_iftex_sed >"$filename_src" filename_input=$filename_src fi # If makeinfo failed (or was not even run), use the original file as input. if test $? -ne 0 \ || test ! -r "$filename_src"; then $verbose "Reverting to $command_line_filename ..." filename_input=$filename_dir/$filename_ext fi # Used most commonly for @finalout, @smallbook, etc. if test -n "$textra"; then $verbose "Inserting extra commands: $textra" sed '/^@setfilename/a\ '"$textra" "$filename_input" >$filename_xtr filename_input=$filename_xtr fi # If clean mode was specified, then move to the temporary directory. if test "$clean" = t; then $verbose "cd $tmpdir_src" cd "$tmpdir_src" || exit 1 fi while :; do # will break out of loop below orig_xref_files=`$get_xref_files "$filename_noext"` # Save copies of originals for later comparison. if test -n "$orig_xref_files"; then $verbose "Backing up xref files: `echo $orig_xref_files | sed 's|\./||g'`" cp $orig_xref_files $tmpdir_bak fi # Run bibtex on current file. # - If its input (AUX) exists. # - If AUX contains both `\bibdata' and `\bibstyle'. # - If some citations are missing (LOG contains `Citation'). # or the LOG complains of a missing .bbl # # We run bibtex first, because I can see reasons for the indexes # to change after bibtex is run, but I see no reason for the # converse. # # Don't try to be too smart. Running bibtex only if the bbl file # exists and is older than the LaTeX file is wrong, since the # document might include files that have changed. Because there # can be several AUX (if there are \include's), but a single LOG, # looking for missing citations in LOG is easier, though we take # the risk to match false messages. if test -n "$bibtex" \ && test -r "$filename_noext.aux" \ && test -r "$filename_noext.log" \ && (grep '^\\bibdata[{]' "$filename_noext.aux" \ && grep '^\\bibstyle[{]' "$filename_noext.aux" \ && (grep 'Warning:.*Citation.*undefined' "$filename_noext.log" \ || grep 'No file .*\.bbl\.' "$filename_noext.log")) \ >/dev/null 2>&1; \ then $verbose "Running $bibtex $filename_noext ..." if $bibtex "$filename_noext" >&5; then :; else echo "$0: $bibtex exited with bad status, quitting." >&2 exit 1 fi fi # What we'll run texindex on -- exclude non-index files. # Since we know index files are last, it is correct to remove everything # before .aux and .?o?. index_files=`echo "$orig_xref_files" \ | sed "s!.*\.aux!!g; s!./$filename_noext\..o.!!g; s/^[ ]*//;s/[ ]*$//"` # Run texindex (or makeindex) on current index files. If they # already exist, and after running TeX a first time the index # files don't change, then there's no reason to run TeX again. # But we won't know that if the index files are out of date or # nonexistent. if test -n "$texindex" && test -n "$index_files"; then $verbose "Running $texindex $index_files ..." if $texindex $index_files 2>&5 1>&2; then :; else echo "$0: $texindex exited with bad status, quitting." >&2 exit 1 fi fi # Finally, run TeX. # Prevent $ESCAPE from being interpreted by the shell if it happens # to be `/'. $batch tex_args="\\${escape}nonstopmode\ \\${escape}input" $verbose "Running $cmd ..." cmd="$tex $tex_args $filename_input" if $cmd >&5; then :; else echo "$0: $tex exited with bad status, quitting." >&2 echo "$0: see $filename_noext.log for errors." >&2 test "$clean" = t \ && cp "$filename_noext.log" "$orig_pwd" exit 1 fi # Decide if looping again is needed. finished=t # LaTeX (and the package changebar) report in the LOG file if it # should be rerun. This is needed for files included from # subdirs, since texi2dvi does not try to compare xref files in # subdirs. Performing xref files test is still good since LaTeX # does not report changes in xref files. if fgrep "Rerun to get" "$filename_noext.log" >/dev/null 2>&1; then finished= fi # Check if xref files changed. new_xref_files=`$get_xref_files "$filename_noext"` $verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`" $verbose "New xref files = `echo $new_xref_files | sed 's|\./||g'`" # If old and new lists don't at least have the same file list, # then one file or another has definitely changed. test "x$orig_xref_files" != "x$new_xref_files" && finished= # File list is the same. We must compare each file until we find # a difference. if test -n "$finished"; then for this_file in $new_xref_files; do $verbose "Comparing xref file `echo $this_file | sed 's|\./||g'` ..." # cmp -s returns nonzero exit status if files differ. if cmp -s "$this_file" "$tmpdir_bak/$this_file"; then :; else # We only need to keep comparing until we find one that # differs, because we'll have to run texindex & tex again no # matter how many more there might be. finished= $verbose "xref file `echo $this_file | sed 's|\./||g'` differed ..." test "$debug" = t && diff -c "$tmpdir_bak/$this_file" "$this_file" break fi done fi # If finished, exit the loop, else rerun the loop. test -n "$finished" && break done # If we were in clean mode, compilation was in a tmp directory. # Copy the DVI (or PDF) file into the directory where the compilation # has been done. (The temp dir is about to get removed anyway.) # We also return to the original directory so that # - the next file is processed in correct conditions # - the temporary file can be removed if test -n "$clean"; then $verbose "Copying $oformat file from `pwd` to $orig_pwd" cp -p "./$filename_noext.$oformat" "$orig_pwd" cd / # in case $orig_pwd is on a different drive (for DOS) cd $orig_pwd || exit 1 fi # Remove temporary files. if test "x$debug" = "x"; then $verbose "Removing $tmpdir_src $tmpdir_xtr $tmpdir_bak ..." cd / rm -rf $tmpdir_src $tmpdir_xtr $tmpdir_bak fi done $verbose "$0 done." exit 0 # exit successfully, not however we ended the loop. --- NEW FILE: printenv.c --- /* printenv -- minimal clone of BSD printenv(1). usage: printenv [varname] Chet Ramey ch...@po... */ /* Copyright (C) 1997-2002 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ extern char **environ; int main (argc, argv) int argc; char **argv; { register char **envp, *eval; int len; argv++; argc--; /* printenv */ if (argc == 0) { for (envp = environ; *envp; envp++) puts (*envp); exit (0); } /* printenv varname */ len = strlen (*argv); for (envp = environ; *envp; envp++) { if (**argv == **envp && strncmp (*envp, *argv, len) == 0) { eval = *envp + len; /* If the environment variable doesn't have an `=', ignore it. */ if (*eval == '=') { puts (eval + 1); exit (0); } } } exit (1); } --- NEW FILE: mksignames.c --- /* signames.c -- Create and write `signames.h', which contains an array of signal names. */ /* Copyright (C) 1992 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ #include <config.h> #include <stdio.h> #include <sys/types.h> #include <signal.h> #if defined (HAVE_STDLIB_H) # include <stdlib.h> #else # include "ansi_stdlib.h" #endif /* HAVE_STDLIB_H */ #if !defined (NSIG) # define NSIG 64 #endif /* * Special traps: * EXIT == 0 * DEBUG == NSIG * ERR == NSIG+1 */ #define LASTSIG NSIG+1 char *signal_names[2 * NSIG + 3]; #define signal_names_size (sizeof(signal_names)/sizeof(signal_names[0])) char *progname; /* AIX 4.3 defines SIGRTMIN and SIGRTMAX as 888 and 999 respectively. I don't want to allocate so much unused space for the intervening signal numbers, so we just punt if SIGRTMAX is past the bounds of the signal_names array (handled in configure). */ #if defined (SIGRTMAX) && defined (UNUSABLE_RT_SIGNALS) # undef SIGRTMAX # undef SIGRTMIN #endif #if defined (SIGRTMAX) || defined (SIGRTMIN) # define RTLEN 14 # define RTLIM 256 #endif void initialize_signames () { register int i; #if defined (SIGRTMAX) || defined (SIGRTMIN) int rtmin, rtmax, rtcnt; #endif for (i = 1; i < signal_names_size; i++) signal_names[i] = (char *)NULL; /* `signal' 0 is what we do on exit. */ signal_names[0] = "EXIT"; /* Place signal names which can be aliases for more common signal names first. This allows (for example) SIGABRT to overwrite SIGLOST. */ /* POSIX 1003.1b-1993 real time signals, but take care of incomplete implementations. Acoording to the standard, both, SIGRTMIN and SIGRTMAX must be defined, SIGRTMIN must be stricly less than SIGRTMAX, and the difference must be at least 7, that is, there must be at least eight distinct real time signals. */ /* The generated signal names are SIGRTMIN, SIGRTMIN+1, ..., SIGRTMIN+x, SIGRTMAX-x, ..., SIGRTMAX-1, SIGRTMAX. If the number of RT signals is odd, there is an extra SIGRTMIN+(x+1). These names are the ones used by ksh and /usr/xpg4/bin/sh on SunOS5. */ #if defined (SIGRTMIN) rtmin = SIGRTMIN; signal_names[rtmin] = "SIGRTMIN"; #endif #if defined (SIGRTMAX) rtmax = SIGRTMAX; signal_names[rtmax] = "SIGRTMAX"; #endif #if defined (SIGRTMAX) && defined (SIGRTMIN) if (rtmax > rtmin) { rtcnt = (rtmax - rtmin - 1) / 2; /* croak if there are too many RT signals */ if (rtcnt >= RTLIM/2) { rtcnt = RTLIM/2-1; fprintf(stderr, "%s: error: more than %i real time signals, fix `%s'\n", progname, RTLIM, progname); } for (i = 1; i <= rtcnt; i++) { signal_names[rtmin+i] = (char *)malloc(RTLEN); if (signal_names[rtmin+i]) sprintf (signal_names[rtmin+i], "SIGRTMIN+%d", i); signal_names[rtmax-i] = (char *)malloc(RTLEN); if (signal_names[rtmax-i]) sprintf (signal_names[rtmax-i], "SIGRTMAX-%d", i); } if (rtcnt < RTLIM/2-1 && rtcnt != (rtmax-rtmin)/2) { /* Need an extra RTMIN signal */ signal_names[rtmin+rtcnt+1] = (char *)malloc(RTLEN); if (signal_names[rtmin+rtcnt+1]) sprintf (signal_names[rtmin+rtcnt+1], "SIGRTMIN+%d", rtcnt+1); } } #endif /* SIGRTMIN && SIGRTMAX */ /* AIX */ #if defined (SIGLOST) /* resource lost (eg, record-lock lost) */ signal_names[SIGLOST] = "SIGLOST"; #endif #if defined (SIGMSG) /* HFT input data pending */ signal_names[SIGMSG] = "SIGMSG"; #endif #if defined (SIGDANGER) /* system crash imminent */ signal_names[SIGDANGER] = "SIGDANGER"; #endif #if defined (SIGMIGRATE) /* migrate process to another CPU */ signal_names[SIGMIGRATE] = "SIGMIGRATE"; #endif #if defined (SIGPRE) /* programming error */ signal_names[SIGPRE] = "SIGPRE"; #endif #if defined (SIGVIRT) /* AIX virtual time alarm */ signal_names[SIGVIRT] = "SIGVIRT"; #endif #if defined (SIGALRM1) /* m:n condition variables */ signal_names[SIGALRM1] = "SIGALRM1"; #endif #if defined (SIGWAITING) /* m:n scheduling */ signal_names[SIGWAITING] = "SIGWAITING"; #endif #if defined (SIGGRANT) /* HFT monitor mode granted */ signal_names[SIGGRANT] = "SIGGRANT"; #endif #if defined (SIGKAP) /* keep alive poll from native keyboard */ signal_names[SIGKAP] = "SIGKAP"; #endif #if defined (SIGRETRACT) /* HFT monitor mode retracted */ signal_names[SIGRETRACT] = "SIGRETRACT"; #endif #if defined (SIGSOUND) /* HFT sound sequence has completed */ signal_names[SIGSOUND] = "SIGSOUND"; #endif #if defined (SIGSAK) /* Secure Attention Key */ signal_names[SIGSAK] = "SIGSAK"; #endif /* SunOS5 */ #if defined (SIGLWP) /* special signal used by thread library */ signal_names[SIGLWP] = "SIGLWP"; #endif #if defined (SIGFREEZE) /* special signal used by CPR */ signal_names[SIGFREEZE] = "SIGFREEZE"; #endif #if defined (SIGTHAW) /* special signal used by CPR */ signal_names[SIGTHAW] = "SIGTHAW"; #endif #if defined (SIGCANCEL) /* thread cancellation signal used by libthread */ signal_names[SIGCANCEL] = "SIGCANCEL"; #endif /* HP-UX */ #if defined (SIGDIL) /* DIL signal (?) */ signal_names[SIGDIL] = "SIGDIL"; #endif /* System V */ #if defined (SIGCLD) /* Like SIGCHLD. */ signal_names[SIGCLD] = "SIGCLD"; #endif #if defined (SIGPWR) /* power state indication */ signal_names[SIGPWR] = "SIGPWR"; #endif #if defined (SIGPOLL) /* Pollable event (for streams) */ signal_names[SIGPOLL] = "SIGPOLL"; #endif /* Unknown */ #if defined (SIGWINDOW) signal_names[SIGWINDOW] = "SIGWINDOW"; #endif /* Common */ #if defined (SIGHUP) /* hangup */ signal_names[SIGHUP] = "SIGHUP"; #endif #if defined (SIGINT) /* interrupt */ signal_names[SIGINT] = "SIGINT"; #endif #if defined (SIGQUIT) /* quit */ signal_names[SIGQUIT] = "SIGQUIT"; #endif #if defined (SIGILL) /* illegal instruction (not reset when caught) */ signal_names[SIGILL] = "SIGILL"; #endif #if defined (SIGTRAP) /* trace trap (not reset when caught) */ signal_names[SIGTRAP] = "SIGTRAP"; #endif #if defined (SIGIOT) /* IOT instruction */ signal_names[SIGIOT] = "SIGIOT"; #endif #if defined (SIGABRT) /* Cause current process to dump core. */ signal_names[SIGABRT] = "SIGABRT"; #endif #if defined (SIGEMT) /* EMT instruction */ signal_names[SIGEMT] = "SIGEMT"; #endif #if defined (SIGFPE) /* floating point exception */ signal_names[SIGFPE] = "SIGFPE"; #endif #if defined (SIGKILL) /* kill (cannot be caught or ignored) */ signal_names[SIGKILL] = "SIGKILL"; #endif #if defined (SIGBUS) /* bus error */ signal_names[SIGBUS] = "SIGBUS"; #endif #if defined (SIGSEGV) /* segmentation violation */ signal_names[SIGSEGV] = "SIGSEGV"; #endif #if defined (SIGSYS) /* bad argument to system call */ signal_names[SIGSYS] = "SIGSYS"; #endif #if defined (SIGPIPE) /* write on a pipe with no one to read it */ signal_names[SIGPIPE] = "SIGPIPE"; #endif #if defined (SIGALRM) /* alarm clock */ signal_names[SIGALRM] = "SIGALRM"; #endif #if defined (SIGTERM) /* software termination signal from kill */ signal_names[SIGTERM] = "SIGTERM"; #endif #if defined (SIGURG) /* urgent condition on IO channel */ signal_names[SIGURG] = "SIGURG"; #endif #if defined (SIGSTOP) /* sendable stop signal not from tty */ signal_names[SIGSTOP] = "SIGSTOP"; #endif #if defined (SIGTSTP) /* stop signal from tty */ signal_names[SIGTSTP] = "SIGTSTP"; #endif #if defined (SIGCONT) /* continue a stopped process */ signal_names[SIGCONT] = "SIGCONT"; #endif #if defined (SIGCHLD) /* to parent on child stop or exit */ signal_names[SIGCHLD] = "SIGCHLD"; #endif #if defined (SIGTTIN) /* to readers pgrp upon background tty read */ signal_names[SIGTTIN] = "SIGTTIN"; #endif #if defined (SIGTTOU) /* like TTIN for output if (tp->t_local<OSTOP) */ signal_names[SIGTTOU] = "SIGTTOU"; #endif #if defined (SIGIO) /* input/output possible signal */ signal_names[SIGIO] = "SIGIO"; #endif #if defined (SIGXCPU) /* exceeded CPU time limit */ signal_names[SIGXCPU] = "SIGXCPU"; #endif #if defined (SIGXFSZ) /* exceeded file size limit */ signal_names[SIGXFSZ] = "SIGXFSZ"; #endif #if defined (SIGVTALRM) /* virtual time alarm */ signal_names[SIGVTALRM] = "SIGVTALRM"; #endif #if defined (SIGPROF) /* profiling time alarm */ signal_names[SIGPROF] = "SIGPROF"; #endif #if defined (SIGWINCH) /* window changed */ signal_names[SIGWINCH] = "SIGWINCH"; #endif /* 4.4 BSD */ #if defined (SIGINFO) && !defined (_SEQUENT_) /* information request */ signal_names[SIGINFO] = "SIGINFO"; #endif #if defined (SIGUSR1) /* user defined signal 1 */ signal_names[SIGUSR1] = "SIGUSR1"; #endif #if defined (SIGUSR2) /* user defined signal 2 */ signal_names[SIGUSR2] = "SIGUSR2"; #endif #if defined (SIGKILLTHR) /* BeOS: Kill Thread */ signal_names[SIGKILLTHR] = "SIGKILLTHR"; #endif for (i = 0; i < NSIG; i++) if (signal_names[i] == (char *)NULL) { signal_names[i] = (char *)malloc (18); if (signal_names[i]) sprintf (signal_names[i], "SIGJUNK(%d)", i); } signal_names[NSIG] = "DEBUG"; signal_names[NSIG+1] = "ERR"; } void write_signames (stream) FILE *stream; { register int i; fprintf (stream, "/* This file was automatically created by %s.\n", progname); fprintf (stream, " Do not edit. Edit support/mksignames.c instead. */\n\n"); fprintf (stream, "/* A translation list so we can be polite to our users. */\n"); fprintf ... [truncated message content] |