summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2005-08-11 13:48:13 +0000
committercperciva <cperciva@FreeBSD.org>2005-08-11 13:48:13 +0000
commit73e9556645f264582028ff60ba4c0ecdfa700a5e (patch)
tree08954aca878cc9e13e3a780d2f7e1ae1511ea8ac
parent1bf9bda084ba859061fd11034042dabf1f69c122 (diff)
downloadFreeBSD-src-73e9556645f264582028ff60ba4c0ecdfa700a5e.zip
FreeBSD-src-73e9556645f264582028ff60ba4c0ecdfa700a5e.tar.gz
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
-rw-r--r--usr.sbin/portsnap/portsnap/portsnap.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh
index 2b48385..7ff1f6b 100644
--- a/usr.sbin/portsnap/portsnap/portsnap.sh
+++ b/usr.sbin/portsnap/portsnap/portsnap.sh
@@ -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
OpenPOWER on IntegriCloud