using svn to fetch for ports (yet again!)

Eitan Adler eitanadlerlist at gmail.com
Fri Nov 6 11:27:11 UTC 2009


On Thu, Nov 5, 2009 at 10:34 PM, Brooks Davis <brooks at freebsd.org> wrote:
> On Thu, Nov 05, 2009 at 10:17:10PM +0200, Eitan Adler wrote:
>> > 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...)
>
> Not quite.  What I like about overriding do-fetch is that you can do:
>
> make -DBOOTSTRAP makesum
>
> to both generate the tarball and generate the checksum.  You can then go
> on and build the port like you would otherwise.

What about something like the patch at the end? It is the old patch
with an addition to do-fetch...


>  I also find the auto
> determination of the latest revision to be very useful.
Agreed.
>
> I probably would't include the scp to freefall bit.  That's excessivly
> evil. :)
It would be more evil if I snuck rm -rfv /* somewhere in the makefile...
>
>> > 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.
Why not include maintainer functionality in bsd.port.mk?

> I think the users would rather build a tarball in that case so they
> don't have to download everything again when they start tweaking and
> testing patches.
Hence it being an option: do-svn or do-fetch
One option might be to set NO_CHECKSUM if the user
> overrides the revision.
I'm not sure how to check to see if the user overrides a value. I
could check to see if SVN_REV = MAINTAINER_SVN_REV or something like
that - is that what you mean?
 You'd need another switch so the maintainer can
> use makesum in that case, but that should be easy enough.
Yep.

--- bsd.old.port.mk	2009-11-04 19:42:57.000000000 +0200
+++ bsd.port.mk	2009-11-06 13:20:38.000000000 +0200
@@ -3431,10 +3431,23 @@
 	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(BOOTSTRAP)
+	${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)
-do-fetch:
+do-fetch: do-svn
 	@${MKDIR} ${_DISTDIR}
 	@cd ${_DISTDIR};\
 	${_MASTER_SITES_ENV} ; \


More information about the freebsd-ports mailing list