WIP: script binaries renaming - Mailing list pgsql-patches

From Zdenek Kotala
Subject WIP: script binaries renaming
Date
Msg-id 46729D66.1080707@sun.com
Whole thread Raw
Responses Re: WIP: script binaries renaming
Re: WIP: script binaries renaming
Re: WIP: script binaries renaming
List pgsql-patches
I attach patch which renames following binaries

createdb createlang createuser dropdb droplang dropuser clusterdb
vacuumdb reindexdb

to

pg_createdb pg_createlang pg_createuser pg_dropdb pg_droplang
pg_dropuser pg_clusterdb pg_vacuumdb pg_reindexdb

Symlinks (or copy on win32) are created for backward compatibility.

This renaming was discussed there:

http://archives.postgresql.org/pgsql-hackers/2007-06/msg00145.php

I'm not yet implemented WARNING message when non pg_* command is used.
and I'm going to modify documentation. Is there any other place then
http://www.postgresql.org/docs/8.2/interactive/reference-client.html?

I think this patch has no (or small) impact on functionality and it
should be committed to 8.3


    Please let me know a comments

Index: src/bin/scripts/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/src/bin/scripts/Makefile,v
retrieving revision 1.37
diff -c -r1.37 Makefile
*** src/bin/scripts/Makefile    5 Jan 2007 22:19:50 -0000    1.37
--- src/bin/scripts/Makefile    15 Jun 2007 13:51:20 -0000
***************
*** 14,37 ****
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global

! PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb reindexdb

  override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir)
$(CPPFLAGS)

  all: submake-libpq submake-backend $(PROGRAMS)

! %: %.o $(WIN32RES)
      $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)

! createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! createlang: createlang.o common.o print.o mbprint.o
! createuser: createuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! dropdb: dropdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! droplang: droplang.o common.o print.o mbprint.o
! dropuser: dropuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! clusterdb: clusterdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! vacuumdb: vacuumdb.o common.o
! reindexdb: reindexdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o

  dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
      rm -f $@ && $(LN_S) $< .
--- 14,37 ----
  top_builddir = ../../..
  include $(top_builddir)/src/Makefile.global

! PROGRAMS = pg_createdb pg_createlang pg_createuser pg_dropdb pg_droplang pg_dropuser pg_clusterdb pg_vacuumdb
pg_reindexdb

  override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir)
$(CPPFLAGS)

  all: submake-libpq submake-backend $(PROGRAMS)

! pg_%: %.o $(WIN32RES)
      $(CC) $(CFLAGS) $^ $(libpq_pgport) $(LDFLAGS) $(LIBS) -o $@$(X)

! pg_createdb: createdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! pg_createlang: createlang.o common.o print.o mbprint.o
! pg_createuser: createuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! pg_dropdb: dropdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! pg_droplang: droplang.o common.o print.o mbprint.o
! pg_dropuser: dropuser.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! pg_clusterdb: clusterdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o
! pg_vacuumdb: vacuumdb.o common.o
! pg_reindexdb: reindexdb.o common.o dumputils.o $(top_builddir)/src/backend/parser/keywords.o

  dumputils.c: % : $(top_srcdir)/src/bin/pg_dump/%
      rm -f $@ && $(LN_S) $< .
***************
*** 45,59 ****


  install: all installdirs
!     $(INSTALL_PROGRAM) createdb$(X)   '$(DESTDIR)$(bindir)'/createdb$(X)
!     $(INSTALL_PROGRAM) dropdb$(X)     '$(DESTDIR)$(bindir)'/dropdb$(X)
!     $(INSTALL_PROGRAM) createlang$(X) '$(DESTDIR)$(bindir)'/createlang$(X)
!     $(INSTALL_PROGRAM) droplang$(X)   '$(DESTDIR)$(bindir)'/droplang$(X)
!     $(INSTALL_PROGRAM) createuser$(X) '$(DESTDIR)$(bindir)'/createuser$(X)
!     $(INSTALL_PROGRAM) dropuser$(X)   '$(DESTDIR)$(bindir)'/dropuser$(X)
!     $(INSTALL_PROGRAM) clusterdb$(X)  '$(DESTDIR)$(bindir)'/clusterdb$(X)
!     $(INSTALL_PROGRAM) vacuumdb$(X)   '$(DESTDIR)$(bindir)'/vacuumdb$(X)
!     $(INSTALL_PROGRAM) reindexdb$(X)  '$(DESTDIR)$(bindir)'/reindexdb$(X)

  installdirs:
      $(mkinstalldirs) '$(DESTDIR)$(bindir)'
