Skip to content

Commit

Permalink
Revert "Replace BACKUP_PATH in the source files"
Browse files Browse the repository at this point in the history
This reverts commit 90a4a4f.
  • Loading branch information
funny-falcon committed May 16, 2024
1 parent 28bc0f6 commit f361dda
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
10 changes: 5 additions & 5 deletions doc/pgprobackup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ pg_probackup add-instance -B <replaceable>backup_dir</replaceable> -D <replaceab
<replaceable>backup_dir</replaceable> directory and at least read-only
access to <replaceable>data_dir</replaceable> directory. If you
specify the path to the backup catalog in the
<envar>BACKUP_DIR</envar> environment variable, you can
<envar>BACKUP_PATH</envar> environment variable, you can
omit the corresponding option when running <application>pg_probackup</application>
commands.
</para>
Expand Down Expand Up @@ -5205,14 +5205,14 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
<varlistentry>
<term><option>-B <replaceable>directory</replaceable></option></term>
<term><option>--backup-path=<replaceable>directory</replaceable></option></term>
<term><envar>BACKUP_DIR</envar></term>
<term><envar>BACKUP_PATH</envar></term>
<listitem>
<para>
Specifies the absolute path to the backup catalog. Backup
catalog is a directory where all backup files and meta
information are stored. Since this option is required for most
of the <application>pg_probackup</application> commands, you are recommended to specify
it once in the <envar>BACKUP_DIR</envar> environment variable. In this case,
it once in the <envar>BACKUP_PATH</envar> environment variable. In this case,
you do not need to use this option each time on the command
line.
</para>
Expand Down Expand Up @@ -5672,7 +5672,7 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
lazily, when the first log message is written.
</para>
<para>
Default: <filename>$BACKUP_DIR/log/</filename>
Default: <filename>$BACKUP_PATH/log/</filename>
</para>
</listitem>
</varlistentry>
Expand Down Expand Up @@ -5755,7 +5755,7 @@ pg_probackup catchup -b <replaceable>catchup_mode</replaceable>
reached, the log file is rotated once a <application>pg_probackup</application> command
is launched, except <command>help</command> and <command>version</command> commands. The time of the
last log file creation is stored in
<filename>$BACKUP_DIR/log/log_rotation</filename>. The zero value disables
<filename>$BACKUP_PATH/log/log_rotation</filename>. The zero value disables
time-based rotation. Supported units: ms, s, min, h, d (min by
default).
</para>
Expand Down
2 changes: 1 addition & 1 deletion po/ru.po
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ msgstr ""
#: src/help.c:360 src/help.c:521 src/help.c:588 src/help.c:635 src/help.c:715
#: src/help.c:761 src/help.c:833
#, c-format
msgid " directory for file logging (default: BACKUP_DIR/log)\n"
msgid " directory for file logging (default: BACKUP_PATH/log)\n"
msgstr ""

#: src/help.c:361 src/help.c:522 src/help.c:589 src/help.c:636 src/help.c:716
Expand Down
4 changes: 2 additions & 2 deletions src/archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static parray *setup_push_filelist(const char *archive_status_dir,
* set archive_command to
* 'pg_probackup archive-push -B /home/anastasia/backup --wal-file-name %f',
* to move backups into arclog_path.
* Where archlog_path is $BACKUP_DIR/wal/instance_name
* Where archlog_path is $BACKUP_PATH/wal/instance_name
*/
void
do_archive_push(InstanceState *instanceState, InstanceConfig *instance, char *pg_xlog_dir,
Expand Down Expand Up @@ -1126,7 +1126,7 @@ do_archive_get(InstanceState *instanceState, InstanceConfig *instance, const cha
join_path_components(absolute_wal_file_path, current_dir, wal_file_path);

/* full filepath to WAL file in archive directory.
* $BACKUP_DIR/wal/instance_name/000000010000000000000001 */
* $BACKUP_PATH/wal/instance_name/000000010000000000000001 */
join_path_components(backup_wal_file_path, instanceState->instance_wal_subdir_path, wal_file_name);

INSTR_TIME_SET_CURRENT(start_time);
Expand Down
2 changes: 1 addition & 1 deletion src/catalog.c
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ get_multi_timeline_parent(parray *backup_list, parray *tli_list,
}

/*
* Create backup directory in $BACKUP_DIR
* Create backup directory in $BACKUP_PATH
* (with proposed backup->backup_id)
* and initialize this directory.
* If creation of directory fails, then
Expand Down
22 changes: 11 additions & 11 deletions src/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ help_backup(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -548,7 +548,7 @@ help_restore(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -621,7 +621,7 @@ help_validate(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -674,7 +674,7 @@ help_checkdb(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -760,7 +760,7 @@ help_delete(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -814,7 +814,7 @@ help_merge(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -890,7 +890,7 @@ help_set_config(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -1002,7 +1002,7 @@ help_add_instance(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -1072,7 +1072,7 @@ help_archive_push(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -1131,7 +1131,7 @@ help_archive_get(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down Expand Up @@ -1221,7 +1221,7 @@ help_catchup(void)
printf(_(" --error-log-filename=error-log-filename\n"));
printf(_(" filename for error logging (default: none)\n"));
printf(_(" --log-directory=log-directory\n"));
printf(_(" directory for file logging (default: BACKUP_DIR/log)\n"));
printf(_(" directory for file logging (default: BACKUP_PATH/log)\n"));
printf(_(" --log-rotation-size=log-rotation-size\n"));
printf(_(" rotate logfile if its size exceeds this value; 0 disables; (default: 0)\n"));
printf(_(" available units: 'kB', 'MB', 'GB', 'TB' (default: kB)\n"));
Expand Down
6 changes: 3 additions & 3 deletions src/pg_probackup.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,10 +468,10 @@ main(int argc, char *argv[])
if (backup_path == NULL)
{
/*
* If command line argument is not set, try to read BACKUP_DIR
* If command line argument is not set, try to read BACKUP_PATH
* from environment variable
*/
backup_path = getenv("BACKUP_DIR");
backup_path = getenv("BACKUP_PATH");
}

if (backup_path != NULL)
Expand All @@ -498,7 +498,7 @@ main(int argc, char *argv[])
backup_subcmd != CATCHUP_CMD)
elog(ERROR,
"No backup catalog path specified.\n"
"Please specify it either using environment variable BACKUP_DIR or\n"
"Please specify it either using environment variable BACKUP_PATH or\n"
"command line option --backup-path (-B)");

/* ===== catalogState (END) ======*/
Expand Down
8 changes: 4 additions & 4 deletions src/pg_probackup.h
Original file line number Diff line number Diff line change
Expand Up @@ -837,13 +837,13 @@ typedef struct InstanceState
CatalogState *catalog_state;

char instance_name[MAXPGPATH]; //previously global var instance_name
/* $BACKUP_DIR/backups/instance_name */
/* $BACKUP_PATH/backups/instance_name */
char instance_backup_subdir_path[MAXPGPATH];

/* $BACKUP_DIR/backups/instance_name/BACKUP_CATALOG_CONF_FILE */
/* $BACKUP_PATH/backups/instance_name/BACKUP_CATALOG_CONF_FILE */
char instance_config_path[MAXPGPATH];

/* $BACKUP_DIR/backups/instance_name */
/* $BACKUP_PATH/backups/instance_name */
char instance_wal_subdir_path[MAXPGPATH]; // previously global var arclog_path

/* TODO: Make it more specific */
Expand Down
6 changes: 3 additions & 3 deletions src/pg_probackup_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

typedef struct CatalogState
{
/* $BACKUP_DIR */
/* $BACKUP_PATH */
char catalog_path[MAXPGPATH]; //previously global var backup_path
/* $BACKUP_DIR/backups */
/* $BACKUP_PATH/backups */
char backup_subdir_path[MAXPGPATH];
/* $BACKUP_DIR/wal */
/* $BACKUP_PATH/wal */
char wal_subdir_path[MAXPGPATH]; // previously global var arclog_path
} CatalogState;

Expand Down
2 changes: 1 addition & 1 deletion tests/option_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_without_backup_path_3(self):
except ProbackupException as e:
self.assertIn(
'ERROR: No backup catalog path specified.\n' + \
'Please specify it either using environment variable BACKUP_DIR or\n' + \
'Please specify it either using environment variable BACKUP_PATH or\n' + \
'command line option --backup-path (-B)',
e.message,
'\n Unexpected Error Message: {0}\n CMD: {1}'.format(repr(e.message), self.cmd))
Expand Down

0 comments on commit f361dda

Please sign in to comment.