Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2005 18:16:23 +0100
From:      Roman Neuhauser <neuhauser@chello.cz>
To:        freebsd-ports <freebsd-ports@freebsd.org>
Cc:        lev@freebsd.org
Subject:   [PATCH] devel/subversion repository target, fsfs support
Message-ID:  <20050218171623.GB4579@isis.wad.cz>

next in thread | raw e-mail | index | archive | help

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Oops, I did it again. This time, the patch *is* attached.

The attached patch devel/subversion/Makefile adds a "repository" target
and support for fsfs repositories.

If you use the -DWITH_REPOSITORY_CREATION functionality of
devel/subversion but have been missing a possibility of having the
repository created at will as opposed at just the install time, look no
further. :)

I'm not submitting this as a PR yet because I can only test fsfs
repository creation with -DWITH_SVNSERVE_WRAPPER, so please, try it
out if you access subversion through apache/dav or some other funky way.

Also, I would be very thankful if someone who uses the wrapper with
a bdb repository could confirm that everything works with a repository
created with the patch applied (look for the usual commits stuck because
of wrong permissions on files or directories).

Changes:

- SVNFSTYPE variable affects the type of repository that gets created,
  defaults to "fsfs"
- the repository target allows for repository creation at any moment
- db/fs-type and db/uuid are excluded from chgrp/chmod like db/DB_CONFIG

-- 
If you cc me or remove the list(s) completely I'll most likely ignore
your message.    see http://www.eyrie.org./~eagle/faqs/questions.html

--9amGYk9869ThD9tj
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename="devel::subversion.repository,1.patch"

Index: devel/subversion/Makefile
===================================================================
RCS file: /home/ncvs/ports/devel/subversion/Makefile,v
retrieving revision 1.74
diff -u -r1.74 Makefile
--- devel/subversion/Makefile	3 Feb 2005 20:21:53 -0000	1.74
+++ devel/subversion/Makefile	18 Feb 2005 15:58:40 -0000
@@ -6,6 +6,7 @@
 
 PORTNAME=	subversion
 PORTVERSION=	1.1.3
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://subversion.tigris.org/tarballs/
 
@@ -43,6 +44,11 @@
 .include <bsd.port.pre.mk>
 
 SVNREPOS?=	/home/svn/repos
+SVNFSTYPE?=	fsfs
+
+.if defined(WITH_REPOSITORY_CREATION)
+MKREPOS_TARGET=	_mkrepos
+.endif
 
 .if defined(WITH_MAINTAINER_DEBUG)
 CONFIGURE_ARGS+=--enable-maintainer-mode \
@@ -318,7 +324,7 @@
 	${APXS} -e -S LIBEXECDIR=${PREFIX}/libexec/apache2 -a -n dav libexec/apache2/mod_dav.so
 .endif
 
-post-install:
+post-install:	${MKREPOS_TARGET}
 	@${MKDIR} ${PREFIX}/share/subversion
 	cd ${WRKSRC}/tools ; \
 	  tar --exclude '*.in' -cf - * | tar -C ${PREFIX}/share/subversion -xf -
@@ -350,7 +356,14 @@
 .if defined(WITH_SVNSERVE_WRAPPER)
 	@${INSTALL_SCRIPT} ${FILESDIR}/svnserve.wrapper ${PREFIX}/bin/svnserve
 .endif
-.if defined(WITH_REPOSITORY_CREATION) && !exists(${SVNREPOS})
+
+repository:	_mkrepos
+
+_SVNGRPFILES=	dav db locks locks/db.lock locks/db-logs.lock
+SVNGRPFILES=	${_SVNGRPFILES:S,^,${SVNREPOS}/,}
+
+_mkrepos:	.USE
+.if !exists(${SVNREPOS})
 . if defined(WITH_SVNSERVE_WRAPPER)
 	@if /usr/sbin/pw groupshow "${SVNGROUP}" >/dev/null 2>&1; then \
 	    ${ECHO_MSG} "You already have a group \"${SVNGROUP}\", so I will use it."; \
@@ -366,18 +379,20 @@
 	fi
 . endif
 	@${MKDIR} ${SVNREPOS}
-	@${PREFIX}/bin/svnadmin create ${SVNREPOS}
-	@${CHGRP} ${SVNGROUP} ${SVNREPOS}/db ${SVNREPOS}/locks/db.lock ${SVNREPOS}/dav
-	@${CHMOD} g+w ${SVNREPOS}/db ${SVNREPOS}/locks/db.lock ${SVNREPOS}/dav
+	@${PREFIX}/bin/svnadmin create --fs-type ${SVNFSTYPE} ${SVNREPOS}
+. if defined(WITH_SVNSERVE_WRAPPER)
+	@${CHGRP} ${SVNGROUP} ${SVNGRPFILES}
+	@${CHMOD} g+w ${SVNGRPFILES}
 	@for i in ${SVNREPOS}/db/* ; do \
 	    i=$${i##*/}; \
 	    case $$i in \
-	    DB_CONFIG) ;; \
-	    *) ${CHGRP} ${SVNGROUP} ${SVNREPOS}/db/$$i; \
-	       ${CHMOD} g+w ${SVNREPOS}/db/$$i; \
+	    DB_CONFIG|fs-type|uuid) ;; \
+	    *) ${CHGRP} -R ${SVNGROUP} ${SVNREPOS}/db/$$i; \
+	       ${CHMOD} -R g+w ${SVNREPOS}/db/$$i; \
 	       ;; \
 	    esac; \
 	done
+. endif
 .endif
 
 post-deinstall:

--9amGYk9869ThD9tj--



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