diff options
-rw-r--r-- | Keywords/pkg_install.awk | 12 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 5 | ||||
-rw-r--r-- | Mk/bsd.python.mk | 10 |
3 files changed, 20 insertions, 7 deletions
diff --git a/Keywords/pkg_install.awk b/Keywords/pkg_install.awk index 7f3d5903f358..7128dfb06f46 100644 --- a/Keywords/pkg_install.awk +++ b/Keywords/pkg_install.awk @@ -84,6 +84,18 @@ $1 == "@fontsdir" { next } +$1 == "@dirrmtry" { + directory=substr($0, 11, length($0) - 10) + print "@comment begin " $0 + if ($2 ~ /^\//) { + print "@unexec rmdir \"" directory "\" 2>/dev/null || true" + } else { + print "@unexec rmdir \"%D/" directory "\" 2>/dev/null || true" + } + print "@comment end " $0 + next +} + # Print everything else as-is { print $0 diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 9d6e5c8765a9..7c35083336b1 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1586,8 +1586,7 @@ SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \ PLIST_SUB_SED_MIN?= 2 PLIST_SUB_SED?= ${PLIST_SUB:C/.*=.{1,${PLIST_SUB_SED_MIN}}$//g:NEXTRACT_SUFX=*:NOSREL=*:NLIB32DIR=*:NPREFIX=*:NLOCALBASE=*:N*="":N*="@comment*:C/([^=]*)="?([^"]*)"?/s!\2!%%\1%%!g;/g:C/\./\\./g} -PLIST_REINPLACE+= dirrmtry stopdaemon rmtry -PLIST_REINPLACE_DIRRMTRY=s!^@dirrmtry \(.*\)!@unexec rmdir "%D/\1" 2>/dev/null || true! +PLIST_REINPLACE+= stopdaemon rmtry PLIST_REINPLACE_RMTRY=s!^@rmtry \(.*\)!@unexec rm -f %D/\1 2>/dev/null || true! PLIST_REINPLACE_STOPDAEMON=s!^@stopdaemon \(.*\)!@unexec %D/etc/rc.d/\1 forcestop 2>/dev/null || true! @@ -5742,7 +5741,7 @@ add-plist-info: .if (${PREFIX} != "/usr") @${ECHO_CMD} "@unexec if [ -f %D/${INFO_PATH}/dir ]; then if sed -e '1,/Menu:/d' %D/${INFO_PATH}/dir | grep -q '^[*] '; then true; else rm %D/${INFO_PATH}/dir; fi; fi" >> ${TMPPLIST} .if (${PREFIX} != ${LOCALBASE} && ${PREFIX} != ${LINUXBASE}) - @${ECHO_CMD} "@unexec rmdir %D/${INFO_PATH} 2>/dev/null || true" >> ${TMPPLIST} + @${ECHO_CMD} "@dirrmtry ${INFO_PATH}" >> ${TMPPLIST} .endif .endif .endif diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk index 54438cd29749..14e214cb92f9 100644 --- a/Mk/bsd.python.mk +++ b/Mk/bsd.python.mk @@ -580,7 +580,7 @@ add-plist-egginfo: ${LS} ${PYDISTUTILS_EGGINFODIR}/${egginfo} | while read f; do \ ${ECHO_CMD} ${PYDISTUTILS_EGGINFODIR:S;^${STAGEDIR}${PYTHONBASE}/;;}/${egginfo}/$${f} >> ${TMPPLIST}; \ done; \ - ${ECHO_CMD} "@unexec rmdir \"%D/${PYDISTUTILS_EGGINFODIR:S;${STAGEDIR}${PYTHONBASE}/;;}/${egginfo}\" 2>/dev/null || true" >> ${TMPPLIST}; \ + ${ECHO_CMD} "@dirrmtry ${PYDISTUTILS_EGGINFODIR:S;${STAGEDIR}${PYTHONBASE}/;;}/${egginfo}" >> ${TMPPLIST}; \ fi; . endfor .else @@ -613,11 +613,13 @@ add-plist-pymod: while read line; do \ ${GREP} -qw "^$${line}$$" ${WRKDIR}/.localmtree || { \ [ -n "$${line}" ] && \ - ${ECHO_CMD} "@unexec rmdir \"%D/$${line}\" 2>/dev/null || true"; \ + ${ECHO_CMD} "@dirrmtry $${line}"; \ }; \ done | ${SORT} | uniq | ${SORT} -r >> ${TMPPLIST} - @${ECHO_CMD} "@unexec rmdir \"%D/${PYTHON_SITELIBDIR:S;${PYTHONBASE}/;;}\" 2>/dev/null || true" >> ${TMPPLIST} - @${ECHO_CMD} "@unexec rmdir \"%D/${PYTHON_LIBDIR:S;${PYTHONBASE}/;;}\" 2>/dev/null || true" >> ${TMPPLIST} +.if ${PREFIX} != ${LOCALBASE} + @${ECHO_CMD} "@dirrmtry ${PYTHON_SITELIBDIR:S;${PYTHONBASE}/;;}" >> ${TMPPLIST} + @${ECHO_CMD} "@dirrmtry ${PYTHON_LIBDIR:S;${PYTHONBASE}/;;}" >> ${TMPPLIST} +.endif .else .if ${PYTHON_REL} >= 320 && defined(PYTHON_PY3K_PLIST_HACK) |