From owner-freebsd-ports@FreeBSD.ORG Thu Feb 12 01:11:18 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41F1C16A4CE for ; Thu, 12 Feb 2004 01:11:18 -0800 (PST) Received: from geekpunk.net (adsl-76-147-31.bna.bellsouth.net [216.76.147.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id C074D43D2F for ; Thu, 12 Feb 2004 01:11:17 -0800 (PST) (envelope-from bandix@geekpunk.net) Received: from localhost.my.domain (taran [127.0.0.1]) by geekpunk.net (8.12.8p1/8.12.6) with ESMTP id i1C9BEvC009168 for ; Thu, 12 Feb 2004 03:11:14 -0600 (CST) (envelope-from bandix@geekpunk.net) Received: (from bandix@localhost) by localhost.my.domain (8.12.8p1/8.12.8/Submit) id i1C9BE45009167 for freebsd-ports@freebsd.org; Thu, 12 Feb 2004 03:11:14 -0600 (CST) Date: Thu, 12 Feb 2004 03:11:14 -0600 From: "Brandon D. Valentine" To: FreeBSD Ports Message-ID: <20040212091114.GG423@geekpunk.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TRYliJ5NKNqkz5bu" Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: patch: ports/Mk/bsd.port.mk:add-plist-docs X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Feb 2004 09:11:18 -0000 --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I have seen many ports use a construct similar to this in the do-install target: .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} .endif Now, all of the ports I've seen do this have a corresponding: %%PORTDOCS%%@rmdir %%DOCSDIR%% or similiar in their pkg-plist. If NOPORTDOCS is defined, then a deinstall of these ports will complain about not being able to remove DOCSDIR due to that line in the pkg-plist. That line shouldn't exist in the PLIST if NOPORTDOCS is defined, which means it should be added to the TMPPLIST at install time rather than hardcoded in the pkg-plist file. The current add-plist-docs target does this if and only if PORTDOCS is set. It should do it in all cases. I have attached a patch to fix this. The patch is untested as my only test machine is undergoing a massive portupgrade at the moment. I'd appreciate some feedback on this. Thanks, Brandon D. Valentine -- brandon@dvalentine.com http://www.geekpunk.net Pseudo-Random Googlism: february is "kindness" month at hillendale --TRYliJ5NKNqkz5bu Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="bsd.port.mk-plist_20040212.patch" Index: ports/Mk/bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.484 diff -u -r1.484 bsd.port.mk --- ports/Mk/bsd.port.mk 4 Feb 2004 04:27:04 -0000 1.484 +++ ports/Mk/bsd.port.mk 12 Feb 2004 09:07:42 -0000 @@ -4896,12 +4896,12 @@ ${SED} -ne 's,^${PREFIX}/,,p' >> ${TMPPLIST} @${FIND} -P -d ${PORTDOCS:S/^/${DOCSDIR}\//} -type d 2>/dev/null | \ ${SED} -ne 's,^${PREFIX}/,@dirrm ,p' >> ${TMPPLIST} - @if [ -d "${DOCSDIR}" ]; then \ - ${ECHO_CMD} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2>/dev/null || true" >> ${TMPPLIST}; \ - fi .else @${DO_NADA} .endif + @if [ -d "${DOCSDIR}" ]; then \ + ${ECHO_CMD} "@unexec rmdir %D/${DOCSDIR:S,^${PREFIX}/,,} 2>/dev/null || true" >> ${TMPPLIST}; \ + fi .endif add-plist-info: --TRYliJ5NKNqkz5bu--