diff options
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/initdb/Makefile | 7 | ||||
-rw-r--r-- | src/bin/initdb/initdb.c | 27 |
2 files changed, 6 insertions, 28 deletions
diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile index 82f3a8ba41b..fbfcf9833d6 100644 --- a/src/bin/initdb/Makefile +++ b/src/bin/initdb/Makefile @@ -5,7 +5,7 @@ # Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.41 2004/05/24 01:01:37 momjian Exp $ +# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.42 2004/08/01 06:19:23 momjian Exp $ # #------------------------------------------------------------------------- @@ -15,13 +15,16 @@ include $(top_builddir)/src/Makefile.global override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS) -OBJS= initdb.o exec.o +OBJS= initdb.o dirmod.o exec.o all: submake-libpq submake-libpgport initdb initdb: $(OBJS) $(libpq_builddir)/libpq.a $(CC) $(CFLAGS) $(OBJS) $(libpq) $(LDFLAGS) $(LIBS) -o $@$(X) +dirmod.c: % : $(top_srcdir)/src/port/% + rm -f $@ && $(LN_S) $< . + exec.c: % : $(top_srcdir)/src/port/% rm -f $@ && $(LN_S) $< . diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index cd830ecda7a..55b782004c4 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -39,7 +39,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * Portions taken from FreeBSD. * - * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.45 2004/08/01 05:59:13 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.46 2004/08/01 06:19:23 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -146,7 +146,6 @@ char backend_exec[MAXPGPATH]; static void *xmalloc(size_t size); static char *xstrdup(const char *s); -static bool rmtree(char *path, bool rmtopdir); static char **replace_token(char **lines, char *token, char *replacement); static char **readfile(char *path); static void writefile(char *path, char **lines); @@ -252,30 +251,6 @@ xstrdup(const char *s) } /* - * delete a directory tree recursively - * assumes path points to a valid directory - * deletes everything under path - * if rmtopdir is true deletes the directory too - */ -static bool -rmtree(char *path, bool rmtopdir) -{ - char buf[MAXPGPATH + 64]; - -#ifndef WIN32 - /* doesn't handle .* files, but we don't make any... */ - snprintf(buf, sizeof(buf), "rm -rf \"%s\"%s", path, - rmtopdir ? "" : "/*"); -#else - snprintf(buf, sizeof(buf), "%s /s /q \"%s\"", - rmtopdir ? "rmdir" : "del", path); -#endif - - return !system(buf); -} - - -/* * make a copy of the array of lines, with token replaced by replacement * the first time it occurs on each line. * |