DEBUG_FILES: Create the DEBUGFILEDIR if it doesn't exist on install.

Currently the base.txz distribution does not get the BSD.debug.dist mtree
extracted into it.  So if you start from that and then try to build a 3rd-party
application outside of buildworld it will by-default try installing the
debug files into a missing directory if they are being installed into /usr/lib.

Check for the existence before forcing the directory to be created rather than
the older way of running a shell command with test -d || mkdir -p always.

Reported by:	HardenedBSD (https://github.com/HardenedBSD/secadm/issues/23)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D5411
This commit is contained in:
Bryan Drewery 2016-03-03 18:08:58 +00:00
parent e79cb051d5
commit a324b0f04c
2 changed files with 4 additions and 0 deletions

View File

@ -141,6 +141,8 @@ SHLIB_NAME_FULL=${SHLIB_NAME}.full
DEBUGFILEDIR=${DEBUGDIR}${_SHLIBDIR}
.else
DEBUGFILEDIR=${_SHLIBDIR}/.debug
.endif
.if !exists(${DESTDIR}${DEBUGFILEDIR})
DEBUGMKDIR=
.endif
.else

View File

@ -63,6 +63,8 @@ PROG_FULL=${PROG}.full
DEBUGFILEDIR= ${DEBUGDIR}${BINDIR}
.else
DEBUGFILEDIR?= ${BINDIR}/.debug
.endif
.if !exists(${DESTDIR}${DEBUGFILEDIR})
DEBUGMKDIR=
.endif
.else