From owner-freebsd-ports-bugs@FreeBSD.ORG Tue May 3 16:20:07 2005 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3D89216A4CE for ; Tue, 3 May 2005 16:20:07 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC38743D7B for ; Tue, 3 May 2005 16:20:06 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j43GK1kU029841 for ; Tue, 3 May 2005 16:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j43GK13u029840; Tue, 3 May 2005 16:20:01 GMT (envelope-from gnats) Resent-Date: Tue, 3 May 2005 16:20:01 GMT Resent-Message-Id: <200505031620.j43GK13u029840@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Renato Botelho Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F8C516A4CE for ; Tue, 3 May 2005 16:13:28 +0000 (GMT) Received: from data.galle.com.br (data.galle.com.br [200.246.25.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A09343D76 for ; Tue, 3 May 2005 16:13:27 +0000 (GMT) (envelope-from renato@data.galle.com.br) Received: from data.galle.com.br (data.galle.com.br [200.246.25.10]) by data.galle.com.br (8.13.1/8.13.1) with ESMTP id j43GDQQ5007651 for ; Tue, 3 May 2005 13:13:26 -0300 (BRST) (envelope-from renato@data.galle.com.br) Received: (from root@localhost) by data.galle.com.br (8.13.1/8.13.1/Submit) id j43GDLUh007650; Tue, 3 May 2005 13:13:21 -0300 (BRST) (envelope-from renato) Message-Id: <200505031613.j43GDLUh007650@data.galle.com.br> Date: Tue, 3 May 2005 13:13:21 -0300 (BRST) From: Renato Botelho To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/80583: [MAINTAINER] shells/perlsh: change the way used to change /etc/shells 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, 03 May 2005 16:20:07 -0000 >Number: 80583 >Category: ports >Synopsis: [MAINTAINER] shells/perlsh: change the way used to change /etc/shells >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Tue May 03 16:20:01 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Renato Botelho >Release: FreeBSD 5.3-RELEASE-p9 i386 >Organization: Galle Folheados - http://www.galle.com.br >Environment: System: FreeBSD data.galle.com.br 5.3-RELEASE-p9 FreeBSD 5.3-RELEASE-p9 #9: Fri Apr 15 07:52:00 BRST 2005 >Description: - Change the way used to add/remove the shell on /etc/shells, use pkg-install and pkg-deinstall (both stoled from shells/bash) to do it. - Remove pre-install section, it's not more needed on this version, because Makefile is created correctly changing Makefile.PL Added file(s): - pkg-deinstall - pkg-install Generated with FreeBSD Port Tools 0.63 >How-To-Repeat: >Fix: --- perlsh-1.8.patch begins here --- Index: Makefile =================================================================== RCS file: /home/ncvs/ports/shells/perlsh/Makefile,v retrieving revision 1.19 diff -u -r1.19 Makefile --- Makefile 18 Apr 2005 16:08:18 -0000 1.19 +++ Makefile 3 May 2005 16:11:43 -0000 @@ -29,16 +29,7 @@ Psh::Strategy.3 \ Psh::StrategyBunch.3 -pre-install: - @${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/Makefile; - @${PERL} -pi -e "s:/usr/local/man/man1:${MAN3PREFIX}/man/man1:g" ${WRKSRC}/Makefile; - @${PERL} -pi -e "s:/usr/local/lib/perl5/5.00503/man/man3:${MAN3PREFIX}/man/man3:g" ${WRKSRC}/Makefile; - post-install: - @${ECHO_MSG} "Updating /etc/shells" - @${CP} /etc/shells /etc/shells.bak - @(${GREP} -v ${PREFIX}/bin/psh /etc/shells.bak; \ - ${ECHO_CMD} ${PREFIX}/bin/psh) > /etc/shells - @${RM} /etc/shells.bak + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL .include Index: pkg-deinstall =================================================================== RCS file: pkg-deinstall diff -N pkg-deinstall --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg-deinstall 3 May 2005 16:11:43 -0000 @@ -0,0 +1,22 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +PSH="${PKG_PREFIX-/usr/local}/bin/psh" +SHELLS="${PKG_DESTDIR-}/etc/shells" + +case $2 in +DEINSTALL) + if grep -qs "^$PSH\$" "$SHELLS"; then + if [ `id -u` -eq 0 ]; then + TMPSHELLS=`mktemp -t shells` + grep -v "^$PSH\$" "$SHELLS" > "$TMPSHELLS" + cat "$TMPSHELLS" > "$SHELLS" + rm "$TMPSHELLS" + else + echo "Not root, please remove $PSH from $SHELLS manually" + fi + fi + ;; +esac Index: pkg-install =================================================================== RCS file: pkg-install diff -N pkg-install --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg-install 3 May 2005 16:11:43 -0000 @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +PSH="${PKG_PREFIX-/usr/local}/bin/psh" +SHELLS="${PKG_DESTDIR-}/etc/shells" + +case $2 in +POST-INSTALL) + if [ -d "${SHELLS%/*}" ] && ! grep -qs "^$PSH\$" "$SHELLS"; then + if [ `id -u` -eq 0 ]; then + echo "$PSH" >> "$SHELLS" + else + echo "Not root, please add $PSH to $SHELLS manually" + fi + fi + ;; +esac Index: pkg-plist =================================================================== RCS file: /home/ncvs/ports/shells/perlsh/pkg-plist,v retrieving revision 1.12 diff -u -r1.12 pkg-plist --- pkg-plist 19 Apr 2005 17:46:52 -0000 1.12 +++ pkg-plist 3 May 2005 16:11:43 -0000 @@ -1,7 +1,5 @@ @comment $FreeBSD: ports/shells/perlsh/pkg-plist,v 1.12 2005/04/19 17:46:52 leeym Exp $ bin/psh -@exec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells; rm -f /etc/shells.bak -@unexec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells; rm -f /etc/shells.bak share/psh/complete/debian share/psh/complete/perl share/psh/complete/standard --- perlsh-1.8.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: