Commit dc9c6127 authored by Bruce Momjian's avatar Bruce Momjian

pg_upgrade: prefix Unix shell script name output with "./"

This more clearly suggests the current directory.  While this also works
on Windows, it might be confusing.

Report by Christoph Berg
parent 80e6af12
...@@ -408,7 +408,8 @@ create_script_for_cluster_analyze(char **analyze_script_file_name) ...@@ -408,7 +408,8 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
if (os_info.user_specified) if (os_info.user_specified)
user_specification = psprintf("-U \"%s\" ", os_info.user); user_specification = psprintf("-U \"%s\" ", os_info.user);
*analyze_script_file_name = psprintf("analyze_new_cluster.%s", SCRIPT_EXT); *analyze_script_file_name = psprintf("%sanalyze_new_cluster.%s",
SCRIPT_PREFIX, SCRIPT_EXT);
if ((script = fopen_priv(*analyze_script_file_name, "w")) == NULL) if ((script = fopen_priv(*analyze_script_file_name, "w")) == NULL)
pg_fatal("Could not open file \"%s\": %s\n", pg_fatal("Could not open file \"%s\": %s\n",
...@@ -489,7 +490,8 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name) ...@@ -489,7 +490,8 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
int tblnum; int tblnum;
char old_cluster_pgdata[MAXPGPATH]; char old_cluster_pgdata[MAXPGPATH];
*deletion_script_file_name = psprintf("delete_old_cluster.%s", SCRIPT_EXT); *deletion_script_file_name = psprintf("%sdelete_old_cluster.%s",
SCRIPT_PREFIX, SCRIPT_EXT);
/* /*
* Some users (oddly) create tablespaces inside the cluster data * Some users (oddly) create tablespaces inside the cluster data
......
...@@ -76,6 +76,7 @@ extern char *output_files[]; ...@@ -76,6 +76,7 @@ extern char *output_files[];
#define PATH_SEPARATOR '/' #define PATH_SEPARATOR '/'
#define RM_CMD "rm -f" #define RM_CMD "rm -f"
#define RMDIR_CMD "rm -rf" #define RMDIR_CMD "rm -rf"
#define SCRIPT_PREFIX "./"
#define SCRIPT_EXT "sh" #define SCRIPT_EXT "sh"
#define ECHO_QUOTE "'" #define ECHO_QUOTE "'"
#define ECHO_BLANK "" #define ECHO_BLANK ""
...@@ -86,6 +87,7 @@ extern char *output_files[]; ...@@ -86,6 +87,7 @@ extern char *output_files[];
#define PATH_SEPARATOR '\\' #define PATH_SEPARATOR '\\'
#define RM_CMD "DEL /q" #define RM_CMD "DEL /q"
#define RMDIR_CMD "RMDIR /s/q" #define RMDIR_CMD "RMDIR /s/q"
#define SCRIPT_PREFIX ""
#define SCRIPT_EXT "bat" #define SCRIPT_EXT "bat"
#define EXE_EXT ".exe" #define EXE_EXT ".exe"
#define ECHO_QUOTE "" #define ECHO_QUOTE ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment