Move frontend-side archive APIs from src/common/ to src/fe_utils/

fe_archive.c was compiled only for the frontend in src/common/, but as
it will never share anything with the backend, it makes most sense to
move this file to src/fe_utils/.

Reported-by: Peter Eisentraut
Discussion: https://postgr.es/m/e9766d71-8655-ac86-bdf6-77e0e7169977@2ndquadrant.com
Backpatch-through: 13
This commit is contained in:
Michael Paquier 2020-06-11 15:48:46 +09:00
parent c4325cefba
commit a3b2bf1fe7
6 changed files with 11 additions and 15 deletions

View File

@ -19,7 +19,7 @@
#include "catalog/pg_control.h"
#include "catalog/storage_xlog.h"
#include "commands/dbcommands_xlog.h"
#include "common/fe_archive.h"
#include "fe_utils/archive.h"
#include "filemap.h"
#include "pg_rewind.h"

View File

@ -89,7 +89,6 @@ endif
# (Mkvcbuild.pm has a copy of this list, too)
OBJS_FRONTEND = \
$(OBJS_COMMON) \
fe_archive.o \
fe_memutils.o \
file_utils.o \
logging.o \

View File

@ -20,6 +20,7 @@ include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
OBJS = \
archive.o \
cancel.o \
conditional.o \
mbprint.o \

View File

@ -1,6 +1,6 @@
/*-------------------------------------------------------------------------
*
* fe_archive.c
* archive.c
* Routines to access WAL archives from frontend
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
@ -8,15 +8,11 @@
*
*
* IDENTIFICATION
* src/common/fe_archive.c
* src/fe_utils/archive.c
*
*-------------------------------------------------------------------------
*/
#ifndef FRONTEND
#error "This file is not expected to be compiled for backend code"
#endif
#include "postgres_fe.h"
#include <unistd.h>
@ -24,8 +20,8 @@
#include "access/xlog_internal.h"
#include "common/archive.h"
#include "common/fe_archive.h"
#include "common/logging.h"
#include "fe_utils/archive.h"
/*

View File

@ -1,12 +1,12 @@
/*-------------------------------------------------------------------------
*
* fe_archive.h
* archive.h
* Routines to access WAL archives from frontend
*
* Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/common/fe_archive.h
* src/include/fe_utils/archive.h
*
*-------------------------------------------------------------------------
*/

View File

@ -138,14 +138,14 @@ sub mkvcbuild
}
our @pgcommonfrontendfiles = (
@pgcommonallfiles, qw(fe_archive.c fe_memutils.c
file_utils.c logging.c restricted_token.c));
@pgcommonallfiles, qw(fe_memutils.c file_utils.c
logging.c restricted_token.c));
our @pgcommonbkndfiles = @pgcommonallfiles;
our @pgfeutilsfiles = qw(
cancel.c conditional.c mbprint.c print.c psqlscan.l psqlscan.c
simple_list.c string_utils.c recovery_gen.c);
archive.c cancel.c conditional.c mbprint.c print.c psqlscan.l
psqlscan.c simple_list.c string_utils.c recovery_gen.c);
$libpgport = $solution->AddProject('libpgport', 'lib', 'misc');
$libpgport->AddDefine('FRONTEND');