From owner-freebsd-ports Mon May 1 1:55:30 2000 Delivered-To: freebsd-ports@freebsd.org Received: from granger.mail.mindspring.net (granger.mail.mindspring.net [207.69.200.148]) by hub.freebsd.org (Postfix) with ESMTP id 9E27237B6F0 for ; Mon, 1 May 2000 01:55:27 -0700 (PDT) (envelope-from asami@cs.berkeley.edu) Received: from silvia.hip.berkeley.edu (sji-ca7-07.ix.netcom.com [209.109.235.7]) by granger.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id EAA24502 for ; Mon, 1 May 2000 04:55:06 -0400 (EDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.9.3/8.6.9) id BAA25327; Mon, 1 May 2000 01:53:35 -0700 (PDT) Date: Mon, 1 May 2000 01:53:35 -0700 (PDT) Message-Id: <200005010853.BAA25327@silvia.hip.berkeley.edu> X-Authentication-Warning: silvia.hip.berkeley.edu: asami set sender to asami@cs.berkeley.edu using -f To: ports@freebsd.org Subject: deleting empty info/dir files From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Ports, What do you think about the following? It basically adds the line @unexec if [ -f %D/info/dir ]; then if sed -e '1,/Menu:/d' %D/info/dir | grep -q '^[*] '; then true; else rm %D/info/dir; fi; fi to PLIST. It removes ${PREFIX}/info/dir if there are no entries left in the dir file (no "* " at beginning of line after the "Menu:' line). The -f test is necessary because it will be inserted before every "@exec install-info" and thus the user might see an error from sed otherwise. Maybe Tim 'hoek will tell me how to do it only once and after "@unexec install-info" (it is fine either way, but it will look nicer :). Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.337 diff -u -r1.337 bsd.port.mk --- bsd.port.mk 2000/04/20 01:06:12 1.337 +++ bsd.port.mk 2000/05/01 08:09:41 @@ -2703,6 +2703,9 @@ @${SED} ${PLIST_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${PLIST} | \ ${SED} -e "/\@exec install-info.*$$/h" \ -e "s^^\@exec [ -f %D/info/dir -o ! -f /usr/share/info/dir ] || sed -ne '1,/Menu:/p' /usr/share/info/dir > %D/info/dir^g" \ + -e "t fix" -e "b" -e ":fix" -e "G" | \ + ${SED} -e "/\@exec install-info.*$$/h" \ + -e "s!!\@unexec if [ -f %D/info/dir ]; then if sed -e '1,/Menu:/d' %D/info/dir | grep -q '^[*] '; then true; else rm %D/info/dir; fi; fi!g" \ -e "t fix" -e "b" -e ":fix" -e "G" >> ${TMPPLIST} .if !defined(NO_FILTER_SHLIBS) .if (${PORTOBJFORMAT} == "aout") To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message