Bug 157669 - Fix port: databases/postgresql90-server should use USERS
Summary: Fix port: databases/postgresql90-server should use USERS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Chris Rees
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-06 20:10 UTC by Chris Rees
Modified: 2011-10-29 11:47 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Rees 2011-06-06 20:10:08 UTC
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=

Fix: - Use USERS and GROUPS

	Submitted by: Chris Rees (utisoft@gmail.com)




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.--80m6RoEaqiNfKcCuOFDSwqDz5DF85hV7gfx5kT7Qc7v8Ro73
Content-Type: text/plain; name="databases-postgresql90-server.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="databases-postgresql90-server.patch"

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql90-server/Makefile,v
retrieving revision 1.219
diff -u -r1.219 Makefile
--- Makefile	17 May 2011 22:26:08 -0000	1.219
+++ Makefile	2 Jun 2011 13:42:15 -0000
@@ -35,7 +35,6 @@
 
 PG_USER?=	pgsql
 PG_GROUP?=	pgsql
-PG_UID?=	70
 
 LDFLAGS+=	-L${LOCALBASE}/lib
 INCLUDES+=	-I${LOCALBASE}/include
@@ -62,6 +61,8 @@
 USE_PGSQL=	yes
 WANT_PGSQL_VER=	${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g}
 SUB_FILES+=	502.pgsql
+USERS=		${PG_USER}
+GROUPS=		${PG_GROUP}
 .endif
 
 .if !defined(SLAVE_ONLY)
@@ -314,19 +315,10 @@
 .  endif
 .  if exists(${FILESDIR}/pkg-install${PKGNAMESUFFIX}.in)
 SUB_FILES+=     pkg-install${PKGNAMESUFFIX}
-SUB_LIST=       PG_GROUP=$(PG_GROUP) \
-                PG_USER=$(PG_USER) \
-                PG_UID=$(PG_UID)
-PLIST_SUB+=     PG_USER=$(PG_USER)
 PKGINSTALL=     ${WRKDIR}/pkg-install${PKGNAMESUFFIX}
 .  endif
 .endif
 
-.if defined(SERVER_ONLY)
-pre-su-install:
-	@ ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
-.endif
-
 .if !defined(NO_BUILD)
 post-patch:
 	@${REINPLACE_CMD} s/@PTHREAD_LIBS@// ${WRKSRC}/src/Makefile.global.in
Index: pkg-plist-server
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql90-server/pkg-plist-server,v
retrieving revision 1.31
diff -u -r1.31 pkg-plist-server
--- pkg-plist-server	18 Apr 2011 23:34:27 -0000	1.31
+++ pkg-plist-server	4 Jun 2011 13:49:16 -0000
@@ -756,9 +756,8 @@
 share/postgresql/tsearch_data/synonym_sample.syn
 share/postgresql/tsearch_data/thesaurus_sample.ths
 @dirrmtry share/postgresql/tsearch_data
-@unexec echo "Warning: If you will *NOT* use this package anymore, please remove the pgsql user manually."
 @dirrmtry share/postgresql
 @dirrmtry etc/periodic/daily
 @dirrmtry etc/periodic
 @dirrmtry lib/postgresql
-@dirrmtry %%PG_USER%%
+@dirrmtry pgsql
Index: files/pkg-install-server.in
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql90-server/files/pkg-install-server.in,v
retrieving revision 1.3
diff -u -r1.3 pkg-install-server.in
--- files/pkg-install-server.in	2 May 2011 21:37:30 -0000	1.3
+++ files/pkg-install-server.in	2 Jun 2011 13:41:25 -0000
@@ -4,10 +4,6 @@
 
 PATH=/bin:/usr/bin:/usr/sbin
 
-PG_USER=%%PG_USER%%
-PG_GROUP=%%PG_GROUP%%
-PG_UID=%%PG_UID%%
-
 backupwarning() { echo "
 
   =========== BACKUP YOUR DATA! =============
@@ -24,39 +20,6 @@
 }
 
 case $2 in
