Bug 75379 - [patch] bsd.port.mk / add-plist-docs is too relaxed
Summary: [patch] bsd.port.mk / add-plist-docs is too relaxed
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-22 05:30 UTC by edwin
Modified: 2005-02-07 11:27 UTC (History)
0 users

See Also:


Attachments
file.diff (1.20 KB, patch)
2004-12-22 05:30 UTC, edwin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description edwin 2004-12-22 05:30:29 UTC
Today I had a port which installed its docs into
/usr/local/share/docs/blaat. At least, that was the expected
behaviour. What the port did not do was creating that directory
first, and thus was copying the files over the file
/usr/local/share/docs/blaat each time.

All with all very annoying, and I was surprised that the ports
framework didn't alert me about it while running "make deinstall".

When looking at add-plist-docs, it only adds the files in PORTDOCS
which it can find (although find(1) gives a warning it is /dev/nulled).
At the end of it only adds the DOCSDIR if it is a directory.


Although it is a discussion issue to start with, it is my opinion
that the variables set in the ports Makefile have to be correct.
And if they are not, bsd.port.mk should warn us about them being
wrong (USE_LIBTOOL_VER=14 is a nice example) instead of being Mr
Nice Guy and fix it behind our backs.

Fix: This will make bsd.port.mk / add-plist-docs less tolerant to
mistakes.
How-To-Repeat: 
Checkout ports/dns/sqldjbdns/Makefile revision 1.1, and wonder why
an install / deinstall you have a file called
/usr/local/share/docs/sqldjbdns leftover.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2004-12-22 06:07:25 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

involves bsd.port.mk.
Comment 2 krion 2005-02-05 22:04:58 UTC
> +.for x in ${PORTDOCS}
> +	# Create a file for every file which is defined but does not exist
> +	# so that pkg_delete(1)/pkg_create(1) complains about missing files.
> +	if [ ! -e ${DOCSDIR}/${x} ]; then \
> +		${ECHO_CMD} ${DOCSDIR}/${x} | \
> +			${SED} -e 's,^${PREFIX}/,,' >> ${TMPPLIST}; \
> +	fi
> +.endfor
>  	@${FIND} -P ${PORTDOCS:S/^/${DOCSDIR}\//} ! -type d 2>/dev/null | \
>  		${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
> +	${ECHO_CMD} "@dirrm ${DOCSDIR:S,^${PREFIX}/,,}" >> ${TMPPLIST}
>  .else
>  	@${DO_NADA}

JFYI:  I removed the comments and added '@' to 'if' and ${ECHO_CMD}
to supress the superfluous output.

-Kirill
Comment 3 Kirill Ponomarev freebsd_committer 2005-02-07 11:26:55 UTC
State Changed
From-To: open->closed

Committed, thanks!