aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormva <mva@FreeBSD.org>2013-09-28 02:33:16 +0800
committermva <mva@FreeBSD.org>2013-09-28 02:33:16 +0800
commitb1b57387e672fa2bfcc28b35783620094cf9a207 (patch)
treecfb3eb79383e4c4e47a53851555a1645e4bb938f /Mk
parentfe66a21dc51dc107bae8dbc9640af7124de49c90 (diff)
downloadfreebsd-ports-gnome-b1b57387e672fa2bfcc28b35783620094cf9a207.tar.gz
freebsd-ports-gnome-b1b57387e672fa2bfcc28b35783620094cf9a207.tar.zst
freebsd-ports-gnome-b1b57387e672fa2bfcc28b35783620094cf9a207.zip
- Delete the whole directory hierarchy, not only directories containing
files, when using PYDISTUTILS_AUTOPLIST. Spotted by: wg@
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.python.mk19
1 files changed, 14 insertions, 5 deletions
diff --git a/Mk/bsd.python.mk b/Mk/bsd.python.mk
index 7eab2c4b9451..67952e32faff 100644
--- a/Mk/bsd.python.mk
+++ b/Mk/bsd.python.mk
@@ -503,18 +503,27 @@ PYDISTUTILS_INSTALLARGS:= --record ${_PYTHONPKGLIST} \
${PYDISTUTILS_INSTALLARGS}
_RELSITELIBDIR= ${PYTHONPREFIX_SITELIBDIR:S;${PREFIX}/;;}
+_RELLIBDIR= ${PYTHONPREFIX_LIBDIR:S;${PREFIX}/;;}
add-plist-post: add-plist-pymod
add-plist-pymod:
- { ${ECHO_CMD} "#mtree"; ${CAT} ${MTREE_FILE}; } | ${TAR} tf - | \
+ @{ ${ECHO_CMD} "#mtree"; ${CAT} ${MTREE_FILE}; } | ${TAR} tf - | \
${SED} '/^\.$$/d' > ${WRKDIR}/.localmtree
- ${ECHO_CMD} "${_RELSITELIBDIR}" >> ${WRKDIR}/.localmtree
- ${SED} 's|^${PREFIX}/||' ${_PYTHONPKGLIST} | ${SORT} >> ${TMPPLIST}
- ${SED} -e 's|^${PREFIX}/\(.*\)/\(.*\)|\1|' ${_PYTHONPKGLIST} | \
+ @${ECHO_CMD} "${_RELSITELIBDIR}" >> ${WRKDIR}/.localmtree
+ @${ECHO_CMD} "${_RELLIBDIR}" >> ${WRKDIR}/.localmtree
+ @${SED} 's|^${PREFIX}/||' ${_PYTHONPKGLIST} | ${SORT} >> ${TMPPLIST}
+ @${SED} -e 's|^${PREFIX}/\(.*\)/\(.*\)|\1|' ${_PYTHONPKGLIST} | \
+ ${AWK} '{ num = split($$0, a, "/"); res=""; \
+ for(i = 1; i <= num; ++i) { \
+ if (i == 1) res = a[i]; \
+ else res = res "/" a[i]; \
+ print res; \
+ } \
+ }' | \
while read line; do \
${GREP} -qw "^$${line}$$" ${WRKDIR}/.localmtree || { \
[ -n "$${line}" ] && \
- ${ECHO_CMD} "@unexec rmdir $${line} 2>/dev/null || true"; \
+ ${ECHO_CMD} "@unexec rmdir \"%D/$${line}\" 2>/dev/null || true"; \
}; \
done | ${SORT} | uniq | ${SORT} -r >> ${TMPPLIST}