2727# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
2828# Portions Copyright (c) 1994, Regents of the University of California
2929#
30- # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.197 2003/07/22 00:02:55 momjian Exp $
30+ # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.198 2003/07/23 08:46:54 petere Exp $
3131#
3232# -------------------------------------------------------------------------
3333
3939exit_nicely (){
4040 sttyecho > /dev/null2>&1
4141echo 1>&2
42- echo " $CMDNAME failed. " 1>&2
42+ echo " $CMDNAME : failed" 1>&2
4343if [" $noclean " != yes ]; then
4444if [" $made_new_pgdata " = yes ]; then
45- echo " Removing $PGDATA . " 1>&2
46- rm -rf" $PGDATA " || echo " Failed. " 1>&2
45+ echo " $CMDNAME : removing data directory \" $PGDATA \" " 1>&2
46+ rm -rf" $PGDATA " || echo " $CMDNAME : failed " 1>&2
4747fi
4848else
49- echo " Data directory$PGDATA will notbe removed at user's request. " 1>&2
49+ echo " $CMDNAME : data directory\" $PGDATA \" not removed at user's request" 1>&2
5050fi
5151exit 1
5252}
@@ -135,7 +135,7 @@ elif [ -x "$bindir/postgres" ]; then
135135 errormsg=` $bindir /postgres -V2>&1 > /dev/null`
136136 (
137137echo " The program"
138- echo " ' $bindir /postgres' "
138+ echo " $bindir /postgres"
139139echo " needed by$CMDNAME does not belong to PostgreSQL version$VERSION , or"
140140echo " there may be a configuration problem."
141141if test x" $errormsg " ! = x" " ; then
@@ -147,17 +147,17 @@ elif [ -x "$bindir/postgres" ]; then
147147exit 1
148148fi
149149else
150- echo " The program' postgres' is needed by$CMDNAME but was not found in" 1>&2
151- echo " the directory' $bindir ' . Check your installation." 1>&2
150+ echo " The program\" postgres\" is needed by$CMDNAME but was not found in" 1>&2
151+ echo " the directory\" $bindir \" . Check your installation." 1>&2
152152exit 1
153153fi
154154
155155
156156# Now we can assume that 'pg_id' belongs to the same version as the
157157# verified 'postgres' in the same directory.
158158if [! -x " $PGPATH /pg_id" ]; then
159- echo " The program' pg_id' is needed by$CMDNAME but was not found in" 1>&2
160- echo " the directory' $PGPATH ' . Check your installation." 1>&2
159+ echo " The program\" pg_id\" is needed by$CMDNAME but was not found in" 1>&2
160+ echo " the directory\" $PGPATH \" . Check your installation." 1>&2
161161exit 1
162162fi
163163
170170
171171if [` $PGPATH /pg_id -u` -eq 0 ]
172172then
173- echo " You cannot run$CMDNAME as root. Please log in (using, e.g., 'su')" 1>&2
174- echo " as the (unprivileged) user that will own the server process." 1>&2
173+ echo " $CMDNAME : cannot be run as root" 1>&2
174+ echo " Please log in (using, e.g.,\" su\" ) as the (unprivileged) user that will" 1>&2
175+ echo " own the server process." 1>&2
175176exit 1
176177fi
177178
215216 ;;
216217 --debug|-d)
217218 debug=yes
218- echo " Runningwith debug mode on ."
219+ echo " Runningin debug mode."
219220 ;;
220221 --show|-s)
221222 show_setting=yes
222223 ;;
223224 --noclean|-n)
224225 noclean=yes
225- echo " Runningwith noclean mode on. Mistakes will not be cleaned up."
226+ echo " Runningin noclean mode. Mistakes will not be cleaned up."
226227 ;;
227228# The name of the database superuser. Can be freely changed.
228229 --username|-U)
319320
320321-* )
321322echo " $CMDNAME : invalid option:$1 "
322- echo " Try' $CMDNAME --help' for more information."
323+ echo " Try\" $CMDNAME --help\" for more information."
323324exit 1
324325;;
325326
381382fi
382383if [-z " $ENCODINGID " ]
383384then
384- echo " $CMDNAME :$ENCODING is not a validbackend encoding name" 1>&2
385+ echo " $CMDNAME :\" $ENCODING \" is not a validserver encoding name" 1>&2
385386exit 1
386387fi
387388fi
394395if [-z " $PGDATA " ]
395396then
396397 (
397- echo " $CMDNAME : You must identify where the the data for this database"
398- echo " system will reside. Do this with either a -D invocation"
399- echo " option or a PGDATA environment variable."
398+ echo " $CMDNAME : no data directory specified"
399+ echo " You must identify the directory where the data for this database system"
400+ echo " will reside. Do this with either the invocation option -D or the"
401+ echo " environment variable PGDATA."
400402 )1>&2
401403exit 1
402404fi
@@ -417,7 +419,7 @@ if [ "$show_setting" = yes ] || [ "$debug" = yes ]
417419then
418420 (
419421echo
420- echo " initdb variables:"
422+ echo " $CMDNAME : internal variables:"
421423for var in PGDATA datadir PGPATH ENCODING ENCODINGID \
422424 POSTGRES_SUPERUSERNAME POSTGRES_BKI \
423425 POSTGRES_DESCR POSTGRESQL_CONF_SAMPLE \
@@ -436,9 +438,9 @@ for PREREQ_FILE in "$POSTGRES_BKI" "$POSTGRES_DESCR" \
436438do
437439if [! -f " $PREREQ_FILE " ]; then
438440 (
439- echo " $CMDNAME does not find the file' $PREREQ_FILE '. "
441+ echo " $CMDNAME : file\" $PREREQ_FILE \" not found "
440442echo " This means you have a corrupted installation or identified the"
441- echo " wrong directory with the-L invocation option."
443+ echo " wrong directory with the invocation option -L ."
442444 )1>&2
443445exit 1
444446fi
@@ -448,9 +450,8 @@ for file in "$POSTGRES_BKI"
448450do
449451if [ x" ` sed 1q$file ` " != x" # PostgreSQL$short_version " ]; then
450452 (
451- echo " The input file '$file ' needed by$CMDNAME does not"
452- echo " belong to PostgreSQL$VERSION . Check your installation or specify the"
453- echo " correct path using the -L option."
453+ echo " $CMDNAME : input file\" $file \" does not belong to PostgreSQL$VERSION "
454+ echo " Check your installation or specify the correct path using the option -L."
454455 )1>&2
455456exit 1
456457fi
@@ -493,10 +494,10 @@ pgdata_contents=`ls -A "$PGDATA" 2>/dev/null`
493494if [ x" $pgdata_contents " != x ]
494495then
495496 (
496- echo " $CMDNAME :The directory$PGDATA exists but is not empty. "
497+ echo " $CMDNAME : directory\" $PGDATA \" exists but is not empty"
497498echo " If you want to create a new database system, either remove or empty"
498- echo " the directory$PGDATA or runinitdb with"
499- echo " an argument other than $PGDATA ."
499+ echo " the directory\" $PGDATA \" or run$CMDNAME with an argument other than "
500+ echo " \" $PGDATA \" ."
500501 )1>&2
501502exit 1
502503else
505506 mkdir -p" $PGDATA " > /dev/null2>&1 || mkdir" $PGDATA " || exit_nicely
506507 made_new_pgdata=yes
507508else
508- $ECHO_N " Fixing permissions on existing directory$PGDATA ..." $ECHO_C
509+ $ECHO_N " fixing permissions on existing directory$PGDATA ..." $ECHO_C
509510chmod go-rwx" $PGDATA " || exit_nicely
510511fi
511512echo " ok"
685686fi
686687if [! -f " $PGDATA " /global/pg_pwd ]; then
687688echo
688- echo " The password file wasn't generated. Please report this problem." 1>&2
689+ echo " $CMDNAME : The password file wasn't generated. Please report this problem." 1>&2
689690 exit_nicely
690691fi
691692echo " ok"