1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Have pg_upgrade create its output files in the current directory, rather

than in a subdirectory of the $HOME directory, or $TMP in Windows.
This commit is contained in:
Bruce Momjian
2010-06-12 17:05:29 +00:00
parent 99fdb4a9ea
commit 1dc7c796c9
8 changed files with 21 additions and 63 deletions

View File

@ -84,20 +84,7 @@ parseCommandLine(migratorContext *ctx, int argc, char *argv[])
if (user_id == 0)
pg_log(ctx, PG_FATAL, "%s: cannot be run as root\n", ctx->progname);
#ifndef WIN32
get_home_path(ctx->home_dir);
#else
{
char *tmppath;
/* TMP is the best place on Windows, rather than APPDATA */
if ((tmppath = getenv("TMP")) == NULL)
pg_log(ctx, PG_FATAL, "TMP environment variable is not set.\n");
snprintf(ctx->home_dir, MAXPGPATH, "%s", tmppath);
}
#endif
snprintf(ctx->output_dir, MAXPGPATH, "%s/" OUTPUT_SUBDIR, ctx->home_dir);
getcwd(ctx->cwd, MAXPGPATH);
while ((option = getopt_long(argc, argv, "d:D:b:B:cgG:kl:p:P:u:v",
long_options, &optindex)) != -1)