Bug 157558 - [PATCH] Fix port databases/postgresql83-server should use USERS=
Summary: [PATCH] Fix port databases/postgresql83-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-03 11:30 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-03 11:30:12 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.--afJJrdwSu7ney1ic0EIBeDpoVvQUnv38YA34DJZ4Lgbb2veb
Content-Type: text/plain; name="databases-postgresql83-server.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="databases-postgresql83-server.patch"

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/postgresql83-server/Makefile,v
retrieving revision 1.210
diff -u -r1.210 Makefile
--- Makefile	18 Apr 2011 23:34:26 -0000	1.210
+++ Makefile	2 Jun 2011 13:33:36 -0000
@@ -61,6 +61,8 @@
 USE_RC_SUBR=	postgresql
 USE_PGSQL=	yes
 WANT_PGSQL_VER=	${PORTVERSION:C/([0-9][0-9]*)\.([0-9][0-9]*).*/\1\2/g}
+USERS=		${PGUSER}
+GROUPS=		${PGGROUP}
 .endif
 
 .if !defined(SLAVE_ONLY)
@@ -273,12 +275,6 @@
 .  endif
 .endif
 
-.if defined(SERVER_ONLY)
-pre-su-install:
-	@ ${SETENV} PKG_PREFIX=${PREFIX} PGUSER=${PGUSER} PGGROUP=${PGGROUP} \
-		${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/postgresql83-server/pkg-install-server,v
retrieving revision 1.7
diff -u -r1.7 pkg-install-server
--- pkg-install-server	18 Feb 2008 12:55:02 -0000	1.7
+++ pkg-install-server	2 Jun 2011 13:31:55 -0000
@@ -20,43 +20,6 @@
 }
 
 case $2 in
-PRE-INSTALL)
-	backupwarning
-	PGUSER=${PGUSER:-pgsql}
-	PGGROUP=${PGGROUP:-pgsql}
-	DB_DIR=${PKG_PREFIX}/${PGUSER}
-	UID=70
-	GID=70
-
-	if pw group show "${PGGROUP}" 2>/dev/null; then
-		echo "You already have a group \"${PGGROUP}\", so I will use it."
-	else
-		if pw groupadd ${PGGROUP} -g ${GID}; then
-			echo "Added group \"${PGGROUP}\"."
-		else
-			echo "Adding group \"${PGGROUP}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if pw user show "${PGUSER}" 2>/dev/null; then
-		echo "You already have a user \"${PGUSER}\", so I will use it."
-	else
-		if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \
-			-d ${DB_DIR} -c "PostgreSQL Daemon"
-		then
-			echo "Added user \"${PGUSER}\"."
-		else
-			echo "Adding user \"${PGUSER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! [ -x ~${PGUSER} ] ; then 
-		install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR}
-	fi
-	;;
-
 BACKUPWARNING)
 	backupwarning
 	;;
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-06-03 11:30:38 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-07-10 18:51:54 UTC
Hey,

Are the patches for the postgresql-server ports OK with you? I'm happy 
to commit them if you don't have time.

Thanks!

Chris

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157558

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Comment 3 Chris Rees freebsd_committer freebsd_triage 2011-08-09 19:05:25 UTC
Responsible Changed
From-To: girgen->crees

Maintainer timeout
Comment 4 Chris Rees freebsd_committer freebsd_triage 2011-08-12 10:49:51 UTC
State Changed
From-To: open->closed

Committed.
Comment 5 dfilter service freebsd_committer freebsd_triage 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 freebsd_triage 2011-08-15 15:53:12 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:09 UTC
State Changed
From-To: open->closed

These will be fixed soon.