Bug 157928 - Fix port: audio/ventrilo-server directly uses pw in pkg-install
Summary: Fix port: audio/ventrilo-server directly uses pw in pkg-install
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-16 20:50 UTC by Chris Rees
Modified: 2011-07-07 19:20 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 freebsd_committer 2011-06-16 20:50:08 UTC
	

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

Fix: - Use USERS and GROUPS

	I'll add the UIDs/GIDs lines required if this is approved.




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

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/audio/ventrilo-server/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	10 Dec 2008 09:20:51 -0000	1.4
+++ Makefile	2 Jun 2011 20:41:18 -0000
@@ -27,6 +27,8 @@
 INSTALL_DIR=	${PREFIX}/ventrilo-server
 USE_RC_SUBR=	${PORTNAME}${PKGNAMESUFFIX}.sh
 VENT_USER=	${PORTNAME}
+USERS=		${VENT_USER}
+GROUPS=		${USERS}
 WRKSRC=	${WRKDIR}/ventsrv
 SUB_FILES=	pkg-message
 
@@ -35,8 +37,6 @@
 .endif
 
 do-install:
-	@ ${SETENV} PKG_PREFIX=${PREFIX} \
-		${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
 	@${MKDIR} ${INSTALL_DIR}
 	@${CHOWN} ${VENT_USER} ${INSTALL_DIR}
 	${INSTALL_PROGRAM} ${WRKSRC}/ventrilo_srv ${INSTALL_DIR}
@@ -54,10 +54,6 @@
 post-install:
 	@${CAT} ${PKGMESSAGE}
 
-post-deinstall:
-	@ ${SETENV} PKG_PREFIX=${PREFIX} \
-		${SH} ${PKGDEINSTALL} ${PORTNAME} POST-DEINSTALL
-
 PKGDEINSTALL=	${PKGINSTALL}
 
 .include <bsd.port.post.mk>
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	6 Oct 2006 21:26:08 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,67 +0,0 @@
-#! /bin/sh
-
-PATH=/bin:/usr/sbin
-HOMEDIR=${PKG_PREFIX}/ventrilo-server
-NAME="Ventrilo"
-
-USER=ventrilo
-UID=117
-GROUP=${USER}
-GID=117
-
-case $2 in
-PRE-INSTALL)
-	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 ${HOMEDIR} -s /sbin/nologin -c "${NAME} Server"
-		then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if ! [ -x ~${USER} ] ; then 
-		mkdir -p "${HOMEDIR}"
-		chown ${USER}:${GROUP} "${HOMEDIR}"
-	fi
-	;;
-
-POST-DEINSTALL)
-	if pw group show "${GROUP}" 2>/dev/null; then
-		if pw groupdel ${GROUP}; then
-			echo "Removed group \"${GROUP}\"."
-		else
-			echo "Removing group \"${GROUP}\" failed..."
-			exit 1
-		fi
-	else
-		echo "Group \"${GROUP}\" doesn't exist!"
-	fi
-
-	if pw user show "${USER}" 2>/dev/null; then
-		if pw userdel ${USER}; then
-			echo "Removed user \"${USER}\"."
-		else
-			echo "Removing user \"${USER}\" failed..."
-			exit 1
-		fi
-	else
-		echo "User \"${USER}\" doesn't exist!"
-	fi
-	;;
-esac
Comment 1 Edwin Groothuis freebsd_committer 2011-06-16 20:50:20 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

Submitter has GNATS access (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer 2011-06-16 20:50:23 UTC
Maintainer of audio/ventrilo-server,

Please note that PR ports/157928 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/157928

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer 2011-06-16 20:50:26 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Chris Rees freebsd_committer 2011-06-30 10:26:47 UTC
State Changed
From-To: feedback->open

Maintainer has timed out
Comment 5 dfilter service freebsd_committer 2011-07-07 19:14:50 UTC
crees       2011-07-07 18:14:36 UTC

  FreeBSD ports repository

  Modified files:
    .                    GIDs UIDs 
    audio/ventrilo-server Makefile 
  Removed files:
    audio/ventrilo-server pkg-install 
  Log:
  audio/ventrilo-server now uses USERS and GROUPS
  
  PR:             ports/157928
  Submitted by:   crees (me)
  Approved by:    rene (mentor, implicit), maintainer timeout (20 days)
  
  Revision  Changes    Path
  1.147     +2 -1      ports/GIDs
  1.161     +2 -1      ports/UIDs
  1.5       +2 -6      ports/audio/ventrilo-server/Makefile
  1.2       +0 -67     ports/audio/ventrilo-server/pkg-install (dead)
_______________________________________________
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-07-07 19:15:05 UTC
State Changed
From-To: open->closed

Committed.