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

Commitc154fc3

Browse files
committed
Apply message style guide to frontend programs.
1 parenta0743b1 commitc154fc3

30 files changed

+325
-331
lines changed

‎src/bin/initdb/initdb.sh

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
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

@@ -39,14 +39,14 @@
3939
exit_nicely(){
4040
sttyecho> /dev/null2>&1
4141
echo1>&2
42-
echo"$CMDNAME failed."1>&2
42+
echo"$CMDNAME: failed"1>&2
4343
if ["$noclean"!= yes ];then
4444
if ["$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
4747
fi
4848
else
49-
echo"Datadirectory$PGDATA willnotberemoved at user's request."1>&2
49+
echo"$CMDNAME: datadirectory\"$PGDATA\"not removed at user's request"1>&2
5050
fi
5151
exit 1
5252
}
@@ -135,7 +135,7 @@ elif [ -x "$bindir/postgres" ]; then
135135
errormsg=`$bindir/postgres -V2>&1>/dev/null`
136136
(
137137
echo"The program"
138-
echo"'$bindir/postgres'"
138+
echo"$bindir/postgres"
139139
echo"needed by$CMDNAME does not belong to PostgreSQL version$VERSION, or"
140140
echo"there may be a configuration problem."
141141
iftest x"$errormsg"!= x"";then
@@ -147,17 +147,17 @@ elif [ -x "$bindir/postgres" ]; then
147147
exit 1
148148
fi
149149
else
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
152152
exit 1
153153
fi
154154

155155

156156
# Now we can assume that 'pg_id' belongs to the same version as the
157157
# verified 'postgres' in the same directory.
158158
if [!-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
161161
exit 1
162162
fi
163163

@@ -170,8 +170,9 @@ fi
170170

171171
if [`$PGPATH/pg_id -u`-eq 0 ]
172172
then
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
175176
exit 1
176177
fi
177178

@@ -215,14 +216,14 @@ do
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)
@@ -319,7 +320,7 @@ do
319320

320321
-*)
321322
echo"$CMDNAME: invalid option:$1"
322-
echo"Try'$CMDNAME --help' for more information."
323+
echo"Try\"$CMDNAME --help\" for more information."
323324
exit 1
324325
;;
325326

@@ -381,7 +382,7 @@ then
381382
fi
382383
if [-z"$ENCODINGID" ]
383384
then
384-
echo"$CMDNAME:$ENCODING is not a validbackend encoding name"1>&2
385+
echo"$CMDNAME:\"$ENCODING\" is not a validserver encoding name"1>&2
385386
exit 1
386387
fi
387388
fi
@@ -394,9 +395,10 @@ fi
394395
if [-z"$PGDATA" ]
395396
then
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
401403
exit 1
402404
fi
@@ -417,7 +419,7 @@ if [ "$show_setting" = yes ] || [ "$debug" = yes ]
417419
then
418420
(
419421
echo
420-
echo"initdb variables:"
422+
echo"$CMDNAME: internal variables:"
421423
forvarin 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" \
436438
do
437439
if [!-f"$PREREQ_FILE" ];then
438440
(
439-
echo"$CMDNAME does not find thefile'$PREREQ_FILE'."
441+
echo"$CMDNAME:file\"$PREREQ_FILE\" not found"
440442
echo"This means you have a corrupted installation or identified the"
441-
echo"wrong directory with the-Linvocation option."
443+
echo"wrong directory with the invocation option -L."
442444
)1>&2
443445
exit 1
444446
fi
@@ -448,9 +450,8 @@ for file in "$POSTGRES_BKI"
448450
do
449451
if [ 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
455456
exit 1
456457
fi
@@ -493,10 +494,10 @@ pgdata_contents=`ls -A "$PGDATA" 2>/dev/null`
493494
if [ x"$pgdata_contents"!= x ]
494495
then
495496
(
496-
echo"$CMDNAME:Thedirectory$PGDATA exists but is not empty."
497+
echo"$CMDNAME: directory\"$PGDATA\" exists but is not empty"
497498
echo"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
501502
exit 1
502503
else
@@ -505,7 +506,7 @@ else
505506
mkdir -p"$PGDATA">/dev/null2>&1|| mkdir"$PGDATA"|| exit_nicely
506507
made_new_pgdata=yes
507508
else
508-
$ECHO_N"Fixing permissions on existing directory$PGDATA..."$ECHO_C
509+
$ECHO_N"fixing permissions on existing directory$PGDATA..."$ECHO_C
509510
chmod go-rwx"$PGDATA"|| exit_nicely
510511
fi
511512
echo"ok"
@@ -685,7 +686,7 @@ EOF
685686
fi
686687
if [!-f"$PGDATA"/global/pg_pwd ];then
687688
echo
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
690691
fi
691692
echo"ok"

‎src/bin/initlocation/initlocation.sh

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#
1010
#
1111
# IDENTIFICATION
12-
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.15 2002/10/18 22:05:35 petere Exp $
12+
# $Header: /cvsroot/pgsql/src/bin/initlocation/Attic/initlocation.sh,v 1.16 2003/07/23 08:46:57 petere Exp $
1313
#
1414
#-------------------------------------------------------------------------
1515

1616
exit_nicely(){
17-
echo"$CMDNAME failed."
17+
echo"$CMDNAME: failed"1>&2
1818
rm -rf"$PGALTDATA"
1919
exit 1
2020
}
@@ -25,8 +25,9 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
2525

2626
if ["$USER"='root'-o"$LOGNAME"='root' ]
2727
then
28-
echo"You cannot run$CMDNAME as root. Please log in (using, e.g., 'su')"
29-
echo"as the (unprivileged) user that will own the server process."
28+
echo"$CMDNAME: cannot be run as root"1>&2
29+
echo"Please log in (using, e.g.,\"su\") as the (unprivileged) user that will"1>&2
30+
echo"own the server process."1>&2
3031
exit 1
3132
fi
3233

@@ -52,7 +53,7 @@ do
5253

5354
-*)
5455
echo"$CMDNAME: invalid option:$1"1>&2
55-
echo"Try'$CMDNAME --help' for more information."1>&2
56+
echo"Try\"$CMDNAME --help\" for more information."1>&2
5657
exit 1
5758
;;
5859
*)
@@ -79,7 +80,7 @@ fi
7980

8081
if [-z"$Location" ];then
8182
echo"$CMDNAME: missing required argument LOCATION"1>&2
82-
echo"Try'$CMDNAME -?' forhelp."1>&2
83+
echo"Try\"$CMDNAME --help\" formore information."1>&2
8384
exit 1
8485
fi
8586

@@ -112,8 +113,8 @@ else
112113
haveenv=f
113114
fi
114115

115-
echo"The location will beinitialized with username\"$EffectiveUser\"."
116-
echo"This userwill own all the files andmust also own the server process."
116+
echo"Thefiles belonging to thislocation will beowned by user\"$EffectiveUser\"."
117+
echo"This user must also own the server process."
117118
echo
118119

119120
# -----------------------------------------------------------------------
@@ -127,29 +128,29 @@ trap 'echo "Caught signal." ; exit_nicely' 1 2 3 15
127128
umask 077
128129

129130
if [!-d"$PGALTDATA" ];then
130-
echo"Creating directory$PGALTDATA"
131+
echo"creating directory$PGALTDATA"
131132
mkdir"$PGALTDATA"
132133
if ["$?"-ne 0 ];then
133-
echo"$CMDNAME: could not create$PGALTDATA"1>&2
134-
echo"Make sure$PGALTDATA is a valid path and that you have permission to access it."1>&2
134+
echo"$CMDNAME: could not createdirectory\"$PGALTDATA\""1>&2
135+
echo"Make sure\"$PGALTDATA\" is a valid path and that you have permission to access it."1>&2
135136
exit_nicely
136137
fi
137138
else
138-
echo"Fixing permissions on pre-existing directory$PGALTDATA"
139+
echo"fixing permissions on pre-existing directory$PGALTDATA"
139140
chmod go-rwx"$PGALTDATA"|| exit_nicely
140141
fi
141142

142143

143144
if [!-d"$PGALTDATA"/base ];then
144-
echo"Creating directory$PGALTDATA/base"
145+
echo"creating directory$PGALTDATA/base"
145146
mkdir"$PGALTDATA/base"
146147
if ["$?"-ne 0 ];then
147148
echo"$CMDNAME: could not create$PGALTDATA/base"1>&2
148-
echo"Make sure$PGALTDATA/base is a valid path and that you have permission to access it."1>&2
149+
echo"Make sure\"$PGALTDATA/base\" is a valid path and that you have permission to access it."1>&2
149150
exit_nicely
150151
fi
151152
else
152-
echo"Fixing permissions on pre-existing directory$PGALTDATA/base"
153+
echo"fixing permissions on pre-existing directory$PGALTDATA/base"
153154
chmod go-rwx"$PGALTDATA/base"|| exit_nicely
154155
fi
155156

‎src/bin/ipcclean/ipcclean.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.13 2002/10/18 22:05:35 petere Exp $
3+
# $Header: /cvsroot/pgsql/src/bin/ipcclean/Attic/ipcclean.sh,v 1.14 2003/07/23 08:47:23 petere Exp $
44
#
55

66
CMDNAME=`basename$0`
@@ -22,8 +22,9 @@ fi
2222
if ["$USER"='root'-o"$LOGNAME"='root' ]
2323
then
2424
(
25-
echo"You cannot run$CMDNAME as root. Please log in (using, e.g., 'su')"
26-
echo"as the (unprivileged) user that owned the server process."
25+
echo"$CMDNAME: cannot be run as root"1>&2
26+
echo"Please log in (using, e.g.,\"su\") as the (unprivileged) user that"1>&2
27+
echo"owned the server process."1>&2
2728
)1>&2
2829
exit 1
2930
fi
@@ -39,7 +40,7 @@ EffectiveUser=`id -n -u 2>/dev/null || whoami 2>/dev/null`
3940
#
4041
if [`uname`='QNX' ];then
4142
if ps -eA| grep -s'[p]ostmaster'>/dev/null2>&1;then
42-
echo"$CMDNAME:You still havea postmaster running."1>&2
43+
echo"$CMDNAME: a postmasteris stillrunning"1>&2
4344
exit 1
4445
fi
4546
rm -f /dev/shmem/PgS*
@@ -52,7 +53,7 @@ if [ `uname` = 'Linux' ]; then
5253
did_anything=
5354

5455
if ps x| grep -s'[p]ostmaster'>/dev/null2>&1;then
55-
echo"$CMDNAME:You still havea postmaster running."1>&2
56+
echo"$CMDNAME: a postmasteris stillrunning"1>&2
5657
exit 1
5758
fi
5859

‎src/bin/pg_config/pg_config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Author: Peter Eisentraut <peter_e@gmx.net>
88
# Public domain
99

10-
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.7 2002/10/18 22:05:35 petere Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.8 2003/07/23 08:47:25 petere Exp $
1111

1212
me=`basename$0`
1313

@@ -41,7 +41,7 @@ Options:
4141
Report bugs to <pgsql-bugs@postgresql.org>."
4242

4343
advice="\
44-
Try'$me --help' for more information."
44+
Try\"$me --help\" for more information."
4545

4646
iftest"$#" -eq 0;then
4747
echo"$me: argument required"1>&2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp