Skip site navigation (1)Skip section navigation (2)
Date:      01 May 2000 13:37:05 -0700
From:      asami@FreeBSD.org (Satoshi - Ports Wraith - Asami)
To:        Tim Vanderhoek <vanderh@ecf.utoronto.ca>
Cc:        ports@FreeBSD.org
Subject:   Re: deleting empty info/dir files
Message-ID:  <vqcg0s2dn2m.fsf@silvia.hip.berkeley.edu>
In-Reply-To: Tim Vanderhoek's message of "Mon, 1 May 2000 11:42:42 -0400"
References:  <200005010853.BAA25327@silvia.hip.berkeley.edu> <20000501114242.A21944@ppp.on.bellglobal.com>

next in thread | previous in thread | raw e-mail | index | archive | help
 * From: Tim Vanderhoek <vanderh@ecf.utoronto.ca>

 * On Mon, May 01, 2000 at 01:53:35AM -0700, Satoshi Asami wrote:
 * > 
 * > 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
 * 
 * Isn't this just a slightly more complicated way of saying:
 * 
 * @unexec if [ -f %D/info/dir] && (! sed -e '1,/Menu:/d' %D/info/dir | grep -q '^[*] '; then rm %D/info/dir; fi

Could be.  But your parens don't match.

 * > 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 :).
 * 
 * There's obviously something I don't understand here, since I would
 * just change the 
 * 
 * >  		-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" \
 *                        ^^^^
 * 
 * to an '@unexec'.  Since it's obvious I don't understand the question,
 * I won't even try to answer.  :-)

That would put it *before* "@unexec install-info", which will make it
useless. :>

Anyway, forget it, I just realized that bsd.port.mk unconditionally
creates info/dir when installing from a port so it should be
(conditionally only on its emptiness) deleted or all ports that
*don't* have an info file will leave info/dir behind.  The following
will put the @unexec line only once, and at the end of PLIST.

===
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 12:49:28
@@ -2704,6 +2704,7 @@
 	 ${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" >> ${TMPPLIST}
+	@${ECHO} "@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" >> ${TMPPLIST}
 .if !defined(NO_FILTER_SHLIBS)
 .if (${PORTOBJFORMAT} == "aout")
 	@${SED} -e 's,\(/lib.*\.so\.[0-9]*\)$$,\1.0,' ${TMPPLIST} > ${TMPPLIST}.tmp
===

Satoshi


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?vqcg0s2dn2m.fsf>