[m-rev.] for review: scripts style

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Nov 13 18:47:56 AEDT 2006


For review by anyone. Shell scripts are much easier to screw up without
detection than Mercury or even C programs, so I would appreciate a second
eye going over them.

The diff is with -b, so the indentation is mixed between what used to be
and what is now, so don't mention that.

Zoltan.

scripts/*:
	Convert all the shell scripts to four-space indentation,
	and fix some deviations from our standard style.

cvs diff: Diffing .
cvs diff: Diffing analysis
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
Index: scripts/Mercury.config.bootstrap.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mercury.config.bootstrap.in,v
retrieving revision 1.5
diff -u -b -r1.5 Mercury.config.bootstrap.in
--- scripts/Mercury.config.bootstrap.in	19 Oct 2004 06:01:38 -0000	1.5
+++ scripts/Mercury.config.bootstrap.in	12 Nov 2006 08:26:18 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 2003-2004 The University of Melbourne.
Index: scripts/Mercury.config.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/Mercury.config.in,v
retrieving revision 1.16
diff -u -b -r1.16 Mercury.config.in
--- scripts/Mercury.config.in	26 Sep 2006 03:53:23 -0000	1.16
+++ scripts/Mercury.config.in	12 Nov 2006 08:26:36 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 2003-2006 The University of Melbourne.
Index: scripts/c2init.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/c2init.in,v
retrieving revision 1.47
diff -u -b -r1.47 c2init.in
--- scripts/c2init.in	24 Feb 2006 07:11:21 -0000	1.47
+++ scripts/c2init.in	12 Nov 2006 08:27:22 -0000
@@ -1,5 +1,6 @@
 #! /bin/sh
 # @configure_input@
+# vim: ts=4 sw=4 et
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995-2006 The University of Melbourne.
 # This file may only be copied under the terms of the GNU General
@@ -89,8 +90,7 @@
 case "$trace_opt" in
 	-t)
 		init_opt="-i"
-		MERCURY_ALL_LIB_MODS="$MERCURY_MOD_LIB_MODS\
-			$MERCURY_TRACE_LIB_MODS"
+        MERCURY_ALL_LIB_MODS="$MERCURY_MOD_LIB_MODS  $MERCURY_TRACE_LIB_MODS"
 		;;
 	*)
 		MERCURY_ALL_LIB_MODS="$MERCURY_MOD_LIB_MODS"
Index: scripts/canonical_grade.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/canonical_grade.in,v
retrieving revision 1.1
diff -u -b -r1.1 canonical_grade.in
--- scripts/canonical_grade.in	18 Dec 2000 07:17:44 -0000	1.1
+++ scripts/canonical_grade.in	12 Nov 2006 08:27:36 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 #---------------------------------------------------------------------------#
 # Copyright (C) 2000 The University of Melbourne.
 # This file may only be copied under the terms of the GNU General
Index: scripts/mdb.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mdb.in,v
retrieving revision 1.5
diff -u -b -r1.5 mdb.in
--- scripts/mdb.in	17 Mar 2005 02:29:44 -0000	1.5
+++ scripts/mdb.in	12 Nov 2006 08:29:35 -0000
@@ -1,4 +1,5 @@
-#!/bin/sh
+#! /bin/sh
+# vim: ts=4 sw=4 et
 #-----------------------------------------------------------------------------#
 # Copyright (C) 1998,2002, 2005 The University of Melbourne.
 # This file may only be copied under the terms of the GNU General
@@ -142,11 +143,8 @@
 	    	mdb_in_window_opt="--mdb-in-window"
 	    	;;
 	    program)
-		#
-		# On Linux, we can use special files in /proc
-		# that refer to the file descriptors for a
-		# particular process.
-		#
+                # On Linux, we can use special files in /proc that refer
+                # to the file descriptors for a particular process.
 		stdin=/proc/$$/fd/0
 		stdout=/proc/$$/fd/1
 		stderr=/proc/$$/fd/2
@@ -161,7 +159,8 @@
 			# But that will only work if we're actually running
 			# on a terminal.
 			tty="`tty`"
-			case "$tty" in ""|"not a tty")
+                    case "$tty" in
+                        ""|"not a tty")
 				echo "$0: standard input stream is not a tty" 1>&2
 				exit 1
 				;;
@@ -172,7 +171,8 @@
 	    none)
 		redirect_opts=""
 		;;
-	esac ;;
+        esac
+        ;;
     *)
 	redirect_opts="--mdb-tty $tty"
 	;;
Index: scripts/mdprof.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mdprof.in,v
retrieving revision 1.3
diff -u -b -r1.3 mdprof.in
--- scripts/mdprof.in	25 Oct 2005 10:17:28 -0000	1.3
+++ scripts/mdprof.in	12 Nov 2006 08:29:45 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 #---------------------------------------------------------------------------#
 # Copyright (C) 2001, 2005 The University of Melbourne.
 # This file may only be copied under the terms of the GNU General
Index: scripts/mercury_config.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mercury_config.in,v
retrieving revision 1.6
diff -u -b -r1.6 mercury_config.in
--- scripts/mercury_config.in	27 Oct 2005 01:48:24 -0000	1.6
+++ scripts/mercury_config.in	12 Nov 2006 08:33:05 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 2003, 2005 The University of Melbourne.
@@ -96,16 +97,19 @@
 # mercury_config regenerates itself, so we can't just execute it in place.
 case $recursive in
     no)
-	if [ -d "$TMPDIR" ]; then
+        if test -d "$TMPDIR"
+        then
 		:
-	elif [ -d /tmp ]; then
+        elif test -d /tmp
+        then
 		TMPDIR="/tmp"
 	else
 		TMPDIR="."
 	fi
+
 	TMPDIR=$TMPDIR/mercury_config.$$
 	trap 'rm -rf $TMPDIR; exit 1' 1 2 3 13 15 
-	[ -d $TMPDIR ] || mkdir -p $TMPDIR || \
+        test -d $TMPDIR || mkdir -p $TMPDIR || \
 		{ echo mercury_config: invalid TMPDIR: $TMPDIR; exit 1; }
 	export TMPDIR
 
@@ -114,11 +118,13 @@
 	0)
 		exec $TMPDIR/mercury_config --recursive \
 			--input-prefix "$input_prefix" \
-			--output-prefix "$output_prefix" ;;
+                    --output-prefix "$output_prefix"
+                ;;
 	*)
 		exec $TMPDIR/mercury_config --recursive \
 			--input-prefix "$input_prefix" \
-			--output-prefix "$output_prefix" "$@" ;;
+                    --output-prefix "$output_prefix" "$@"
+                ;;
 	esac
 esac
 
@@ -170,9 +176,9 @@
 		;;
 esac
 
-[ -d $output_libdir/conf ] || mkdir -p $output_libdir/conf || exit 1
-[ -d $output_libdir/mmake ] || mkdir -p $output_libdir/mmake || exit 1
-[ -d $output_prefix/bin ] || mkdir -p $output_prefix/bin || exit 1
+test -d $output_libdir/conf || mkdir -p $output_libdir/conf || exit 1
+test -d $output_libdir/mmake || mkdir -p $output_libdir/mmake || exit 1
+test -d $output_prefix/bin || mkdir -p $output_prefix/bin || exit 1
 
 #
 # Copy the new configuration into place.
@@ -180,7 +186,8 @@
 cp runtime/mercury_conf.h $output_libdir/conf || exit 1
 cp scripts/Mercury.config $output_libdir/conf || exit 1
 cp scripts/Mmake.vars $output_libdir/mmake || exit 1
-if [ "$input_prefix" != "$output_prefix" ]; then
+if test "$input_prefix" != "$output_prefix"
+then
 	cp $input_prefix/bin/mdemangle${exe_ext} \
 		$input_prefix/bin/mkinit${exe_ext} \
 		$input_prefix/bin/info_to_mdb${exe_ext} $output_prefix/bin
@@ -188,9 +195,11 @@
 fi
 cd scripts
 echo *
-for file in *; do
+for file in *
+do
 	case "$file" in
-		*.in|Mmake.*|Mercury.config|mdbrc|*.sh-subr) ;;
+        *.in|Mmake.*|Mercury.config|mdbrc|*.sh-subr)
+            ;;
 		*)
 			cp $file $output_prefix/bin || exit 1
 			chmod u+w $output_prefix/bin/$file || exit 1
Index: scripts/mercury_update_interface.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mercury_update_interface.in,v
retrieving revision 1.6
diff -u -b -r1.6 mercury_update_interface.in
--- scripts/mercury_update_interface.in	27 Jul 1997 15:09:32 -0000	1.6
+++ scripts/mercury_update_interface.in	12 Nov 2006 08:34:05 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995-1997 The University of Melbourne.
@@ -22,19 +23,21 @@
 
 verbose=false
 
-if [ $# -ge 1 ] && [ "$1" = "-v" ]; then
+if test $# -ge 1 -a "$1" = "-v"
+then
 	verbose=true
 	shift
 fi
 
-if [ $# -ne 1 ]; then
+if test $# -ne 1
+then
 	echo "Usage: `basename $0` filename" 1>&2
 	exit 1
 fi
 
 filename="$1"
 	
-if	[ ! -f "$filename" ]
+if test ! -f "$filename"
 then
 	$verbose && echo "creating \`$filename'." 1>&2
 	mv -f "$filename.tmp" "$filename"
Index: scripts/mgnuc.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mgnuc.in,v
retrieving revision 1.118
diff -u -b -r1.118 mgnuc.in
--- scripts/mgnuc.in	1 Nov 2006 02:31:18 -0000	1.118
+++ scripts/mgnuc.in	12 Nov 2006 08:44:13 -0000
@@ -138,7 +138,8 @@
     compiler search paths.
 "
 
-while : ; do
+while :
+do
     case "$1" in
         -h|--help|"-?")
             echo "$Help"
@@ -235,12 +236,10 @@
     false)      LLDEBUG_OPTS="" ;;
 esac
 
-#
-# convert grade mgnuc options into gcc options
+# Convert grade mgnuc options into gcc options.
 #
 # IMPORTANT: any changes here may require similar changes to all the files
 # mentioned in runtime/mercury_grade.h.
-#
 
 case $highlevel_code in
     true)       HLC_OPTS="-DMR_HIGHLEVEL_CODE" ;;
@@ -274,15 +273,18 @@
 
 case $thread_safe in
     true)       THREAD_OPTS="$CFLAGS_FOR_THREADS"
-                case $FULLARCH in *linux*)
+            case $FULLARCH in
+                *linux*)
                     # Don't use -ansi under Linux or we get parse errors
                     # at sigset_t in the pthreads headers. This doesn't seem
                     # to be necessary for recent versions of Linux/glibc
                     # (e.g. glibc 2.1.2), but I've left it in so we can remain
                     # compatible with older versions.
                     ANSI_OPTS=""
-                esac ;;
-    false)      THREAD_OPTS="" ;;
+            esac
+            ;;
+    false)  THREAD_OPTS=""
+            ;;
 esac
 
 # Set the correct flags if we're to use the MS Visual C runtime.
@@ -464,7 +466,8 @@
         ;;
     *-solaris*|*-sunos*)
         # The solaris headers for pthreads are not ANSI :-(
-        case $thread_safe in true)
+        case $thread_safe in
+            true)
             ANSI_OPTS=""
             ;;
         esac
@@ -481,30 +484,37 @@
 # and compiler/{deforest,dupelim,mercury_to_mercury,modules}.c.
 # Similarly for egcs-1.1.2 on i386 with library/table_builtin.c.
 
-case $COMPILER in gcc)
+case $COMPILER in
+    gcc)
     case "$FULLARCH" in
         mips*)
             case "$*" in
             *" int.c "*|*" int.dir/int_"*".c "*)
                 case "`$CC --version 2>/dev/null`" in 2.6.*)
                     ARCH_OPTS="$ARCH_OPTS -O1" ;;
-                esac;;
+                        esac
+                        ;;
             *" bytecode.c "*|*" bytecode.dir/bytecode_"*".c "*)
                 case "`$CC --version 2>/dev/null`" in 2.6.*)
                     ARCH_OPTS="$ARCH_OPTS -O1" ;;
-                esac;;
+                        esac
+                        ;;
             *" bag.c "*)
                 case "`$CC --version 2>/dev/null`" in 2.6.*)
                     ARCH_OPTS="$ARCH_OPTS -O0" ;;
-                esac;;
-            esac ;;
+                        esac
+                        ;;
+                esac
+                ;;
         alpha*)
             case "$*" in
             *" modules.c "*|*" modules.dir/modules_"*".c "*)
-                case "`$CC --version 2>/dev/null`" in 2.6.*)
+                        case "`$CC --version 2>/dev/null`" in
+                            2.6.*)
                     ARCH_OPTS="$ARCH_OPTS -O1" ;;
                 esac
-            esac ;;
+                esac
+                ;;
         i*86*)
             case "$*" in
             *" call_gen.c "*|*" modules.dir/call_gen"*".c "*)
@@ -513,7 +523,8 @@
                 ARCH_OPTS="$ARCH_OPTS -O0" ;;
             *" random.c "*|*" random.dir/random"*".c "*)
                 ARCH_OPTS="$ARCH_OPTS -O0" ;;
-            esac ;;
+                esac
+                ;;
         sparc*)
             case "$*" in
             *" lexer.c "*|*" modules.dir/lexer"*".c "*)
@@ -531,40 +542,54 @@
             *" modules.c "*|*" modules.dir/modules"*".c "*)
                 ARCH_OPTS="$ARCH_OPTS -O1" ;;
             esac
-    esac ;;
+                ;;
+        esac
+        ;;
 esac
 
 # On sparc-sun-solaris2, we need to use -fPIC rather than -fpic if we're
 # using grade `none', because otherwise the Mercury standard library
 # overflows the fixed limit on the number of "small pic" references.
 
-case "$FULLARCH" in sparc-sun-solaris2*)
-    case "$grade" in none)
-        case "$*" in *-fpic*)
+case "$FULLARCH" in
+    sparc-sun-solaris2*)
+        case "$grade" in
+            none)
+                case "$*" in
+                    *-fpic*)
             echo "mgnuc: using -fPIC rather than -fpic"
             OVERRIDE_OPTS="$OVERRIDE_OPTS -fPIC"
             ;;
-        esac ;;
-    esac ;;
+                esac
+                ;;
+        esac
+        ;;
 esac
 
 # The -floop-optimize option is incompatible with the global register code
 # we generated on Darwin PowerPC. See the hard_coded/ppc_bug test case
 # for an example program which fails with this optimization.
 
-case $FULLARCH in powerpc*apple*darwin*)
-    case $highlevel_code in false)
-        case $global_regs in true)
+case $FULLARCH in
+    powerpc*apple*darwin*)
+        case $highlevel_code in
+            false)
+                case $global_regs in
+                    true)
             ARCH_OPTS="$ARCH_OPTS -fno-loop-optimize" ;;
         esac
     esac
 esac
 
-case $assemble in true)
-    case $verbose in true)
-        echo $AS $AS_OPTS "$@" ;;
+case $assemble in
+    true)
+        case $verbose in
+            true)
+                echo $AS $AS_OPTS "$@"
+                ;;
     esac
-    exec $AS $AS_OPTS "$@" ;;
+        exec $AS $AS_OPTS "$@"
+        ;;
 esac
 
 if test -r .mgnuc_copts
@@ -608,10 +633,14 @@
     $ARG_OPTS\
     $INVISIBLE_OPTS"
 
-case $verbose in true)
-    echo $CC $ALL_CC_OPTS "$@" $OVERRIDE_OPTS $ALL_LOCAL_C_INCL_DIRS;;
+case $verbose in
+    true)
+        echo $CC $ALL_CC_OPTS "$@" $OVERRIDE_OPTS $ALL_LOCAL_C_INCL_DIRS
+        ;;
 esac
 case $# in
-    0) exec $CC $ALL_CC_OPTS $OVERRIDE_OPTS ;;
-    *) exec $CC $ALL_CC_OPTS "$@" $OVERRIDE_OPTS $ALL_LOCAL_C_INCL_DIRS;;
+    0)  exec $CC $ALL_CC_OPTS $OVERRIDE_OPTS
+        ;;
+    *)  exec $CC $ALL_CC_OPTS "$@" $OVERRIDE_OPTS $ALL_LOCAL_C_INCL_DIRS
+        ;;
 esac
Index: scripts/mkfifo_using_mknod.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mkfifo_using_mknod.in,v
retrieving revision 1.3
diff -u -b -r1.3 mkfifo_using_mknod.in
--- scripts/mkfifo_using_mknod.in	27 Jul 1997 15:09:34 -0000	1.3
+++ scripts/mkfifo_using_mknod.in	12 Nov 2006 08:44:24 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995-1996 The University of Melbourne.
@@ -13,7 +14,8 @@
 # ENVIRONMENT VARIABLES: MERCURY_MKNOD
 
 MKNOD=${MERCURY_MKNOD=@MKNOD@}
-if [ $# -ne 1 ]; then
+if test $# -ne 1
+then
 	echo "Usage: `basename $0` filename" 1>&2
 	exit 1
 fi
Index: scripts/ml.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/ml.in,v
retrieving revision 1.117
diff -u -b -r1.117 ml.in
--- scripts/ml.in	2 Oct 2006 09:06:51 -0000	1.117
+++ scripts/ml.in	12 Nov 2006 08:50:43 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995-2006 The University of Melbourne.
@@ -130,7 +131,8 @@
 
 # If you haven't set all_libs, set it to the default value
 # (shared on most systems).
-case $all_libs in default)
+case $all_libs in
+    default)
 	all_libs=shared
 	case $FULLARCH in
 		i*86-*-linux*|i*86-*-freebsd*|i*86-*-cygwin*)
@@ -142,7 +144,8 @@
 			# only available for dynamically linked executables
 			# XXX With these defaults linking with Mercury
 			# libraries other than the standard library will fail.
-			case $make_shared_lib in false)
+                case $make_shared_lib in
+                    false)
 				all_libs=static
 				;;
 			esac
@@ -153,8 +156,10 @@
 
 # Defaults have been set, now set options.
 
-case $all_libs in static)
+case $all_libs in
+    static)
 	MAYBE_STATIC_OPT=$LD_STATIC_FLAGS
+        ;;
 esac
 
 #
@@ -197,7 +202,8 @@
 
 # if the --print-gc-grade option is specified,
 # then all we do is print the gc grade and then exit
-case "$print_gc_grade" in true)
+case "$print_gc_grade" in
+    true)
 	echo $gc_grade
 	exit 0
 esac
@@ -209,8 +215,7 @@
 		;;
 	*)
 		LIBGC="-l$gc_grade"
-		LIBGC_STATIC=`$FIX_PATH_FOR_LINKER \
-			$LIBDIR/lib$gc_grade. at LIB_SUFFIX@`
+        LIBGC_STATIC=`$FIX_PATH_FOR_LINKER $LIBDIR/lib$gc_grade. at LIB_SUFFIX@`
 		;;
 esac
 
@@ -246,17 +251,19 @@
 
 # Determine whether to link the executable with debugging symbols when using
 # MSVC.
-if [ $strip = "false" -a $COMPILER = "cl" ]
+if test $strip = "false" -a $COMPILER = "cl"
 then
     DEBUG_FLAG="/DEBUG"
 else
     DEBUG_FLAG=""
 fi
 
-case $gc_method in mps)
+case $gc_method in
+    mps)
 	use_thread_libs=true ;;
-esac
-case $thread_safe in true)
+    esac
+case $thread_safe in
+    true)
 	use_thread_libs=true ;;
 esac
 
@@ -268,7 +275,8 @@
 
 # Set the correct flags if we're to use the MS Visual C runtime.
 use_msvcrt=@USE_MSVCRT@
-if test $use_msvcrt = "yes"; then
+if test $use_msvcrt = "yes"
+then
 	MSVCRT_OPTS="/MD" # enable linking with the MS Visual C runtime
 	NODEFAULTLIB_FLAG="/nodefaultlib:libc"
 else
@@ -286,8 +294,10 @@
 	RPATH_OPT="$SHLIB_RPATH_OPT"
 	RPATH_SEP="$SHLIB_RPATH_SEP"
 	STDLIBS="$SHARED_LIBS $THREAD_LIBS"
-	case $trace in true)
+        case $trace in
+            true)
 		ARCH_OPTS="$ARCH_OPTS $LD_LIBFLAGS_FOR_TRACE"
+                ;;
 	esac
 	;;
     false)
@@ -296,8 +306,10 @@
 	RPATH_OPT="$EXE_RPATH_OPT"
 	RPATH_SEP="$EXE_RPATH_SEP"
 	STDLIBS="$MATH_LIB $THREAD_LIBS"
-	case $trace in true)
+        case $trace in
+            true)
 		ARCH_OPTS="$ARCH_OPTS $LDFLAGS_FOR_TRACE"
+                ;;
 	esac
 	;;
 esac
@@ -305,17 +317,21 @@
 # if the --print-link-command option is specified,
 # then all we do is print the command used to link executables
 # and then exit.
-case "$print_link_command" in true)
+case "$print_link_command" in
+    true)
 	echo $LINKER
 	exit 0
+        ;;
 esac
 
 # if the --print-shared-lib-command option is specified,
 # then all we do is print the command used to link executables
 # and then exit.
-case "$print_shared_lib_link_command" in true)
+case "$print_shared_lib_link_command" in
+    true)
 	echo $LINK_SHARED_OBJ
 	exit 0
+        ;;
 esac
 
 if $print_map
@@ -330,8 +346,10 @@
 	@LIB_LIBPATH@$LIBDIR
 "
 system_libdir_opts=
-for dir in $ALL_LOCAL_C_LIB_DIRS kludge_for_broken_shells; do
-	if [ "$dir" != "kludge_for_broken_shells" ]; then
+for dir in $ALL_LOCAL_C_LIB_DIRS kludge_for_broken_shells
+do
+    if test "$dir" != "kludge_for_broken_shells"
+    then
 		system_libdir_opts="@LIB_LIBPATH@$dir $system_libdir_opts"
 	fi
 done
@@ -354,7 +372,8 @@
 		LIBS=${LIBS="$MERCURY_LIBS $TRACE_LIBS_SYSTEM $STDLIBS"}
 		merc_shlib_dirs=""
 		;;
-	none)	LIBS="$TRACE_LIBS_SYSTEM $STDLIBS"
+    none)
+        LIBS="$TRACE_LIBS_SYSTEM $STDLIBS"
 		LIBDIR_OPTS="$user_libdir_opts $system_libdir_opts"
 		merc_shlib_dirs=""
 		;;
@@ -412,7 +431,7 @@
 
 case $demangle in
     true)
-	# we would like to just run $CC and pipe the result into $DEMANGLER,
+        # We would like to just run $CC and pipe the result into $DEMANGLER,
 	# but `$CC | $DEMANGLER' would return the wrong exit status, so
 	# we need to use a named pipe; if the system doesn't have named
 	# pipes, then we don't use the demangler
@@ -429,37 +448,42 @@
 	do
 		try="`expr $try + 1`"
 		# give up after 20 tries
-		case "$try" in 20)
-			echo "ml: unable to create temporary directory" \
-				"for pipe" 1>&2
+            case "$try" in
+                20)
+                    echo "ml: unable to create temporary directory for pipe" \
+                        1>&2
 			exit 1
+                    ;;
 		esac
 	done
 	trap 'rm -rf $ML_TMPDIR; exit 1' 1 2 3 13 15 
 	umask $old_umask
 	$MKFIFO $PIPE
-		# execute the demangler in the background, with stdin 
-		# coming from the pipe and with stdout redirected to stderr
+        # Execute the demangler in the background, with stdin coming from
+        # the pipe and with stdout redirected to stderr.
 	exec $DEMANGLER --explain-link-errors 1>&2 < $PIPE &
-		# execute $CC with stdout & stderr redirected to
-		# go via the pipe to $DEMANGLER and then to stderr
+        # Execute $CC with stdout & stderr redirected to go via the pipe
+        # to $DEMANGLER and then to stderr.
 	case $# in
-    		0) $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS >$PIPE 2>&1 ;;
-    		*) $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS \
-			>$PIPE 2>&1 ;;
+            0)  $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS >$PIPE 2>&1
+                ;;
+            *)  $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS >$PIPE 2>&1
+                ;;
 	esac
 	linker_status=$?
-		# now we can remove the pipe; since is an open file, it will
-		# stay around until $DEMANGLER exits
+        # Now we can remove the pipe; since is an open file, it will
+        # stay around until $DEMANGLER exits.
 	rm -rf $ML_TMPDIR
-		# wait for the demangler to exit before exiting ourselves
+        # Wait for the demangler to exit before exiting ourselves.
 	wait
 	exit $linker_status
 	;;
-false)
+    false)
 	case $# in
-    		0) exec $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS ;;
-    		*) exec $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS ;;
+            0)  exec $LINKER $LINKER_PRE_FLAGS $LINKER_POST_FLAGS
+                ;;
+            *)  exec $LINKER $LINKER_PRE_FLAGS "$@" $LINKER_POST_FLAGS
+                ;;
 	esac
 	;;
 esac
Index: scripts/mmake.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mmake.in,v
retrieving revision 1.49
diff -u -b -r1.49 mmake.in
--- scripts/mmake.in	30 Nov 2005 16:23:51 -0000	1.49
+++ scripts/mmake.in	12 Nov 2006 08:54:07 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995-1999,2001-2005 The University of Melbourne.
@@ -87,7 +88,8 @@
 include_makefile=
 verbose=false
 save_makefile=false
-if [ -d Mercury ]; then
+if test -d Mercury
+then
 	use_subdirs=${MMAKE_USE_SUBDIRS=yes}
 else
 	use_subdirs=${MMAKE_USE_SUBDIRS=no}
@@ -96,7 +98,8 @@
 warn_undefined_vars=true
 target_asm=${MMAKE_TARGET_ASM=default}
 
-while [ $# -gt 0 ]; do
+while test $# -gt 0
+do
 	case "$1" in
 		-h|--help)
 			echo "$Help"
@@ -120,16 +123,20 @@
 			;;
 		--target)
 			case "$2" in
-				asm)	target_asm=yes ;;
-				c)	target_asm=no ;;
+                asm)    target_asm=yes
+                        ;;
+                c)      target_asm=no
+                        ;;
 				il)	# XXX we should do something
 					# sensible for `--target il'
 					echo "$0: warning: \`--target il'" \
 						"option not supported." 1>&2
-					target_asm=no ;;
+                        target_asm=no
+                        ;;
 				*)	echo "$0: invalid argument to" \
 						"\`--target' option" 1>&2
-					exit 1 ;;
+                        exit 1
+                        ;;
 			esac
 			shift; shift
 			;;
@@ -208,7 +215,7 @@
 	yes)	use_subdirs=yes ;;		
 esac
 
-if [ "$MERCURY_CONFIG_DIR" != "" ]
+if test "$MERCURY_CONFIG_DIR" != ""
 then
 	MMAKE_DIR=${MMAKE_DIR=$MERCURY_CONFIG_DIR/mmake}
 	export MERCURY_CONFIG_DIR
@@ -226,12 +233,16 @@
 		;;
 esac
 
-if [ "$mmake" = "" ]; then
-	if [ "$MMAKEFILE" = "" ]; then
-		if [ -f Mmakefile ]; then
+if test "$mmake" = ""
+then
+    if test "$MMAKEFILE" = ""
+    then
+        if test -f Mmakefile
+        then
 			MMAKEFILE="Mmakefile"
 		else
-			if [ -f Mmake ]; then
+            if test -f Mmake
+            then
 				MMAKEFILE="Mmake"
 			else
 				MMAKEFILE=""
@@ -245,29 +256,35 @@
 case $use_subdirs in
 	no)
 		dvs="`echo *.dv`"
-		if [ "$dvs" = "*.dv" ]; then
+        if test "$dvs" = "*.dv"
+        then
 			dvs=""
 		fi
 		deps="`echo *.dep`"
-		if [ "$deps" = "*.dep" ]; then
+        if test "$deps" = "*.dep"
+        then
 			deps=""
 		fi
 		ds="`echo *.d`"
-		if [ "$ds" = "*.d" ]; then
+        if test "$ds" = "*.d"
+        then
 			ds=""
 		fi
 		;;
 	yes)
 		dvs="`echo Mercury/deps/*.dv`"
-		if [ "$dvs" = "Mercury/deps/*.dv" ]; then
+        if test "$dvs" = "Mercury/deps/*.dv"
+        then
 			dvs=""
 		fi
 		deps="`echo Mercury/deps/*.dep`"
-		if [ "$deps" = "Mercury/deps/*.dep" ]; then
+        if test "$deps" = "Mercury/deps/*.dep"
+        then
 			deps=""
 		fi
 		ds="`echo Mercury/ds/*.d`"
-		if [ "$ds" = "Mercury/ds/*.d" ]; then
+        if test "$ds" = "Mercury/ds/*.d"
+        then
 			ds=""
 		fi
 		;;
@@ -276,7 +293,8 @@
 MMAKE_USE_SUBDIRS=$use_subdirs
 MMAKE_USE_MMC_MAKE=$use_mmc_make
 
-if $save_makefile; then
+if $save_makefile
+then
 	tmp=Mmake.makefile
 else
 	case "$MKTEMP" in
@@ -292,10 +310,12 @@
 			do
 				try=`expr $try + 1`
 				# give up after 20 tries
-				case $try in 20)
+                    case $try in
+                        20)
 					echo "mmake: unable to create directory" \
 						"for temporary makefile" 1>&2
 					exit 1
+                            ;;
 				esac
 			done
 			trap 'status=$?; rm -rf $mmake_tmpdir; exit $status' \
@@ -336,12 +356,14 @@
 
 # For backwards compatibility/bootstrapping:
 # If no `.dv' files exist, use the `.dep' files instead.
-if [ "$dvs" = "" ] ; then
+if test "$dvs" = ""
+then
 	dvs=$deps
 	deps=
 fi
 
-if $verbose; then
+if $verbose
+then
 	echo MMAKE=$MMAKE
 	echo export MMAKE
 	echo MMAKE_MAKE_CMD=$MMAKE_MAKE_CMD
@@ -381,7 +403,7 @@
 } > $tmp
 case $# in
 	# Note that we can't use `exec' here, because if we did that,
-	# that `trap' code which removes $tmp would never get executed.
+    # the `trap' code which removes $tmp would never get executed.
 	0) ${MMAKE_MAKE} ${MMAKE_MAKE_OPTS} -f $tmp -r ${set_target_asm} ;;
 	*) ${MMAKE_MAKE} ${MMAKE_MAKE_OPTS} -f $tmp -r ${set_target_asm} "$@" ;;
 esac
Index: scripts/mmc.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mmc.in,v
retrieving revision 1.39
diff -u -b -r1.39 mmc.in
--- scripts/mmc.in	25 Oct 2005 10:17:28 -0000	1.39
+++ scripts/mmc.in	12 Nov 2006 08:54:19 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1994-1998, 2000-2005 The University of Melbourne.
Index: scripts/mprof.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/mprof.in,v
retrieving revision 1.6
diff -u -b -r1.6 mprof.in
--- scripts/mprof.in	25 Oct 2005 10:17:28 -0000	1.6
+++ scripts/mprof.in	12 Nov 2006 08:54:27 -0000
@@ -1,4 +1,5 @@
 #! /bin/sh
+# vim: ts=4 sw=4 et
 # @configure_input@
 #---------------------------------------------------------------------------#
 # Copyright (C) 1995, 2005 The University of Melbourne.
Index: scripts/parse_ml_options.sh-subr.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/parse_ml_options.sh-subr.in,v
retrieving revision 1.12
diff -u -b -r1.12 parse_ml_options.sh-subr.in
--- scripts/parse_ml_options.sh-subr.in	24 Feb 2006 07:11:21 -0000	1.12
+++ scripts/parse_ml_options.sh-subr.in	12 Nov 2006 08:56:48 -0000
@@ -1,3 +1,4 @@
+# vim: ts=4 sw=4 et
 #---------------------------------------------------------------------------#
 # Copyright (C) 2001-2006 The University of Melbourne.
 # This file may only be copied under the terms of the GNU General
@@ -226,7 +227,8 @@
 #         Break up the initialization into groups of at most <n> function
 #         calls.  (Default value of <n> is 40.)
  
-while : ; do
+while :
+do
     case "$1" in
 	-h|--help|"-?")
 		echo "$Help"
@@ -308,13 +310,15 @@
 		;;
 	-shared|--shared)
 		all_libs=shared
-		case $mercury_libs in static|default)
+            case $mercury_libs in
+                static|default)
 			mercury_libs=shared ;;
 		esac
 		;;
 	-static|--static)
 		all_libs=static
-		case $mercury_libs in shared|default)
+            case $mercury_libs in
+                shared|default)
 			mercury_libs=static ;;
 		esac
 		;;
Index: scripts/prepare_tmp_dir_fixed_part.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/scripts/prepare_tmp_dir_fixed_part.in,v
retrieving revision 1.1
diff -u -b -r1.1 prepare_tmp_dir_fixed_part.in
--- scripts/prepare_tmp_dir_fixed_part.in	28 Jan 2005 07:11:59 -0000	1.1
+++ scripts/prepare_tmp_dir_fixed_part.in	12 Nov 2006 08:56:59 -0000
@@ -1,4 +1,5 @@
 #!/bin/sh
+# vim: ts=4 sw=4 et
 #---------------------------------------------------------------------------#
 # Copyright (C) 2005 The University of Melbourne.
 # This file may only be copied under the terms of the GNU General
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list