Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Nov 2006 18:43:21 +0100
From:      Erwin Lansing <erwin@FreeBSD.org>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/105835: Use portsnap by default for 'make update'
Message-ID:  <20061129174321.GT97805@droso.net>
In-Reply-To: <200611242148.kAOLm2Ij019695@freefall.freebsd.org>
References:  <200611242148.kAOLm2Ij019695@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
MFp4:
Be a bit more userfriendly now portsnap is used by default.
Test that portsnap has created PORTSDIR to make sure that an
unsuspecting user doesn't need to fetch 45Mb only to be told
afterwards that portsnap can't run anyway. Print a helpful
text instead to tell the user to run 'portsnap fetch extract'
by hand or use another way to update.

New diff against cvs:

--- /usr/ports/Makefile	Sat Feb 11 03:26:30 2006
+++ Makefile	Wed Nov 29 18:39:18 2006
@@ -146,13 +146,7 @@
 SUPFLAGS+=	-h ${SUPHOST}
 .endif
 update:
-.if defined(PORTSNAP_UPDATE)
-	@echo "--------------------------------------------------------------"
-	@echo ">>> Running ${PORTSNAP}"
-	@echo "--------------------------------------------------------------"
-	@${PORTSNAP} ${PORTSNAP_FLAGS} fetch
-	@${PORTSNAP} ${PORTSNAP_FLAGS} update
-.elif defined(SUP_UPDATE) && defined(PORTSSUPFILE)
+.if defined(SUP_UPDATE) && defined(PORTSSUPFILE)
 	@echo "--------------------------------------------------------------"
 	@echo ">>> Running ${SUP}"
 	@echo "--------------------------------------------------------------"
@@ -166,5 +160,17 @@
 	@${ECHO_MSG} "Error: Please define PORTSSUPFILE before doing make update."
 	@exit 1
 .else
-	@${ECHO_MSG} "Error: Please define either PORTSNAP_UPDATE, SUP_UPDATE, or CVS_UPDATE first."
+	@echo "--------------------------------------------------------------"
+	@echo ">>> Running ${PORTSNAP}"
+	@echo "--------------------------------------------------------------"
+.if !exists(${PORTSDIR}/.portsnap.INDEX)
+	@echo "Error: 'make update' uses portsnap(8) by default and"
+	@echo "needs ${PORTSDIR} to be created by portsnap on its first run."
+	@echo "Please run 'portsnap fetch extract' first."
+	@echo "You can also define SUP_UPDATE and PORTSSUPFILE to use csup(1)"
+	@echo "or CVS_UPDATE to use cvs(1) for updating."
+.else
+	@${PORTSNAP} ${PORTSNAP_FLAGS} fetch
+	@${PORTSNAP} ${PORTSNAP_FLAGS} update
+.endif
 .endif




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20061129174321.GT97805>