Use 'rm -rf foo/bar' to remove a port instead of 'rm -rf foo/bar/'.

When /usr/ports/foo/bar is a symlink pointing outside the tree, this
deletes the symlink instead of the directory it points to.

Requested by:	delphij
This commit is contained in:
Colin Percival 2006-05-12 10:42:40 +00:00
parent e2c1a4e909
commit 343c554c88

View File

@ -872,7 +872,8 @@ extract_run() {
fi
case ${FILE} in
*/)
rm -rf ${PORTSDIR}/${FILE}
DIR=`echo ${FILE} | sed -e 's|/$||'`
rm -rf ${PORTSDIR}/${DIR}
mkdir -p ${PORTSDIR}/${FILE}
tar -xzf ${WORKDIR}/files/${HASH}.gz \
-C ${PORTSDIR}/${FILE}
@ -914,11 +915,13 @@ update_run() {
sort ${WORKDIR}/INDEX |
comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d '|' |
grep -vE "${REFUSE}" |
lam -s "${PORTSDIR}/" - | xargs rm -rf
lam -s "${PORTSDIR}/" - |
sed -e 's|/$||' | xargs rm -rf
else
sort ${WORKDIR}/INDEX |
comm -23 ${PORTSDIR}/.portsnap.INDEX - | cut -f 1 -d '|' |
lam -s "${PORTSDIR}/" - | xargs rm -rf
lam -s "${PORTSDIR}/" - |
sed -e 's|/$||' | xargs rm -rf
fi
echo "done."