svn commit: r358636 - in head: Keywords Mk
Antoine Brodin
antoine at FreeBSD.org
Fri Jun 20 21:03:03 UTC 2014
Author: antoine
Date: Fri Jun 20 21:03:02 2014
New Revision: 358636
URL: http://svnweb.freebsd.org/changeset/ports/358636
QAT: https://qat.redports.org/buildarchive/r358636/
Log:
Make @dirrmtry handling in pkg_install closer to what pkg does
Original patch: bapt
Phabric: D215
Exp-run: self, less orphans/leftovers with pkg_install with patch than without
and no new failures with pkg
With hat: portmgr
Modified:
head/Keywords/pkg_install.awk
head/Mk/bsd.port.mk
head/Mk/bsd.python.mk
Modified: head/Keywords/pkg_install.awk
==============================================================================
--- head/Keywords/pkg_install.awk Fri Jun 20 20:54:40 2014 (r358635)
+++ head/Keywords/pkg_install.awk Fri Jun 20 21:03:02 2014 (r358636)
@@ -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
Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk Fri Jun 20 20:54:40 2014 (r358635)
+++ head/Mk/bsd.port.mk Fri Jun 20 21:03:02 2014 (r358636)
@@ -1586,8 +1586,7 @@ SUB_LIST+= PREFIX=${PREFIX} 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
Modified: head/Mk/bsd.python.mk
==============================================================================
--- head/Mk/bsd.python.mk Fri Jun 20 20:54:40 2014 (r358635)
+++ head/Mk/bsd.python.mk Fri Jun 20 21:03:02 2014 (r358636)
@@ -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)
More information about the svn-ports-all
mailing list