If the ports tree is already up to date when we run portsnap update,

exit early; this avoids spending five seconds rebuilding the INDEX
files.

Requested by:	somebody on IRC, but I can't remember who
This commit is contained in:
Colin Percival 2005-08-11 13:48:13 +00:00
parent 2273bbfd7a
commit 8573cb38b6

View File

@ -803,6 +803,11 @@ update_run() {
return 0
fi
if sort ${WORKDIR}/INDEX | cmp ${PORTSDIR}/.portsnap.INDEX -; then
echo "Ports tree is already up to date."
return 0
fi
echo -n "Removing old files and directories... "
sort ${WORKDIR}/INDEX | comm -23 ${PORTSDIR}/.portsnap.INDEX - |
cut -f 1 -d '|' | lam -s "${PORTSDIR}/" - | xargs rm -rf