Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita08eb45

Browse files
committed
More initdb cleanup
1 parent24edd34 commita08eb45

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

‎src/bin/initdb/initdb.sh

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#
2828
#
2929
# IDENTIFICATION
30-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.71 1999/12/18 02:48:53 momjian Exp $
30+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.72 1999/12/18 02:56:01 momjian Exp $
3131
#
3232
#-------------------------------------------------------------------------
3333

@@ -65,21 +65,23 @@ then
6565
PGPATH=`echo$0| sed's,/[^/]*$,,'`# (dirname command is not portable)
6666
else
6767
# look for it in PATH ('which' command is not portable)
68-
fordirin`echo"$PATH"| sed's/:/ /g'`;do
68+
fordirin`echo"$PATH"| sed's/:/ /g'`
69+
do
6970
# empty entry in path means current dir
7071
[-z"$dir" ]&& dir='.'
7172
if [-f"$dir/$CMDNAME" ]
72-
then
73+
then
7374
PGPATH="$dir"
7475
break
7576
fi
7677
done
7778
fi
7879

7980
# Check if needed programs actually exist in path
80-
forprogin postgres pg_version;do
81+
forprogin postgres pg_version
82+
do
8183
if [!-x"$PGPATH/$prog" ]
82-
then
84+
then
8385
echo"The program$prog needed by$CMDNAME could not be found. It was"
8486
echo"expected at:"
8587
echo"$PGPATH/$prog"
@@ -111,11 +113,6 @@ template_only=0
111113
# user.
112114
POSTGRES_SUPERUSERNAME="$EffectiveUser"
113115

114-
# Note: The sysid can be freely selected. This will probably confuse matters,
115-
# but if your Unix user postgres is uid 48327 you might chose to start
116-
# at 0 (or 1) in the database.
117-
POSTGRES_SUPERUSERID="$EUID"
118-
119116
Password='_null_'
120117

121118
while ["$#"-gt 0 ]
@@ -225,7 +222,7 @@ then
225222
if [-n"$MULTIBYTE" ]
226223
then
227224
echo" -e ENCODING, --pgencoding=ENCODING"
228-
fi
225+
fi
229226
echo" -?, --help"
230227
echo""
231228
exit 0
@@ -237,9 +234,9 @@ fi
237234

238235
if ["$MULTIBYTE" ]
239236
then
240-
MULTIBYTEID=`$PGPATH/pg_encoding$MULTIBYTE`
237+
MULTIBYTEID=`$PGPATH/pg_encoding$MULTIBYTE`
241238
if ["$?"-ne 0 ]
242-
then
239+
then
243240
echo"The program pg_encoding failed. Perhaps you did not configure"
244241
echo"PostgreSQL for multibyte support or the program was not success-"
245242
echo"fully installed."
@@ -298,9 +295,10 @@ echo
298295

299296
if [-z"$PGLIB" ]
300297
then
301-
fordirin"$PGPATH/../lib""$PGPATH/../lib/pgsql";do
298+
fordirin"$PGPATH/../lib""$PGPATH/../lib/pgsql"
299+
do
302300
if [-f"$dir/global1.bki.source" ]
303-
then
301+
then
304302
PGLIB="$dir"
305303
break
306304
fi
@@ -355,7 +353,7 @@ umask 077
355353
if [-f"$PGDATA"/PG_VERSION ]
356354
then
357355
if ["$template_only"-eq 0 ]
358-
then
356+
then
359357
echo"$CMDNAME: The file$PGDATA/PG_VERSION already exists."
360358
echo"This probably means initdb has already been run and the"
361359
echo"database system already exists."
@@ -381,7 +379,7 @@ else
381379
mkdir"$PGDATA"/base|| exit_nicely
382380
fi
383381
if [!-d"$PGDATA"/pg_xlog ]
384-
then
382+
then
385383
echo"Creating database XLOG directory$PGDATA/pg_xlog"
386384
mkdir"$PGDATA"/pg_xlog|| exit_nicely
387385
fi
@@ -448,7 +446,7 @@ then
448446
# Gotta remove that temp file before exiting on error.
449447
retval="$?"
450448
if ["$noclean"-eq 0 ]
451-
then
449+
then
452450
rm -f"$TEMPFILE"|| exit_nicely
453451
fi
454452
["$retval"-ne 0 ]&& exit_nicely

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp