Bug 157576 - [PATCH] Fix port: mail/dkfilter should use USERS
Summary: [PATCH] Fix port: mail/dkfilter 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-04 09:30 UTC by Chris Rees
Modified: 2011-06-27 19:00 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-04 09:30:13 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)


	Please bear in mind that files/pkg-install and files/pkg-deinstall.in have been removed.



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

Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/mail/dkfilter/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- Makefile	27 Jan 2010 13:05:25 -0000	1.10
+++ Makefile	2 Jun 2011 21:31:26 -0000
@@ -24,18 +24,10 @@
 USE_PERL5=	yes
 USE_RC_SUBR=	dkfilter_in dkfilter_out
 
+USERS=		${DKFILTER_USERNAME}
+GROUPS=		${DKFILTER_GROUPNAME}
+
 DKFILTER_USERNAME?=	dkfilter
-DKFILTER_USERID?=	325
 DKFILTER_GROUPNAME?=	${DKFILTER_USERNAME}
-DKFILTER_GROUPID?=	${DKFILTER_USERID}
-
-SUB_FILES=	pkg-install pkg-deinstall
-SUB_LIST=	USER=${DKFILTER_USERNAME} \
-		UID=${DKFILTER_USERID} \
-		GROUP=${DKFILTER_GROUPNAME} \
-		GID=${DKFILTER_GROUPID}
-
-pre-install:
-	${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
 
 .include <bsd.port.mk>
Index: files/pkg-deinstall.in
===================================================================
RCS file: files/pkg-deinstall.in
diff -N files/pkg-deinstall.in
--- files/pkg-deinstall.in	29 Jul 2006 02:07:43 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,13 +0,0 @@
-#!/bin/sh
-# $FreeBSD: ports/mail/dkfilter/files/pkg-deinstall.in,v 1.1 2006/07/29 02:07:43 rafan Exp $
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-	exit 0
-fi
-
-USERNAME=%%USER%%
-
-if pw usershow "${USERNAME}" 2>/dev/null 1>&2; then
-	echo "To delete ${USERNAME} user permanently, use 'pw userdel \"${USERNAME}\"'"
-fi
-exit 0
Index: files/pkg-install.in
===================================================================
RCS file: files/pkg-install.in
diff -N files/pkg-install.in
--- files/pkg-install.in	29 Jul 2006 02:07:43 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-#! /bin/sh
-#
-# $FreeBSD: ports/mail/dkfilter/files/pkg-install.in,v 1.1 2006/07/29 02:07:43 rafan Exp $
-
-PATH=/bin:/usr/bin:/usr/sbin
-
-case $2 in
-
-PRE-INSTALL)
-  echo "---> Starting install script:"
-
-  if [ -z "%%USER%%" -o -z "%%GROUP%%" -o \
-       -z "%%UID%%" -o -z "%%GID%%" ]; then
-    echo "ERROR: A required pragma was empty"
-    exit 1
-  fi
-
-  # Create group if required
-  if pw group show "%%GROUP%%" >/dev/null 2>&1; then
-    echo "---> Using existing group \"%%GROUP%%\""
-  else
-    echo "---> Adding group \"%%GROUP%%\" (%%GID%%)"
-    /usr/sbin/pw groupadd %%GROUP%% -g %%GID%% || exit 1
-  fi
-
-  # Create user if required
-  if pw user show "%%USER%%" >/dev/null 2>&1; then
-    echo "---> Using existing user \"%%USER%%\""
-  else
-    echo "---> Adding user \"%%USER%%\" (%%UID%%)"
-    pw useradd "%%USER%%" -u "%%UID%%" -g "%%GROUP%%" -h - \
-      -d "/nonexistent" -s "/sbin/nologin" -c "DK Filter Owner" || exit 1
-  fi
-  ;;
-
-esac
Comment 1 Edwin Groothuis freebsd_committer 2011-06-04 09:30:39 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pgollucci

pgollucci@ wants his PRs (via the GNATS Auto Assign Tool)
Comment 2 Edwin Groothuis freebsd_committer 2011-06-04 09:30:45 UTC
Maintainer of mail/dkfilter,

Please note that PR ports/157576 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/157576

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 3 Edwin Groothuis freebsd_committer 2011-06-04 09:30:49 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 4 Yoshisato YANAGISAWA 2011-06-04 14:39:31 UTC
Looks good to me.
There is no reason to make user & group in my own way for now.
Comment 5 Yoshisato YANAGISAWA 2011-06-05 02:57:39 UTC
I approve this patch.
Thank you for your contribution.
Comment 6 Chris Rees freebsd_committer 2011-06-22 17:50:30 UTC
Responsible Changed
From-To: pgollucci->crees
Comment 7 Chris Rees freebsd_committer 2011-06-25 13:49:01 UTC
State Changed
From-To: feedback->open

Maintainer has approved.
Comment 8 dfilter service freebsd_committer 2011-06-27 18:52:52 UTC
crees       2011-06-27 17:52:38 UTC

  FreeBSD ports repository

  Modified files:
    mail/dkfilter        Makefile 
  Removed files:
    mail/dkfilter/files  pkg-deinstall.in pkg-install.in 
  Log:
  - Use USERS and GROUPS
  
  PR:             ports/157576
  Submitted by:   Chris Rees (utisoft@gmail.com)
  Approved by:    tabthorpe (co-mentor), maintainer
  
  Revision  Changes    Path
  1.11      +3 -11     ports/mail/dkfilter/Makefile
  1.2       +0 -13     ports/mail/dkfilter/files/pkg-deinstall.in (dead)
  1.2       +0 -36     ports/mail/dkfilter/files/pkg-install.in (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 9 Chris Rees freebsd_committer 2011-06-27 18:52:59 UTC
State Changed
From-To: open->closed

Committed.