using svn to fetch for ports (yet again!)

Eitan Adler eitanadlerlist at gmail.com
Thu Nov 5 20:17:33 UTC 2009


> I'd much rather see this used as something that reduced the amount of
> code required for maintainers to build tarballs from SVN.  For example
> something similar in spirit to what I've done in devel/llvm-devel.  That
> means mirroring or otherwise transfering the source around is possible.
Would a patch like the one below be what you are looking for?
(Note that I didn't test this patch that much...)

> There will likely be some objections to putting maintainer functionality
> in bsd.port.mk, but I think it would be useful enough in this case.
> Alternativly we could formalize the process a bit and put something
> Tools/scripts.

While I have no trouble writing a script to perform these tasks this
is something that I'd like to see available to end users.
I think it would useful to allow users to do something like
SVN_REV=1436 make install clean
and thus fetch from svn and install newer/older versions.

--- bsd.old.port.mk	2009-11-04 19:42:57.000000000 +0200
+++ bsd.port.mk	2009-11-05 22:11:51.000000000 +0200
@@ -3431,6 +3431,19 @@
 	DIR=${DIST_SUBDIR}; ${AWK} -v alg=$$alg -v file=$${DIR:+$$DIR/}$${file}	\
 		'$$1 == alg && $$2 == "(" file ")" {print $$4}' ${MD5_FILE}

+# SVN
+
+#vars to set
+# SVN_REV SVN_PATH SVN_USER
+do-svn:
+.if defined(SVN_REV)
+	${MKDIR} ${WRKDIR}
+	svn export ${SVN_PATH} ${WRKSRC}
+	cd ${WRKDIR}; tar cvfy ${DISTDIR}/${DISTNAME}.tar.bz2 ${DISTNAME}
+.if ${USER} == ${SVN_USER}
+	scp ${DISTDIR}/${DISTNAME}.tar.bz2 freefall.freebsd.org:public_distfiles/
+.endif #are we the right user
+.endif #is svn_rev defined
 # Fetch

 .if !target(do-fetch)


More information about the freebsd-ports mailing list