--- 45,90 ----


  install: all installdirs
!     $(INSTALL_PROGRAM) pg_createdb$(X)   '$(DESTDIR)$(bindir)'/pg_createdb$(X)
!     $(INSTALL_PROGRAM) pg_dropdb$(X)     '$(DESTDIR)$(bindir)'/pg_dropdb$(X)
!     $(INSTALL_PROGRAM) pg_createlang$(X) '$(DESTDIR)$(bindir)'/pg_createlang$(X)
!     $(INSTALL_PROGRAM) pg_droplang$(X)   '$(DESTDIR)$(bindir)'/pg_droplang$(X)
!     $(INSTALL_PROGRAM) pg_createuser$(X) '$(DESTDIR)$(bindir)'/pg_createuser$(X)
!     $(INSTALL_PROGRAM) pg_dropuser$(X)   '$(DESTDIR)$(bindir)'/pg_dropuser$(X)
!     $(INSTALL_PROGRAM) pg_clusterdb$(X)  '$(DESTDIR)$(bindir)'/pg_clusterdb$(X)
!     $(INSTALL_PROGRAM) pg_vacuumdb$(X)   '$(DESTDIR)$(bindir)'/pg_vacuumdb$(X)
!     $(INSTALL_PROGRAM) pg_reindexdb$(X)  '$(DESTDIR)$(bindir)'/pg_reindexdb$(X)
! ifneq ($(PORTNAME), win32)
!     @rm -f '$(DESTDIR)$(bindir)/createdb$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/dropdb$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/createlang$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/droplang$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/createuser$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/dropuser$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/clusterdb$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/vacuumdb$(X)'
!     @rm -f '$(DESTDIR)$(bindir)/reindexdb$(X)'
!     ln -s pg_createdb$(X)   '$(DESTDIR)$(bindir)'/createdb$(X)
!     ln -s pg_dropdb$(X)     '$(DESTDIR)$(bindir)'/dropdb$(X)
!     ln -s pg_createlang$(X) '$(DESTDIR)$(bindir)'/createlang$(X)
!     ln -s pg_droplang$(X)   '$(DESTDIR)$(bindir)'/droplang$(X)
!     ln -s pg_createuser$(X) '$(DESTDIR)$(bindir)'/createuser$(X)
!     ln -s pg_dropuser$(X)   '$(DESTDIR)$(bindir)'/dropuser$(X)
!     ln -s pg_clusterdb$(X)  '$(DESTDIR)$(bindir)'/clusterdb$(X)
!     ln -s pg_vacuumdb$(X)   '$(DESTDIR)$(bindir)'/vacuumdb$(X)
!     ln -s pg_reindexdb$(X)  '$(DESTDIR)$(bindir)'/reindexdb$(X)
! else
!     $(INSTALL_PROGRAM) pg_createdb$(X)   '$(DESTDIR)$(bindir)'/createdb$(X)
!     $(INSTALL_PROGRAM) pg_createdb$(X)   '$(DESTDIR)$(bindir)'/createdb$(X)
!     $(INSTALL_PROGRAM) pg_dropdb$(X)     '$(DESTDIR)$(bindir)'/dropdb$(X)
!     $(INSTALL_PROGRAM) pg_createlang$(X) '$(DESTDIR)$(bindir)'/createlang$(X)
!     $(INSTALL_PROGRAM) pg_droplang$(X)   '$(DESTDIR)$(bindir)'/droplang$(X)
!     $(INSTALL_PROGRAM) pg_createuser$(X) '$(DESTDIR)$(bindir)'/createuser$(X)
!     $(INSTALL_PROGRAM) pg_dropuser$(X)   '$(DESTDIR)$(bindir)'/dropuser$(X)
!     $(INSTALL_PROGRAM) pg_clusterdb$(X)  '$(DESTDIR)$(bindir)'/clusterdb$(X)
!     $(INSTALL_PROGRAM) pg_vacuumdb$(X)   '$(DESTDIR)$(bindir)'/vacuumdb$(X)
!     $(INSTALL_PROGRAM) pg_reindexdb$(X)  '$(DESTDIR)$(bindir)'/reindexdb$(X)
! endif

  installdirs:
      $(mkinstalldirs) '$(DESTDIR)$(bindir)'

pgsql-patches by date:

Previous
From: Michael Paesold
Date:
Subject: Re: Load Distributed Checkpoints, revised patch
Next
From: Andrew Dunstan
Date:
Subject: Re: WIP: script binaries renaming