Skip to content

Commit dc9c612

Browse files
committed
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
1 parent 80e6af1 commit dc9c612

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

contrib/pg_upgrade/check.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ create_script_for_cluster_analyze(char **analyze_script_file_name)
408408
if (os_info.user_specified)
409409
user_specification = psprintf("-U \"%s\" ", os_info.user);
410410

411-
*analyze_script_file_name = psprintf("analyze_new_cluster.%s", SCRIPT_EXT);
411+
*analyze_script_file_name = psprintf("%sanalyze_new_cluster.%s",
412+
SCRIPT_PREFIX, SCRIPT_EXT);
412413

413414
if ((script = fopen_priv(*analyze_script_file_name, "w")) == NULL)
414415
pg_fatal("Could not open file \"%s\": %s\n",
@@ -489,7 +490,8 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
489490
int tblnum;
490491
char old_cluster_pgdata[MAXPGPATH];
491492

492-
*deletion_script_file_name = psprintf("delete_old_cluster.%s", SCRIPT_EXT);
493+
*deletion_script_file_name = psprintf("%sdelete_old_cluster.%s",
494+
SCRIPT_PREFIX, SCRIPT_EXT);
493495

494496
/*
495497
* Some users (oddly) create tablespaces inside the cluster data

contrib/pg_upgrade/pg_upgrade.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ extern char *output_files[];
7676
#define PATH_SEPARATOR '/'
7777
#define RM_CMD "rm -f"
7878
#define RMDIR_CMD "rm -rf"
79+
#define SCRIPT_PREFIX "./"
7980
#define SCRIPT_EXT "sh"
8081
#define ECHO_QUOTE "'"
8182
#define ECHO_BLANK ""
@@ -86,6 +87,7 @@ extern char *output_files[];
8687
#define PATH_SEPARATOR '\\'
8788
#define RM_CMD "DEL /q"
8889
#define RMDIR_CMD "RMDIR /s/q"
90+
#define SCRIPT_PREFIX ""
8991
#define SCRIPT_EXT "bat"
9092
#define EXE_EXT ".exe"
9193
#define ECHO_QUOTE ""

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy