Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Feb 2004 03:11:14 -0600
From:      "Brandon D. Valentine" <brandon@dvalentine.com>
To:        FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   patch: ports/Mk/bsd.port.mk:add-plist-docs
Message-ID:  <20040212091114.GG423@geekpunk.net>

next in thread | raw e-mail | index | archive | help

--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--



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