using svn to fetch for ports (yet again!)

Eitan Adler eitanadlerlist at gmail.com
Wed Nov 4 18:23:24 UTC 2009


I have a small patch to bsd.port.mk which would allow a port to
replace its do-fetch with a svn export of a /specific revision/ of a
remote repo.

I know there have been some attempts at trying this before and from
what I've been reading I addressed some of the major concerns:
1) Past attempts didn't include a basic implementation.
2) Past attempts didn't allow for a specific revision number and thus
possibly causing security issues
3) Subversion does not have to be part of the base system for my patch to work

Allowing the port to fetch from svn is beneficial for a number of
reasons some of which are listed below
1) Many project's only or main means of distribution is svn (I'm
thinking of mplayer)
2) It is easier for the port maintainer to update the port
3) It is easy for a user to quickly switch versions (outside of the
ports system) without the need for lots o knowledge about the ports
system

Some of the problems:
1) Its harder if not impossible for freeBSD to mirror the port's
source (I'm sure I could easily code a svn-to-tarball script but who
knows if the svn build servers want svn)
2) Many users may want the program they are installing but not svn
3) What about SCM's other than svn?

--- bsd.old.port.mk	2009-11-04 19:42:57.000000000 +0200
+++ bsd.port.mk	2009-11-04 19:59:10.000000000 +0200
@@ -1694,6 +1694,10 @@
 MANCOMPRESSED?=	no
 .endif

This is a patch to bsd.port.mk which adds support for SVN_REV and SVN_FETCH
+.if defined(SVN_FETCH)
+FETCH_DEPENDS+= svn:${PORTSDIR}/devel/subversion
+.endif
+
 .if defined(PATCHFILES)
 .if ${PATCHFILES:M*.zip}x != x
 PATCH_DEPENDS+=		unzip:${PORTSDIR}/archivers/unzip
@@ -3435,6 +3439,10 @@

 .if !target(do-fetch)
 do-fetch:
+.if defined(SVN_FETCH)
+	${MKDIR} ${WRKDIR}
+	svn export -r ${SVN_REV} ${SVN_PATH} ${WRKSRC}
+.else
 	@${MKDIR} ${_DISTDIR}
 	@cd ${_DISTDIR};\
 	${_MASTER_SITES_ENV} ; \
@@ -3503,7 +3511,9 @@
 			${ECHO_MSG} "=> port manually into ${_DISTDIR} and try again."; \
 			exit 1; \
 	    fi; \
-	 done
+	done
+.endif
+
 .if defined(PATCHFILES)
 	@cd ${_DISTDIR};\
 	${_PATCH_SITES_ENV} ; \


More information about the freebsd-ports mailing list