Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 May 2000 01:53:35 -0700 (PDT)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        ports@freebsd.org
Subject:   deleting empty info/dir files
Message-ID:  <200005010853.BAA25327@silvia.hip.berkeley.edu>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005010853.BAA25327>