|
11 | 11 |
|
12 | 12 |
|
13 | 13 | static void checkBinDir(migratorContext *ctx, ClusterInfo *cluster);
|
14 |
| -static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName, |
15 |
| - const char *alternative); |
| 14 | +static int check_exec(migratorContext *ctx, const char *dir, const char *cmdName); |
16 | 15 | static const char *validate_exec(const char *path);
|
17 | 16 | static int check_data_dir(migratorContext *ctx, const char *pg_data);
|
18 | 17 |
|
@@ -89,22 +88,10 @@ verify_directories(migratorContext *ctx)
|
89 | 88 | static void
|
90 | 89 | checkBinDir(migratorContext *ctx, ClusterInfo *cluster)
|
91 | 90 | {
|
92 |
| - check_exec(ctx, cluster->bindir, "postgres", "edb-postgres"); |
93 |
| - check_exec(ctx, cluster->bindir, "pg_ctl", NULL); |
94 |
| - check_exec(ctx, cluster->bindir, "pg_dumpall", NULL); |
95 |
| - |
96 |
| -#ifdef EDB_NATIVE_LANG |
97 |
| - /* check for edb-psql first because we need to detect EDB AS */ |
98 |
| - if (check_exec(ctx, cluster->bindir, "edb-psql", "psql") == 1) |
99 |
| - { |
100 |
| - cluster->psql_exe = "edb-psql"; |
101 |
| - cluster->is_edb_as = true; |
102 |
| - } |
103 |
| - else |
104 |
| -#else |
105 |
| - if (check_exec(ctx, cluster->bindir, "psql", NULL) == 1) |
106 |
| -#endif |
107 |
| - cluster->psql_exe = "psql"; |
| 91 | + check_exec(ctx, cluster->bindir, "postgres"); |
| 92 | + check_exec(ctx, cluster->bindir, "psql"); |
| 93 | + check_exec(ctx, cluster->bindir, "pg_ctl"); |
| 94 | + check_exec(ctx, cluster->bindir, "pg_dumpall"); |
108 | 95 | }
|
109 | 96 |
|
110 | 97 |
|
@@ -146,30 +133,17 @@ is_server_running(migratorContext *ctx, const char *datadir)
|
146 | 133 | * a valid executable, this function returns 0 to indicated failure.
|
147 | 134 | */
|
148 | 135 | static int
|
149 |
| -check_exec(migratorContext *ctx, const char *dir, const char *cmdName, |
150 |
| - const char *alternative) |
| 136 | +check_exec(migratorContext *ctx, const char *dir, const char *cmdName) |
151 | 137 | {
|
152 | 138 | char path[MAXPGPATH];
|
153 | 139 | const char *errMsg;
|
154 | 140 |
|
155 | 141 | snprintf(path, sizeof(path), "%s%c%s", dir, pathSeparator, cmdName);
|
156 | 142 |
|
157 | 143 | if ((errMsg = validate_exec(path)) == NULL)
|
158 |
| - { |
159 | 144 | return 1; /* 1 -> first alternative OK */
|
160 |
| - } |
161 | 145 | else
|
162 |
| - { |
163 |
| - if (alternative) |
164 |
| - { |
165 |
| - report_status(ctx, PG_WARNING, "check for %s warning: %s", |
166 |
| - cmdName, errMsg); |
167 |
| - if (check_exec(ctx, dir, alternative, NULL) == 1) |
168 |
| - return 2; /* 2 -> second alternative OK */ |
169 |
| - } |
170 |
| - else |
171 |
| - pg_log(ctx, PG_FATAL, "check for %s failed - %s\n", cmdName, errMsg); |
172 |
| - } |
| 146 | + pg_log(ctx, PG_FATAL, "check for %s failed - %s\n", cmdName, errMsg); |
173 | 147 |
|
174 | 148 | return 0; /* 0 -> neither alternative is acceptable */
|
175 | 149 | }
|
|
0 commit comments