-PRE-INSTALL)
-	backupwarning
-	DB_DIR=${PKG_PREFIX}/${PG_USER}
-
-	if pw group show "${PG_GROUP}" 2>/dev/null; then
-		echo "You already have a group \"${PG_GROUP}\", so I will use it."
-	else
-		if pw groupadd ${PG_GROUP} -g ${PG_UID}; then
-			echo "Added group \"${PG_GROUP}\"."
-		else
-			echo "Adding group \"${PG_GROUP}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if pw user show "${PG_USER}" 2>/dev/null; then
-		echo "You already have a user \"${PG_USER}\", so I will use it."
-	else
-		if pw useradd ${PG_USER} -u ${PG_UID} -g ${PG_GROUP} -h - \
-			-d ${DB_DIR} -c "PostgreSQL Daemon"
-		then
-			echo "Added user \"${PG_USER}\"."
-		else
-			echo "Adding user \"${PG_USER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! [ -x ~${PG_USER} ] ; then 
-		install -m 755 -o ${PG_USER} -g ${PG_GROUP} -d ${DB_DIR}
-	fi
-	;;
-
 BACKUPWARNING)
 	backupwarning
 	;;
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-06 20:10:40 UTC
Responsible Changed
From-To: freebsd-ports-bugs->girgen

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Chris Rees freebsd_committer freebsd_triage 2011-08-09 19:06:18 UTC
Responsible Changed
From-To: girgen->crees

Maintainer timeout
Comment 3 Chris Rees freebsd_committer freebsd_triage 2011-08-12 11:11:31 UTC
State Changed
From-To: open->closed

Committed.
Comment 4 dfilter service freebsd_committer freebsd_triage 2011-08-12 11:11:31 UTC
crees       2011-08-12 10:11:22 UTC

  FreeBSD ports repository

  Modified files:
    databases/postgresql90-server Makefile pkg-plist-server 
    databases/postgresql90-server/files pkg-install-server.in 
  Log:
  Use USERS and GROUPS
  
  PR:             ports/157669
  Submitted by:   me
  Approved by:    maintainer timeout (girgen, 7 weeks)
  
  Revision  Changes    Path
  1.221     +2 -10     ports/databases/postgresql90-server/Makefile
  1.4       +1 -38     ports/databases/postgresql90-server/files/pkg-install-server.in
  1.32      +1 -2      ports/databases/postgresql90-server/pkg-plist-server
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 dfilter service freebsd_committer freebsd_triage 2011-08-15 15:52:41 UTC
crees       2011-08-15 14:52:31 UTC

  FreeBSD ports repository

  Modified files:
    databases/postgresql82-server Makefile pkg-install-server 
    databases/postgresql83-server Makefile pkg-install-server 
    databases/postgresql84-server Makefile pkg-plist-server 
    databases/postgresql84-server/files pkg-install-server.in 
    databases/postgresql90-server Makefile pkg-plist-server 
    databases/postgresql90-server/files pkg-install-server.in 
  Log:
  Revert previous commit -- appears to cause rc problems as I missed some subs
  
  http://www.mail-archive.com/freebsd-ports@freebsd.org/msg35324.html
  
  PR:             ports/157558 ports/157559 ports/157666 ports/157669
  Submitted by:   rihad@mail.ru
  Approved by:    maintainer (girgen; implicit -- this reverts a commit I did after maintainer timeout)
  
  Revision  Changes    Path
  1.199     +6 -2      ports/databases/postgresql82-server/Makefile
  1.4       +40 -1     ports/databases/postgresql82-server/pkg-install-server
  1.212     +6 -2      ports/databases/postgresql83-server/Makefile
  1.9       +38 -1     ports/databases/postgresql83-server/pkg-install-server
  1.227     +10 -2     ports/databases/postgresql84-server/Makefile
  1.5       +38 -1     ports/databases/postgresql84-server/files/pkg-install-server.in
  1.33      +2 -1      ports/databases/postgresql84-server/pkg-plist-server
  1.222     +10 -2     ports/databases/postgresql90-server/Makefile
  1.5       +38 -1     ports/databases/postgresql90-server/files/pkg-install-server.in
  1.33      +2 -1      ports/databases/postgresql90-server/pkg-plist-server
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Chris Rees freebsd_committer freebsd_triage 2011-08-15 15:53:20 UTC
State Changed
From-To: closed->open

Reverted -- causes problems 
http://www.mail-archive.com/freebsd-ports@freebsd.org/msg35324.html
Comment 7 Chris Rees freebsd_committer freebsd_triage 2011-10-29 11:47:21 UTC
State Changed
From-To: open->closed

These will be fixed soon.