Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 2009 20:23:02 +0200
From:      Eitan Adler <eitanadlerlist@gmail.com>
To:        ports@freebsd.org
Subject:   using svn to fetch for ports (yet again!)
Message-ID:  <a0777e080911041023n24da042u4263375ced487fb8@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
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} ; \



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