summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2006-05-12 10:42:40 +0000
committercperciva <cperciva@FreeBSD.org>2006-05-12 10:42:40 +0000
commitc1762f0053c7d6bc756b194a9d5d5e99b2367359 (patch)
tree57e19b0d1ae7877e381c8f56c3c60dd2cb1a51e9
parentf5ddc94946396f1b2a43a517d74b303862ad72ce (diff)
downloadFreeBSD-src-c1762f0053c7d6bc756b194a9d5d5e99b2367359.zip
FreeBSD-src-c1762f0053c7d6bc756b194a9d5d5e99b2367359.tar.gz
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
-rw-r--r--usr.sbin/portsnap/portsnap/portsnap.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh
index 4ce7155..c730ad4 100644
--- a/usr.sbin/portsnap/portsnap/portsnap.sh
+++ b/usr.sbin/portsnap/portsnap/portsnap.sh
@@ -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."
OpenPOWER on IntegriCloud