Bug 157559 - [PATCH] Fix port: databases/postgresql82-server should use USERS
[PATCH] Fix port: databases/postgresql82-server should use USERS
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Chris Rees
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-03 11:40 UTC by utisoft
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 utisoft 2011-06-03 11:40:06 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.--84tZulcv7WS6g2fE9pB63Yx3zvm8g5KcAjiwLVtubP8cLOMo
Content-Type: text/plain; name="databases-postgresql82-server.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="databases-postgresql82-server.patch"

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql82-server/Makefile,v
retrieving revision 1.197
diff -u -r1.197 Makefile
--- Makefile	18 Apr 2011 23:34:26 -0000	1.197
+++ Makefile	2 Jun 2011 13:30:19 -0000
@@ -60,6 +60,8 @@
 SUB_FILES+=	dot.cshrc dot.profile
 USE_PGSQL=	yes
 WANT_PGSQL_VER=	${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g}
+USERS=		pgsql
+GROUPS=		${USERS}
 .endif
 
 .if !defined(SLAVE_ONLY)
@@ -241,12 +243,6 @@
 .  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-install-server
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql82-server/pkg-install-server,v
retrieving revision 1.2
diff -u -r1.2 pkg-install-server
--- pkg-install-server	6 Dec 2006 16:48:57 -0000	1.2
+++ pkg-install-server	2 Jun 2011 13:27:56 -0000
@@ -3,8 +3,6 @@
 # $FreeBSD: ports/databases/postgresql82-server/pkg-install-server,v 1.2 2006/12/06 16:48:57 girgen Exp $
 
 PATH=/bin:/usr/sbin
-PGUSER=pgsql
-DB_DIR=${PKG_PREFIX}/${PGUSER}
 
 backupwarning() { echo "
 
@@ -22,43 +20,6 @@
 }
 
 case $2 in
-PRE-INSTALL)
-	backupwarning
-	USER=${PGUSER}
-	GROUP=${USER}
-	UID=70
-	GID=${UID}
-
-	if pw group show "${GROUP}" 2>/dev/null; then
-		echo "You already have a group \"${GROUP}\", so I will use it."
-	else
-		if pw groupadd ${GROUP} -g ${GID}; then
-			echo "Added group \"${GROUP}\"."
-		else
-			echo "Adding group \"${GROUP}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if pw user show "${USER}" 2>/dev/null; then
-		echo "You already have a user \"${USER}\", so I will use it."
-	else
-		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-			-d ${DB_DIR} -c "PostgreSQL Daemon"
-		then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! [ -x ~${PGUSER} ] ; then 
-		mkdir -p ${DB_DIR}
-		chown pgsql:pgsql ${DB_DIR}
-	fi
-	;;
-
 BACKUPWARNING)
 	backupwarning
 	;;
Comment 1 Edwin Groothuis freebsd_committer 2011-06-03 11:40:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->girgen

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

Maintainer timeout
Comment 3 dfilter freebsd_committer 2011-08-12 10:51:34 UTC
crees       2011-08-12 09:51:20 UTC

  FreeBSD ports repository

  Modified files:
    databases/postgresql82-server Makefile pkg-install-server 
  Log:
  Use USERS and GROUPS
  
  PR:             ports/157559
  Submitted by:   me
  Approved by:    maintainer timeout (girgen, 9 weeks)
  
  Revision  Changes    Path
  1.198     +2 -6      ports/databases/postgresql82-server/Makefile
  1.3       +1 -40     ports/databases/postgresql82-server/pkg-install-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 4 Chris Rees freebsd_committer 2011-08-12 10:51:35 UTC
State Changed
From-To: open->closed

Committed.
Comment 5 dfilter freebsd_committer 2011-08-15 15:52:40 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 2011-08-15 15:53:14 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 2011-10-29 11:47:13 UTC
State Changed
From-To: open->closed

These will be fixed soon.