From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jul 20 14:58:14 2004 Return-Path: Delivered-To: freebsd-ports-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA65A16A4CE for ; Tue, 20 Jul 2004 14:58:14 +0000 (GMT) Received: from wasley.bl.mmtr.or.jp (wasley.bl.mmtr.or.jp [210.228.173.142]) by mx1.FreeBSD.org (Postfix) with SMTP id 76CD243D4C for ; Tue, 20 Jul 2004 14:58:11 +0000 (GMT) (envelope-from rushani@FreeBSD.org) Received: (qmail 24698 invoked from network); 20 Jul 2004 14:58:06 -0000 Received: from unknown (HELO localhost) (202.229.152.118) by wasley.bl.mmtr.or.jp with SMTP; 20 Jul 2004 14:58:06 -0000 Date: Tue, 20 Jul 2004 23:55:47 +0900 (JST) Message-Id: <20040720.235547.30101387.rushani@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org From: Hideyuki KURASHINA In-Reply-To: <200407191340.i6JDeEUc059120@freefall.freebsd.org> References: <20040719.223232.71185611.rushani@FreeBSD.org> <200407191340.i6JDeEUc059120@freefall.freebsd.org> X-URL: http://www.rushani.jp/ X-PGP-Public-Key: http://www.rushani.jp/rushani.asc X-PGP-Fingerprint: A052 6F98 6146 6FE3 91E2 DA6B F2FA 2088 439A DC57 X-RC5-72-Stats: http://stats.distributed.net/participant/psummary.php?project_id=8&id=432320 X-Mailer: Mew version 4.0.65 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: mharo@FreeBSD.org Subject: Re: ports/69288: [PATCH] security/sudo: Fix deinstall X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2004 14:58:15 -0000 In a previous PR, one of changes I requested was removing ${PREFIX}/etc/sudoers in the ``pkg-plist'' if it is identical with ${EXAMPLESDIR}/sudoers. After sending a PR, I've got a suggestion about where to remove the config file from Umemoto-san. That point is utilizing ``pkg-deinstall''. I believe it is reasonable for consistency because we use ``pkg-install'' for package. I've made a patch again. Please apply following patch (While I'm here, use EXAMPLESDIR in both ``pkg-install'' and ``pkg-deinstall''). Regards, -- rushani Index: Makefile =================================================================== RCS file: /home/ncvs/ports/security/sudo/Makefile,v retrieving revision 1.63 diff -u -r1.63 Makefile --- Makefile 20 Jul 2004 08:30:14 -0000 1.63 +++ Makefile 20 Jul 2004 14:43:48 -0000 @@ -7,7 +7,7 @@ PORTNAME= sudo PORTVERSION= 1.6.7.5 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= security MASTER_SITES= http://www.sudo.ws/sudo/dist/ \ http://probsd.org/sudoftp/ \ @@ -51,10 +51,21 @@ MAN5= sudoers.5 MAN8= sudo.8 visudo.8 +PKGDEINSTALL= ${WRKDIR}/pkg-deinstall +PKGINSTALL= ${WRKDIR}/pkg-install + post-patch: @${REINPLACE_CMD} -e 's|^|#|g' ${WRKSRC}/sample.sudoers + @${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \ + -e "s|%%EXAMPLESDIR%%|${EXAMPLESDIR}|g" \ + ${.CURDIR}/pkg-install > ${PKGINSTALL} + @${SED} -e "s|%%PREFIX%%|${PREFIX}|g" \ + -e "s|%%EXAMPLESDIR%%|${EXAMPLESDIR}|g" \ + ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL} post-install: - ${INSTALL_DATA} ${WRKSRC}/sample.sudoers ${PREFIX}/etc/sudoers.sample + @${MKDIR} ${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/sudoers ${EXAMPLESDIR}/sudoers + ${INSTALL_DATA} ${WRKSRC}/sample.sudoers ${EXAMPLESDIR}/sudoers.sample .include Index: pkg-deinstall =================================================================== RCS file: pkg-deinstall diff -N pkg-deinstall --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg-deinstall 20 Jul 2004 14:42:18 -0000 @@ -0,0 +1,12 @@ +#!/bin/sh + +PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%} +EXAMPLESDIR=${EXAMPLESDIR:=%%EXAMPLESDIR%%} + +if [ $2 != "DEINSTALL" ]; then + exit 0 +fi + +if cmp -s ${PKG_PREFIX}/etc/sudoers ${EXAMPLESDIR}/sudoers; then + rm -f ${PKG_PREFIX}/etc/sudoers +fi Index: pkg-install =================================================================== RCS file: /home/ncvs/ports/security/sudo/pkg-install,v retrieving revision 1.4 diff -u -r1.4 pkg-install --- pkg-install 20 Jul 2004 08:30:14 -0000 1.4 +++ pkg-install 20 Jul 2004 14:46:09 -0000 @@ -1,10 +1,15 @@ #!/bin/sh + +PKG_PREFIX=${PKG_PREFIX:=%%PREFIX%%} +EXAMPLESDIR=${EXAMPLESDIR:=%%EXAMPLESDIR%%} + if [ $2 != "POST-INSTALL" ]; then exit 0 fi + if [ -e ${PKG_PREFIX}/etc/sudoers ]; then echo "Will not overwrite existing ${PKG_PREFIX}/etc/sudoers file." else - cp -p ${PKG_PREFIX}/etc/sudoers.sample ${PKG_PREFIX}/etc/sudoers + cp -p ${EXAMPLESDIR}/sudoers ${PKG_PREFIX}/etc/sudoers chmod 440 ${PKG_PREFIX}/etc/sudoers fi Index: pkg-plist =================================================================== RCS file: /home/ncvs/ports/security/sudo/pkg-plist,v retrieving revision 1.9 diff -u -r1.9 pkg-plist --- pkg-plist 20 Jul 2004 08:30:14 -0000 1.9 +++ pkg-plist 20 Jul 2004 14:43:03 -0000 @@ -1,4 +1,5 @@ -@unexec if cmp -s %D/etc/sudoers %D/etc/sudoers.sample; then rm -f %D/etc/sudoers; fi bin/sudo -etc/sudoers.sample sbin/visudo +%%EXAMPLESDIR%%/sudoers +%%EXAMPLESDIR%%/sudoers.sample +@dirrm %%EXAMPLESDIR%%