Mercurial > hg > portage
changeset 87:e948db201a1e
bump subversion and mercurial
author | holger@hoho.dyndns.org |
---|---|
date | Sat, 27 Dec 2008 15:06:29 +0100 |
parents | bcd9c6ae2107 |
children | 7c953ae90177 |
files | dev-util/mercurial/Manifest dev-util/mercurial/files/70mercurial-gentoo.el dev-util/mercurial/mercurial-1.1.1.ebuild dev-util/mercurial/metadata.xml dev-util/subversion/Manifest dev-util/subversion/files/1.5.0/70svn-gentoo.el dev-util/subversion/files/1.5.0/80subversion-extras dev-util/subversion/files/1.5.0/disable-unneeded-linking.patch dev-util/subversion/files/70svn-gentoo.el dev-util/subversion/files/svnserve.confd dev-util/subversion/files/svnserve.confd2 dev-util/subversion/files/svnserve.initd dev-util/subversion/files/svnserve.xinetd dev-util/subversion/files/vc-svn.el dev-util/subversion/metadata.xml dev-util/subversion/subversion-1.5.5.ebuild |
diffstat | 16 files changed, 1166 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/mercurial/Manifest Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,4 @@ +AUX 70mercurial-gentoo.el 76 RMD160 1891ab510adb464211b4cc35c5b6e4b149da79fa SHA1 72eb35d2bf86fa8f806acfbc823b88fc5188741b SHA256 c215746e4a5375569808c6aa6ddabe08e82d33d744128179be3142d9cd53a5ab +DIST mercurial-1.1.1.tar.gz 950399 RMD160 ed4db64c2a45c030c3a949c51c1c468511eb3540 SHA1 42a26a29414dee2c8eb7ce32e4fc6fe447bccc0a SHA256 bd4d64b1e41427dd21da9d7fd355607e72ecbb761c98fa89facaaf03a12f1af1 +EBUILD mercurial-1.1.1.ebuild 3226 RMD160 743d444c471c607972c0cedb0da2599574b6672a SHA1 a29c432f1335a05cdf26aba60ccbb62e17540f5f SHA256 0f1b83d61da1f559d97d934c7c21601015cb8a622ece49344af3bc0294cca507 +MISC metadata.xml 645 RMD160 2a33b3987960796da78558e671c4e5e0c6f10241 SHA1 6cd04e19dc7796b53afe98a9831e128c4c96f3ca SHA256 e0b05e42345698eda32c513e3a8f14d8bf42d5344dcd804b1f2234da327524e2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/mercurial/files/70mercurial-gentoo.el Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,3 @@ +;;; mercurial site-lisp configuration + +(add-to-list 'load-path "@SITELISP@") \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/mercurial/mercurial-1.1.1.ebuild Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,118 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-util/mercurial/mercurial-1.0.2.ebuild,v 1.7 2008/10/17 08:04:41 aballier Exp $ + +inherit bash-completion elisp-common flag-o-matic eutils distutils + +DESCRIPTION="Scalable distributed SCM" +HOMEPAGE="http://www.selenic.com/mercurial/" +SRC_URI="http://www.selenic.com/mercurial/release/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 ~hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd" +IUSE="bugzilla emacs gpg test zsh-completion" + +CDEPEND=">=dev-lang/python-2.3" +RDEPEND="${CDEPEND} + bugzilla? ( dev-python/mysql-python ) + gpg? ( app-crypt/gnupg ) + zsh-completion? ( app-shells/zsh )" +DEPEND="${CDEPEND} + emacs? ( virtual/emacs ) + test? ( app-arch/unzip + dev-python/pygments )" + +PYTHON_MODNAME="${PN} hgext" +SITEFILE="70${PN}-gentoo.el" + +src_compile() { + filter-flags -ftracer -ftree-vectorize + + distutils_src_compile + + if use emacs; then + cd "${S}"/contrib + elisp-compile mercurial.el || die "elisp-compile failed!" + fi + + rm -rf contrib/{win32,macosx} +} + +src_install() { + distutils_src_install + + dobashcompletion contrib/bash_completion ${PN} + + if use zsh-completion ; then + insinto /usr/share/zsh/site-functions + newins contrib/zsh_completion _hg + fi + + rm -f doc/*.?.txt + dodoc CONTRIBUTORS PKG-INFO README doc/*.txt + cp hgweb*.cgi "${D}"/usr/share/doc/${PF}/ + + dobin contrib/hgk + dobin contrib/hg-relink + dobin contrib/hg-ssh + + rm -f contrib/hgk contrib/hg-relink contrib/hg-ssh + + rm -f contrib/bash_completion + cp -r contrib "${D}"/usr/share/doc/${PF}/ + doman doc/*.? + + cat > "${T}/80mercurial" <<-EOF +HG=/usr/bin/hg +EOF + doenvd "${T}/80mercurial" + + if use emacs; then + elisp-install ${PN} contrib/mercurial.el* || die "elisp-install failed!" + elisp-site-file-install "${FILESDIR}"/${SITEFILE} + fi +} + +src_test() { + local testdir="${T}/tests" + mkdir -p -m1777 "${testdir}" || die + cd "${S}/tests/" + rm -f *svn* # Subversion tests fail with 1.5 + rm -f test-convert-baz* # GNU Arch baz + rm -f test-convert-cvs* # CVS + rm -f test-convert-darcs* # Darcs + rm -f test-convert-git* # git + rm -f test-convert-mtn* # monotone + rm -f test-convert-tla* # GNU Arch tla + rm -f test-doctest* # doctest always fails with python 2.5.x + if ! has userpriv ${FEATURES}; then + einfo "Removing tests which require user privileges to succeed" + rm -f test-command-template # Test is broken when run as root + rm -f test-convert # Test is broken when run as root + rm -f test-lock-badness # Test is broken when run as root + rm -f test-permissions # Test is broken when run as root + rm -f test-pull-permission # Test is broken when run as root + fi + einfo "Running Mercurial tests ..." + python run-tests.py --tmpdir="${testdir}" || die "test failed" +} + +pkg_postinst() { + distutils_pkg_postinst + use emacs && elisp-site-regen + bash-completion_pkg_postinst + + elog "If you want to convert repositories from other tools using convert" + elog "extension please install correct tool:" + elog " dev-util/cvs" + elog " dev-util/darcs" + elog " dev-util/git" + elog " dev-util/monotone" + elog " dev-util/subversion" +} + +pkg_postrm() { + distutils_pkg_postrm + use emacs && elisp-site-regen +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/mercurial/metadata.xml Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>no-herd</herd> + <maintainer> + <email>nelchael@gentoo.org</email> + <name>Krzysiek Pawlik</name> + </maintainer> + <use> + <flag name="bugzilla">Support bugzilla integration.</flag> + <flag name="darcs">Support conversion of Darcs repositories to Mercurial.</flag> + <flag name="git">Support conversion of Git repositories to Mercurial.</flag> + <flag name="gpg">Support signing with GnuPG.</flag> + <flag name="zsh-completion">Install zsh command completion for hg.</flag> + </use> +</pkgmetadata>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/Manifest Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,12 @@ +AUX 1.5.0/70svn-gentoo.el 435 RMD160 e9f4b2e5511523c124f9ba3781249db2860fe5a7 SHA1 c3a3081f79a579b848369cfae76662a98e97687e SHA256 a39bea9a821aa91c7990dd07e1c2d0cec79f1efaac04e2d61882b7c8d5346a34 +AUX 1.5.0/80subversion-extras 62 RMD160 c334b15a86eaf19129afa5b62558dd47504a4e3d SHA1 ba05e978e7ff7b047ec99225e4d932036c340d26 SHA256 758d07cf161fff5e0afef5791dca641d3af58192ad1e4874c5f5c2c285c1149d +AUX 1.5.0/disable-unneeded-linking.patch 2409 RMD160 0d7c34cc83eff7d08369128762ed714fabcd1dde SHA1 92b80f6cb30fe569f79368aea66027a6da022c53 SHA256 2ef8fcd9fabfd1a71bdd50e1156cb9d421a7008fccd73b7ae3536e9a30886231 +AUX 70svn-gentoo.el 331 RMD160 1de1310ae7e4bdbecef3c685ef8d7ff95b9aab87 SHA1 48eb99e9d494a4a674de32e599914df234b627cd SHA256 c0d733bd3f7c75c47acaea4fd0c816d45ee2cd765da70dc494666f38c91e3d87 +AUX svnserve.confd 323 RMD160 cbf4d810d9f41bac1611004741170d1047cbeef0 SHA1 39e922bc777ba847eb85d421d92f560f84b895b5 SHA256 90d3e2532715a6230ebf65023566a6591eed4b3fc12abbca0d2fb7949e146006 +AUX svnserve.confd2 320 RMD160 dc1e74d06d9bd3eeb1a8dfd20aacebecd8378abb SHA1 557191219c3afa90126b8a2bfe7dd62b8a09eb82 SHA256 c70655c073dc06f538c5acdbcd49e216f4be2c859ce395bdf78757a1eeccab00 +AUX svnserve.initd 817 RMD160 59f4e8e983d4595b7c27615889a9c0809d015a18 SHA1 483b47512fb444c0f752ad4eb6c3252f659a967e SHA256 6b483e211b5c311079605e246fca9228c7e5762d27a023fa4c4529fdaa766b08 +AUX svnserve.xinetd 332 RMD160 c2fc4eb02da7e7405756fce650b8897f0a9da7f7 SHA1 d7d478fc257a40626888f9b12ee218df55dac570 SHA256 267f30c78ef6428aeeb97d3c64c06b9acfba4bc624766fc3c6a6d2c4133799a2 +AUX vc-svn.el 16847 RMD160 8665b9a34c8fd9acae40e18aac33026aff3a39d7 SHA1 4d1a5a9331ff96e943244a6d5538e4f0abeac9e7 SHA256 b4979d5df9fba02dbc8ad71d813229222e95ee1e8e89dec3060611d2d6be87aa +DIST subversion-1.5.5.tar.bz2 4940482 RMD160 6400e387b3505180206b61729cb0b11baeae70d3 SHA1 61c9a7209ccef8eff3c0499629d62ed4d3c89988 SHA256 88cf24ba5d589351791709ff7556ababc019ec59f3240ac2087dacabb9ad77be +EBUILD subversion-1.5.5.ebuild 13393 RMD160 0ef259d6fc6440536d9fb74c1fc24ad08b8c1997 SHA1 13bb283d304eedc5e1e9937be804e41e4db48015 SHA256 17e47cc89d09b11c79a924b8765a90d2bb0944506e54ab434c4a2016aca95a66 +MISC metadata.xml 958 RMD160 9e4aa5a4dfeef1a81c20121e8e75baf45d0962ca SHA1 c8844225273473a569cefae106533215961c287f SHA256 396a72dd2fddb8fb146ce87fa05692ab9f7d183057c0940d9365f88602a03dc7
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/1.5.0/70svn-gentoo.el Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,12 @@ +;;; svn site-lisp configuration + +(add-to-list 'load-path "@SITELISP@") +(and (< emacs-major-version 22) + (add-to-list 'load-path "@SITELISP@/compat")) +(add-to-list 'vc-handled-backends 'SVN) + +(defalias 'svn-examine 'svn-status) +(autoload 'svn-status "dsvn" "Run `svn status'." t) +(autoload 'svn-update "dsvn" "Run `svn update'." t) +(autoload 'svn-status "psvn" + "Examine the status of Subversion working copy in directory DIR." t)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/1.5.0/80subversion-extras Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,2 @@ +ROOTPATH=/usr/lib/subversion/bin +PATH=/usr/lib/subversion/bin
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/1.5.0/disable-unneeded-linking.patch Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,81 @@ +--- configure.ac ++++ configure.ac +@@ -234,6 +234,8 @@ + AC_DEFINE_UNQUOTED(SVN_FS_WANT_DB_PATCH, $SVN_FS_WANT_DB_PATCH, + [The desired patch version for the Berkeley DB]) + ++AC_SUBST(SVN_DB_LIBS) ++ + SVN_LIB_SASL + + if test "$svn_lib_sasl" = "yes"; then +--- Makefile.in ++++ Makefile.in +@@ -40,9 +40,10 @@ + NEON_LIBS = @NEON_LIBS@ + SVN_APR_LIBS = @SVN_APR_LIBS@ + SVN_APRUTIL_LIBS = @SVN_APRUTIL_LIBS@ +-SVN_DB_LIBS = +-SVN_SERF_LIBS = @SVN_SERF_LIBS@ ++SVN_DB_LIBS = @SVN_DB_LIBS@ + SVN_SASL_LIBS = @SVN_SASL_LIBS@ ++SVN_SERF_LIBS = @SVN_SERF_LIBS@ ++SVN_XML_LIBS = -lexpat + SVN_ZLIB_LIBS = @SVN_ZLIB_LIBS@ + + LIBS = @LIBS@ +--- build/ac-macros/aprutil.m4 ++++ build/ac-macros/aprutil.m4 +@@ -72,16 +72,14 @@ + AC_MSG_ERROR([apu-config --includes failed]) + fi + +- dnl When APR stores the dependent libs in the .la file, we don't need +- dnl --libs. +- SVN_APRUTIL_LIBS="`$apu_config --link-libtool --libs`" ++ SVN_APRUTIL_LIBS="`$apu_config --link-libtool`" + if test $? -ne 0; then +- AC_MSG_ERROR([apu-config --link-libtool --libs failed]) ++ AC_MSG_ERROR([apu-config --link-libtool failed]) + fi + +- SVN_APRUTIL_EXPORT_LIBS="`$apu_config --link-ld --libs`" ++ SVN_APRUTIL_EXPORT_LIBS="`$apu_config --link-ld`" + if test $? -ne 0; then +- AC_MSG_ERROR([apu-config --link-ld --libs failed]) ++ AC_MSG_ERROR([apu-config --link-ld failed]) + fi + + AC_SUBST(SVN_APRUTIL_INCLUDES) +--- build/ac-macros/apr.m4 ++++ build/ac-macros/apr.m4 +@@ -74,16 +74,14 @@ + AC_MSG_ERROR([apr-config --prefix failed]) + fi + +- dnl When APR stores the dependent libs in the .la file, we don't need +- dnl --libs. +- SVN_APR_LIBS="`$apr_config --link-libtool --libs`" ++ SVN_APR_LIBS="`$apr_config --link-libtool`" + if test $? -ne 0; then +- AC_MSG_ERROR([apr-config --link-libtool --libs failed]) ++ AC_MSG_ERROR([apr-config --link-libtool failed]) + fi + +- SVN_APR_EXPORT_LIBS="`$apr_config --link-ld --libs`" ++ SVN_APR_EXPORT_LIBS="`$apr_config --link-ld`" + if test $? -ne 0; then +- AC_MSG_ERROR([apr-config --link-ld --libs failed]) ++ AC_MSG_ERROR([apr-config --link-ld failed]) + fi + + SVN_APR_SHLIB_PATH_VAR="`$apr_config --shlib-path-var`" +--- build/ac-macros/berkeley-db.m4 ++++ build/ac-macros/berkeley-db.m4 +@@ -218,5 +218,6 @@ + + CPPFLAGS="$svn_lib_berkeley_db_try_save_cppflags" + LIBS="$svn_lib_berkeley_db_try_save_libs" ++ SVN_DB_LIBS="$svn_apu_bdb_lib" + ] + )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/70svn-gentoo.el Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,10 @@ +;;; svn site-lisp configuration + +(add-to-list 'load-path "@SITELISP@") +(and (< emacs-major-version 22) + (add-to-list 'load-path "@SITELISP@/compat")) +(add-to-list 'vc-handled-backends 'SVN) + +(defalias 'svn-examine 'svn-status) +(autoload 'svn-status "psvn" + "Examine the status of Subversion working copy in directory DIR." t)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/svnserve.confd Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,10 @@ +# The commented variables in this file are the defaults that are used +# in the init-script. You don't need to uncomment them except to +# customize them to different values. + +# Options for svnserve +#SVNSERVE_OPTS="--root=/var/svn" + +# User and group as which to run svnserve +#SVNSERVE_USER="apache" +#SVNSERVE_GROUP="apache"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/svnserve.confd2 Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,10 @@ +# The commented variables in this file are the defaults that are used +# in the init-script. You don't need to uncomment them except to +# customize them to different values. + +# Options for svnserve +#SVNSERVE_OPTS="--root=/var/svn" + +# User and group as which to run svnserve +SVNSERVE_USER="svn" +SVNSERVE_GROUP="svnusers"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/svnserve.initd Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,26 @@ +#!/sbin/runscript +# Copyright 2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/dev-util/subversion/files/svnserve.initd,v 1.2 2005/08/25 13:59:48 pauldv Exp $ + +depend() { + need net +} + +start() { + ebegin "Starting svnserve" + # Ensure that we run from a readable working dir, and that we do not + # lock filesystems when being run from such a location. + cd / + start-stop-daemon --start --quiet --background --make-pidfile \ + --pidfile /var/run/svnserve.pid --exec /usr/bin/svnserve \ + --chuid ${SVNSERVE_USER:-apache}:${SVNSERVE_GROUP:-apache} -- \ + --foreground --daemon ${SVNSERVE_OPTS:---root=/var/svn} + eend $? +} + +stop() { + ebegin "Stopping svnserve" + start-stop-daemon --stop --quiet --pidfile /var/run/svnserve.pid + eend $? +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/svnserve.xinetd Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,14 @@ +service svn +{ + socket_type = stream + wait = no + user = apache + group = apache + umask = 002 + protocol = tcp + log_on_failure += USERID HOST + port = 3690 + server = /usr/bin/svnserve + server_args = -i + disable = yes +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/files/vc-svn.el Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,414 @@ +;;;; vc-svn.el --- a VC backend for Subversion +;;;; Jim Blandy <jimb@red-bean.com> --- July 2002 + +;;; Writing this back end has shown up some problems in VC: bugs, +;;; shortcomings in the back end interface, and so on. But I want to +;;; first produce code that Subversion users can use with an already +;;; released Emacs distribution. +;;; +;;; So for now we're working within the limitations of the released +;;; VC; once we've got something functional, then we can start writing +;;; VC patches. + + +;;; To make this file load on demand, put this file into a directory +;;; in `load-path', and add this line to a startup file: +;;; +;;; (add-to-list 'vc-handled-backends 'SVN) + + +;;; To do here: +;;; Provide more of the optional VC backend functions: +;;; - dir-state +;;; - merge across arbitrary revisions +;;; +;;; Maybe we want more info in mode-line-string. Status of props? Status +;;; compared to what's in the repository (svn st -u) ? +;;; +;;; VC passes the vc-svn-register function a COMMENT argument, which +;;; is like the file description in CVS and RCS. Could we store the +;;; COMMENT as a Subversion property? Would that show up in fancy DAV +;;; web folder displays, or would it just languish in obscurity, the +;;; way CVS and RCS descriptions do? +;;; +;;; After manual merging, need some way to run `svn resolved'. Perhaps +;;; we should just prompt for approval when somebody tries to commit a +;;; conflicted file? +;;; +;;; vc-svn ought to handle more gracefully an attempted commit that +;;; fails with "Transaction is out of date". Probably the best +;;; approach is to ask "file is not up-to-date; do you want to merge +;;; now?" I think vc-cvs does this. +;;; +;;; Perhaps show the "conflicted" marker in the modeline? +;;; +;;; If conflicted, before committing or merging, ask the user if they +;;; want to mark the file as resolved. +;;; +;;; Won't searching for strings in svn output cause trouble if the +;;; locale language is not English? +;;; +;;; After merging news, need to recheck our idea of which workfile +;;; version we have. Reverting the file does this but we need to +;;; force it. Note that this can be necessary even if the file has +;;; not changed. +;;; +;;; Does everything work properly if we're rolled back to an old +;;; revision? +;;; +;;; Perhaps need to implement vc-svn-latest-on-branch-p? + + +;;; To do in VC: +;;; +;;; Make sure vc's documentation for `workfile-unchanged-p' default +;;; function mentions that it must not run asynchronously, and the +;;; symptoms if it does. +;;; +;;; Fix logic for finding log entries. +;;; +;;; Allow historical diff to choose an appropriate default previous +;;; revision number. I think this entails moving vc-previous-revision +;;; et al into the back end. +;;; +;;; Should vc-BACKEND-checkout really have to set the workfile version +;;; itself? +;;; +;;; Fix smerge for svn conflict markers. +;;; +;;; We can have files which are not editable for reasons other than +;;; needing to be checked out. For example, they might be a read-only +;;; view of an old revision opened with [C-x v ~]. (See vc-merge) +;;; +;;; Would be nice if there was a way to mark a file as +;;; just-checked-out, aside from updating the checkout-time property +;;; which in theory is not to be changed by backends. + + +(add-to-list 'vc-handled-backends 'SVN) + +(defcustom vc-svn-program-name "svn" + "*Name of Subversion client program, for use by Emacs's VC package." + :type 'string + :group 'vc + :version "21.2.90.2") + +(defcustom vc-svn-diff-switches nil + "*A string or list of strings specifying extra switches for `svn diff' under VC." + :type '(repeat string) + :group 'vc + :version "21.2.90.2") + +(defun vc-svn-registered (file) + "Return true if FILE is registered under Subversion." + ;; First, a quick false positive test: is there a `.svn/entries' file? + (and (file-exists-p (expand-file-name ".svn/entries" + (file-name-directory file))) + (not (null (vc-svn-run-status file))))) + + +(put 'vc-svn-with-output-buffer 'lisp-indent-function 0) +(defmacro vc-svn-with-output-buffer (&rest body) + "Save excursion, switch to buffer ` *Subversion Output*', and erase it." + `(save-excursion + ;; Let's not delete this buffer when we're done --- leave + ;; it around for debugging. + (set-buffer (get-buffer-create " *Subversion Output*")) + (erase-buffer) + ,@body)) + + +(defun vc-svn-pop-up-error (&rest args) + "Pop up the Subversion output buffer, and raise an error with ARGS." + (pop-to-buffer " *Subversion Output*") + (goto-char (point-min)) + (shrink-window-if-larger-than-buffer) + (apply 'error args)) + + +(defun vc-svn-run-status (file &optional update) + "Run `svn status -v' on FILE, and return the result. +If optional arg UPDATE is true, pass the `-u' flag to check against +the repository, across the network. +See `vc-svn-parse-status' for a description of the result." + (vc-svn-with-output-buffer + + ;; We should call vc-do-command here, but Subversion exits with an + ;; error status if FILE isn't under its control, and we want to + ;; return that as nil, not display it to the user. We can tell + ;; vc-do-command to + + (let ((status (apply 'call-process vc-svn-program-name nil t nil + (append '("status" "-v") + (if update '("-u") '()) + (list file))))) + (goto-char (point-min)) + (if (not (equal 0 status)) ; not zerop; status can be a string + ;; If you ask for the status of a file that isn't even in a + ;; Subversion-controlled directory, then Subversion exits with + ;; this error. + (if (or (looking-at "\\(.*\n\\)*.*is not a working copy") + (looking-at "\\(.*\n\\)*.*is not a versioned resource") + (looking-at "\\(.*\n\\)*.*: No such file or directory")) + nil + ;; Other errors we should actually report to the user. + (vc-svn-pop-up-error + "Error running Subversion to check status of `%s'" + (file-name-nondirectory file))) + + ;; Otherwise, we've got valid status output in the buffer, so + ;; just parse that. + (vc-svn-parse-status))))) + + +(defun vc-svn-parse-status () + "Parse the output from `svn status -v' at point. +We return nil for a file not under Subversion's control, +or (STATE LOCAL CHANGED) for files that are, where: +STATE is the file's VC state (see the documentation for `vc-state'), +LOCAL is the base revision in the working copy, and +CHANGED is the last revision in which it was changed. +Both LOCAL and CHANGED are strings, not numbers. +If we passed `svn status' the `-u' flag, then CHANGED could be a later +revision than LOCAL. +If the file is newly added, LOCAL is \"0\" and CHANGED is nil." + (let ((state (vc-svn-parse-state-only))) + (cond + ((not state) nil) + ;; A newly added file has no revision. + ((looking-at "....\\s-+\\(\\*\\s-+\\)?[-0]\\s-+\\?") + (list state "0" nil)) + ((looking-at "....\\s-+\\(\\*\\s-+\\)?\\([0-9]+\\)\\s-+\\([0-9]+\\)") + (list state + (match-string 2) + (match-string 3))) + ((looking-at "^I +") nil) ;; An ignored file + ((looking-at " \\{40\\}") nil) ;; A file that is not in the wc nor svn? + (t (error "Couldn't parse output from `svn status -v'"))))) + + +(defun vc-svn-parse-state-only () + "Parse the output from `svn status -v' at point, and return a state. +The documentation for the function `vc-state' describes the possible values." + (cond + ;; Be careful --- some of the later clauses here could yield false + ;; positives, if the clauses preceding them didn't screen those + ;; out. Making a pattern more selective could break something. + + ;; nil The given file is not under version control, + ;; or does not exist. + ((looking-at "\\?\\|^$") nil) + + ;; 'needs-patch The file has not been edited by the + ;; user, but there is a more recent version + ;; on the current branch stored in the + ;; master file. + ((looking-at " ..\\s-+\\*") 'needs-patch) + + ;; 'up-to-date The working file is unmodified with + ;; respect to the latest version on the + ;; current branch, and not locked. + ;; + ;; This is also returned for files which do not + ;; exist, as will be the case when finding a + ;; new file in a svn-controlled directory. That + ;; case is handled in vc-svn-parse-status. + ((looking-at " ") 'up-to-date) + + ;; 'needs-merge The file has been edited by the user, + ;; and there is also a more recent version + ;; on the current branch stored in the + ;; master file. This state can only occur + ;; if locking is not used for the file. + ((looking-at "\\S-+\\s-+\\*") 'needs-merge) + + ;; 'edited The working file has been edited by the + ;; user. If locking is used for the file, + ;; this state means that the current + ;; version is locked by the calling user. + (t 'edited))) + + +;;; Is it really safe not to check for updates? I haven't seen any +;;; cases where failing to check causes a problem that is not caught +;;; in some other way. However, there *are* cases where checking +;;; needlessly causes network delay, such as C-x v v. The common case +;;; is for the commit to be OK; we can handle errors if they occur. -- mbp +(defun vc-svn-state (file) + "Return the current version control state of FILE. +For a list of possible return values, see `vc-state'. + +This function should do a full and reliable state computation; it is +usually called immediately after `C-x v v'. `vc-svn-state-heuristic' +provides a faster heuristic when visiting a file. + +For svn this does *not* check for updates in the repository, because +that needlessly slows down vc when the repository is remote. Instead, +we rely on Subversion to trap situations such as needing a merge +before commit." + (car (vc-svn-run-status file))) + + +(defun vc-svn-state-heuristic (file) + "Estimate the version control state of FILE at visiting time. +For a list of possible values, see the doc string of `vc-state'. +This is supposed to be considerably faster than `vc-svn-state'. It +just runs `svn status -v', without the `-u' flag, so it's a strictly +local operation." + (car (vc-svn-run-status file))) + + + +(defun vc-svn-workfile-version (file) + "Return the current workfile version of FILE." + (cadr (vc-svn-run-status file))) + + +(defun vc-svn-checkout-model (file) + 'implicit) + + +(defun vc-svn-register (file &optional rev comment) + "Register FILE with Subversion. +REV is an initial revision; Subversion ignores it. +COMMENT is an initial description of the file; currently this is ignored." + (vc-svn-with-output-buffer + (let ((status (call-process vc-svn-program-name nil t nil "add" file))) + (or (equal 0 status) ; not zerop; status can be a string + (vc-svn-pop-up-error "Error running Subversion to add `%s'" + (file-name-nondirectory file)))))) + + +(defun vc-svn-checkin (file rev comment) + (apply 'vc-do-command nil 0 vc-svn-program-name file + "commit" (if comment (list "-m" comment) '()))) + + +(defun vc-svn-checkout (file &optional editable rev destfile) + "Check out revision REV of FILE into the working area. +The EDITABLE argument must be non-nil, since Subversion doesn't +support locking. +If REV is non-nil, that is the revision to check out (default is +current workfile version). If REV is the empty string, that means to +check out the head of the trunk. For Subversion, that's equivalent to +passing nil. +If optional arg DESTFILE is given, it is an alternate filename to +write the contents to; we raise an error." + (unless editable + (error "VC asked Subversion to check out a read-only copy of file")) + (when destfile + (error "VC asked Subversion to check out a file under another name")) + (when (equal rev "") + (setq rev nil)) + (apply 'vc-do-command nil 0 vc-svn-program-name file + "update" (if rev (list "-r" rev) '())) + (vc-file-setprop file 'vc-workfile-version nil)) + + +(defun vc-svn-revert (file &optional contents-done) + "Revert FILE back to the current workfile version. +If optional arg CONTENTS-DONE is non-nil, then the contents of FILE +have already been reverted from a version backup, and this function +only needs to update the status of FILE within the backend. This +function ignores the CONTENTS-DONE argument." + (vc-do-command nil 0 vc-svn-program-name file "revert")) + + +(defun vc-svn-merge-news (file) + "Merge recent changes into FILE. + +This calls `svn update'. In the case of conflicts, Subversion puts +conflict markers into the file and leaves additional temporary files +containing the `ancestor', `mine', and `other' files. + +You may need to run `svn resolved' by hand once these conflicts have +been resolved. + +Returns a vc status, which is used to determine whether conflicts need +to be merged." + (prog1 + (vc-do-command nil 0 vc-svn-program-name file "update") + + ;; This file may not have changed in the revisions which were + ;; merged, which means that its mtime on disk will not have been + ;; updated. However, the workfile version may still have been + ;; updated, and we want that to be shown correctly in the + ;; modeline. + + ;; vc-cvs does something like this + (vc-file-setprop file 'vc-checkout-time 0) + (vc-file-setprop file 'vc-workfile-version + (vc-svn-workfile-version file)))) + + +(defun vc-svn-print-log (file) + "Insert the revision log of FILE into the *vc* buffer." + (vc-do-command nil 'async vc-svn-program-name file "log")) + + +(defun vc-svn-show-log-entry (version) + "Search the log entry for VERSION in the current buffer. +Make sure it is displayed in the buffer's window." + (when (re-search-forward (concat "^-+\n\\(rev\\) " + (regexp-quote version) + ":[^|]+|[^|]+| [0-9]+ lines?")) + (goto-char (match-beginning 1)) + (recenter 1))) + + +(defun vc-svn-diff (file &optional rev1 rev2) + "Insert the diff for FILE into the *vc-diff* buffer. +If REV1 and REV2 are non-nil, report differences from REV1 to REV2. +If REV1 is nil, use the current workfile version (as found in the +repository) as the older version; if REV2 is nil, use the current +workfile contents as the newer version. +This function returns a status of either 0 (no differences found), or +1 (either non-empty diff or the diff is run asynchronously)." + (let* ((diff-switches-list + ;; In Emacs 21.3.50 or so, the `vc-diff-switches-list' macro + ;; started requiring its symbol argument to be quoted. + (condition-case nil + (vc-diff-switches-list svn) + (void-variable (vc-diff-switches-list 'SVN)))) + (status (vc-svn-run-status file)) + (local (elt status 1)) + (changed (elt status 2)) + + ;; If rev1 is the default (the base revision) set it to nil. + ;; This is nice because it lets us recognize when the diff + ;; will run locally, and thus when we shouldn't bother to run + ;; it asynchronously. But it's also necessary, since a diff + ;; for vc-default-workfile-unchanged-p *must* run + ;; synchronously, or else you'll end up with two diffs in the + ;; *vc-diff* buffer. `vc-diff-workfile-unchanged-p' passes + ;; the base revision explicitly, but this kludge lets us + ;; recognize that we can run the diff synchronously anyway. + ;; Fragile, no? + (rev1 (if (and rev1 (not (equal rev1 local))) rev1)) + + (rev-switches-list + (cond + ;; Given base rev against given rev. + ((and rev1 rev2) (list "-r" (format "%s:%s" rev1 rev2))) + ;; Given base rev against working copy. + (rev1 (list "-r" rev1)) + ;; Working copy base against given rev. + (rev2 (list "-r" (format "%s:%s" local rev2))) + ;; Working copy base against working copy. + (t '()))) + + ;; Run diff asynchronously if we're going to have to go + ;; across the network. + (async (or rev1 rev2))) + + (let ((status (apply 'vc-do-command "*vc-diff*" (if async 'async 0) + vc-svn-program-name file + (append '("diff") rev-switches-list)))) + (if (or async (> (buffer-size (get-buffer "*vc-diff*")) 0)) + 1 0)))) + +(defun vc-svn-find-version (file rev buffer) + (vc-do-command buffer 0 vc-svn-program-name file + "cat" "-r" rev)) + +(provide 'vc-svn)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/metadata.xml Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>hollow@gentoo.org</email> + <name>Benedikt Böhm</name> + <description>Gentoo Subversion maintainer</description> + </maintainer> + <maintainer> + <email>Arfrever.FTA@GMail.Com</email> + <name>Arfrever Frehtes Taifersar Arahesis</name> + <description>Subversion upstream representative</description> + </maintainer> + <use> + <flag name="dso">Enable runtime module search</flag> + <flag name="extras">Install extras scripts (examples, tools, hooks)</flag> + <flag name="nowebdav">Disables WebDAV support via neon library</flag> + <flag name="svnserve">Install scripts for svnserve</flag> + <flag name="webdav-neon">Enable WebDAV support using <pkg>net-misc/neon</pkg></flag> + <flag name="webdav-serf">Enable WebDAV support using <pkg>net-libs/serf</pkg></flag> + </use> +</pkgmetadata>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dev-util/subversion/subversion-1.5.5.ebuild Sat Dec 27 15:06:29 2008 +0100 @@ -0,0 +1,412 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-util/subversion/subversion-1.5.4.ebuild,v 1.11 2008/12/07 12:13:48 vapier Exp $ + +EAPI="1" +WANT_AUTOMAKE="none" + +inherit autotools bash-completion confutils depend.apache elisp-common eutils flag-o-matic java-pkg-opt-2 libtool multilib perl-module python + +DESCRIPTION="Advanced version control system" +HOMEPAGE="http://subversion.tigris.org/" +SRC_URI="http://subversion.tigris.org/downloads/${P/_/-}.tar.bz2" + +LICENSE="Subversion" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd" +IUSE="apache2 berkdb debug doc +dso emacs extras java nls perl python ruby sasl vim-syntax +webdav-neon webdav-serf" +RESTRICT="test" + +CDEPEND=">=dev-libs/apr-1.2.8 + >=dev-libs/apr-util-1.2.8 + dev-libs/expat + sys-libs/zlib + berkdb? ( =sys-libs/db-4* ) + emacs? ( virtual/emacs ) + ruby? ( >=dev-lang/ruby-1.8.2 ) + sasl? ( dev-libs/cyrus-sasl ) + webdav-neon? ( >=net-misc/neon-0.28 ) + webdav-serf? ( net-libs/serf )" + +RDEPEND="${CDEPEND} + java? ( >=virtual/jre-1.5 ) + nls? ( virtual/libintl ) + perl? ( dev-perl/URI )" + +DEPEND="${CDEPEND} + doc? ( app-doc/doxygen ) + java? ( >=virtual/jdk-1.5 ) + nls? ( sys-devel/gettext )" + +want_apache + +S="${WORKDIR}"/${P/_/-} + +# Allow for custom repository locations. +# This can't be in pkg_setup because the variable needs to be available to +# pkg_config. +: ${SVN_REPOS_LOC:=/var/svn} + +pkg_setup() { + confutils_use_depend_built_with_all berkdb dev-libs/apr-util berkdb + java-pkg-opt-2_pkg_setup + + if ! use webdav-neon && ! use webdav-serf; then + ewarn + ewarn "WebDAV support is disabled. You need WebDAV to" + ewarn "access repositories through the HTTP protocol." + ewarn + ewarn "WebDAV support needs one of the following USE flags enabled:" + ewarn " webdav-neon webdav-serf" + ewarn + ewarn "You can do this by enabling one of these flags in /etc/portage/package.use:" + ewarn " =${CATEGORY}/${PF} webdav-neon webdav-serf" + ewarn + ebeep + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/1.5.0/disable-unneeded-linking.patch + + sed -i \ + -e "s/\(BUILD_RULES=.*\) bdb-test\(.*\)/\1\2/g" \ + -e "s/\(BUILD_RULES=.*\) test\(.*\)/\1\2/g" configure.ac + + sed -e 's:@bindir@/svn-contrib:@libdir@/subversion/bin:' \ + -e 's:@bindir@/svn-tools:@libdir@/subversion/bin:' \ + -i Makefile.in + + eautoconf + elibtoolize +} + +src_compile() { + local myconf + + if use python || use perl || use ruby; then + myconf="${myconf} --with-swig" + else + myconf="${myconf} --without-swig" + fi + + if use debug; then + append-cppflags -DSVN_DEBUG -DAP_DEBUG + fi + + append-flags -fno-strict-aliasing + + econf ${myconf} \ + $(use_with apache2 apxs "${APXS}") \ + $(use_with berkdb berkeley-db) \ + $(use_enable dso runtime-module-search) \ + $(use_enable java javahl) \ + $(use_with java jdk "${JAVA_HOME}") \ + $(use_enable nls) \ + $(use_with sasl) \ + $(use_with webdav-neon neon /usr) \ + $(use_with webdav-serf serf /usr) \ + --with-apr=/usr/bin/apr-1-config \ + --with-apr-util=/usr/bin/apu-1-config \ + --disable-experimental-libtool \ + --without-jikes \ + --without-junit \ + --disable-mod-activation + + emake local-all || die "Building of core Subversion failed" + + if use python; then + emake swig-py || die "Building of Subversion Python bindings failed" + fi + + if use perl; then + emake -j1 swig-pl || die "Building of Subversion Perl bindings failed" + fi + + if use ruby; then + emake swig-rb || die "Building of Subversion Ruby bindings failed" + fi + + if use java; then + make JAVAC_FLAGS="$(java-pkg_javac-args) -encoding iso8859-1" javahl \ + || die "Building of Subversion JavaHL library failed" + fi + + if use emacs; then + elisp-compile contrib/client-side/emacs/{dsvn,psvn,vc-svn}.el \ + doc/svn-doc.el doc/tools/svnbook.el \ + || die "Compilation of Emacs modules failed" + fi + + if use extras; then + emake contrib || die "Building of contrib failed" + emake tools || die "Building of tools failed" + fi + + if use doc; then + doxygen doc/doxygen.conf || die "Building of Subversion HTML documentation failed" + + if use java; then + emake doc-javahl || die "Building of Subversion JavaHL library HTML documentation failed" + fi + fi +} + +src_install() { + python_version + PYTHON_DIR=/usr/$(get_libdir)/python${PYVER} + + emake -j1 DESTDIR="${D}" local-install || die "Installation of core of Subversion failed" + + if use python; then + emake -j1 DESTDIR="${D}" DISTUTIL_PARAM="--prefix=${D}" LD_LIBRARY_PATH="-L${D}/usr/$(get_libdir)" install-swig-py \ + || die "Installation of Subversion Python bindings failed" + + # Move Python bindings. + dodir "${PYTHON_DIR}/site-packages" + mv "${D}"/usr/$(get_libdir)/svn-python/svn "${D}${PYTHON_DIR}/site-packages" + mv "${D}"/usr/$(get_libdir)/svn-python/libsvn "${D}${PYTHON_DIR}/site-packages" + rm -Rf "${D}"/usr/$(get_libdir)/svn-python + fi + + if use perl; then + emake -j1 DESTDIR="${D}" INSTALLDIRS="vendor" install-swig-pl || die "Installation of Subversion Perl bindings failed" + fixlocalpod + fi + + if use ruby; then + emake -j1 DESTDIR="${D}" install-swig-rb || die "Installation of Subversion Ruby bindings failed" + fi + + if use java; then + emake -j1 DESTDIR="${D}" install-javahl || die "Installation of Subversion JavaHL library failed" + java-pkg_regso "${D}"/usr/$(get_libdir)/libsvnjavahl*.so + java-pkg_dojar "${D}"/usr/$(get_libdir)/svn-javahl/svn-javahl.jar + rm -Rf "${D}"/usr/$(get_libdir)/svn-javahl/*.jar + fi + + # Install Apache module configuration. + if use apache2; then + dodir "${APACHE_MODULES_CONFDIR}" + cat <<EOF >"${D}/${APACHE_MODULES_CONFDIR}"/47_mod_dav_svn.conf +<IfDefine SVN> +LoadModule dav_svn_module modules/mod_dav_svn.so +<IfDefine SVN_AUTHZ> +LoadModule authz_svn_module modules/mod_authz_svn.so +</IfDefine> + +# Example configuration: +#<Location /svn/repos> +# DAV svn +# SVNPath ${SVN_REPOS_LOC}/repos +# AuthType Basic +# AuthName "Subversion repository" +# AuthUserFile ${SVN_REPOS_LOC}/conf/svnusers +# Require valid-user +#</Location> +</IfDefine> +EOF + fi + + # Install Bash Completion, bug 43179. + dobashcompletion tools/client-side/bash_completion subversion + rm -f tools/client-side/bash_completion + + # Install hot backup script, bug 54304. + newbin tools/backup/hot-backup.py svn-hot-backup + rm -fr tools/backup + + # Install svn_load_dirs.pl. + if use perl; then + newbin contrib/client-side/svn_load_dirs/svn_load_dirs.pl svn-load-dirs + fi + rm -f contrib/client-side/svn_load_dirs/svn_load_dirs.pl + + # Install svnserve init-script and xinet.d snippet, bug 43245. + newinitd "${FILESDIR}"/svnserve.initd svnserve + if use apache2; then + newconfd "${FILESDIR}"/svnserve.confd svnserve + else + newconfd "${FILESDIR}"/svnserve.confd2 svnserve + fi + insinto /etc/xinetd.d + newins "${FILESDIR}"/svnserve.xinetd svnserve + + # Install documentation. + dodoc CHANGES COMMITTERS README + dohtml www/hacking.html + dodoc tools/xslt/svnindex.{css,xsl} + rm -fr tools/xslt + + # Install Vim syntax files. + if use vim-syntax; then + insinto /usr/share/vim/vimfiles/syntax + doins contrib/client-side/vim/svn.vim + fi + rm -f contrib/client-side/vim/svn.vim + + # Install Emacs Lisps. + if use emacs; then + elisp-install ${PN} contrib/client-side/emacs/{dsvn,psvn}.{el,elc} \ + doc/svn-doc.{el,elc} doc/tools/svnbook.{el,elc} \ + || die "Installation of Emacs modules failed" + elisp-install ${PN}/compat contrib/client-side/emacs/vc-svn.{el,elc} \ + || die "Installation of Emacs modules failed" + touch "${D}${SITELISP}/${PN}/compat/.nosearch" + elisp-site-file-install "${FILESDIR}"/1.5.0/70svn-gentoo.el \ + || die "Installation of Emacs site-init file failed" + fi + rm -fr contrib/client-side/emacs + + # Install extra files. + if use extras; then + doenvd "${FILESDIR}"/1.5.0/80subversion-extras + + emake DESTDIR="${D}" install-contrib || die "Installation of contrib failed" + emake DESTDIR="${D}" install-tools || die "Installation of tools failed" + + find contrib tools '(' -name "*.bat" -o -name "*.in" -o -name ".libs" ')' -print0 | xargs -0 rm -fr + rm -fr contrib/client-side/{svn-push,svnmucc} + rm -fr tools/server-side/{svn-populate-node-origins-index,svnauthz-validate}* + rm -fr tools/{buildbot,dev,diff,po} + + insinto /usr/share/${PN} + doins -r contrib tools + fi + + if use doc; then + dohtml doc/doxygen/html/* + + insinto /usr/share/doc/${PF} + doins -r notes + ecompressdir /usr/share/doc/${PF}/notes + + if use java; then + java-pkg_dojavadoc doc/javadoc + fi + fi +} + +pkg_preinst() { + # Compare versions of Berkeley DB, bug 122877. + if use berkdb && [[ -f "${ROOT}usr/bin/svn" ]] ; then + OLD_BDB_VERSION="$(scanelf -nq "${ROOT}usr/$(get_libdir)/libsvn_subr-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")" + NEW_BDB_VERSION="$(scanelf -nq "${D}usr/$(get_libdir)/libsvn_subr-1.so.0" | grep -Eo "libdb-[[:digit:]]+\.[[:digit:]]+" | sed -e "s/libdb-\(.*\)/\1/")" + if [[ "${OLD_BDB_VERSION}" != "${NEW_BDB_VERSION}" ]] ; then + CHANGED_BDB_VERSION=1 + fi + fi +} + +pkg_postinst() { + use emacs && elisp-site-regen + use perl && perl-module_pkg_postinst + + elog "Subversion Server Notes" + elog "-----------------------" + elog + elog "If you intend to run a server, a repository needs to be created using" + elog "svnadmin (see man svnadmin) or the following command to create it in" + elog "${SVN_REPOS_LOC}:" + elog + elog " emerge --config =${CATEGORY}/${PF}" + elog + elog "Subversion has multiple server types, take your pick:" + elog + elog " - svnserve daemon: " + elog " 1. Edit /etc/conf.d/svnserve" + elog " 2. Fix the repository permissions (see \"Fixing the repository permissions\")" + elog " 3. Start daemon: /etc/init.d/svnserve start" + elog " 4. Make persistent: rc-update add svnserve default" + elog + elog " - svnserve via xinetd:" + elog " 1. Edit /etc/xinetd.d/svnserve (remove disable line)" + elog " 2. Fix the repository permissions (see \"Fixing the repository permissions\")" + elog " 3. Restart xinetd.d: /etc/init.d/xinetd restart" + elog + elog " - svn over ssh:" + elog " 1. Fix the repository permissions (see \"Fixing the repository permissions\")" + elog " Additionally run:" + elog " groupadd svnusers" + elog " chown -R root:svnusers ${SVN_REPOS_LOC}/repos" + elog " 2. Create an svnserve wrapper in /usr/local/bin to set the umask you" + elog " want, for example:" + elog " #!/bin/bash" + elog " . /etc/conf.d/svnserve" + elog " umask 007" + elog " exec /usr/bin/svnserve \${SVNSERVE_OPTS} \"\$@\"" + elog + + if use apache2; then + elog " - http-based server:" + elog " 1. Edit /etc/conf.d/apache2 to include both \"-D DAV\" and \"-D SVN\"" + elog " 2. Create an htpasswd file:" + elog " htpasswd2 -m -c ${SVN_REPOS_LOC}/conf/svnusers USERNAME" + elog " 3. Fix the repository permissions (see \"Fixing the repository permissions\")" + elog " 4. Restart Apache: /etc/init.d/apache2 restart" + elog + fi + + elog " Fixing the repository permissions:" + elog " chmod -Rf go-rwx ${SVN_REPOS_LOC}/conf" + elog " chmod -Rf g-w,o-rwx ${SVN_REPOS_LOC}/repos" + elog " chmod -Rf g+rw ${SVN_REPOS_LOC}/repos/db" + elog " chmod -Rf g+rw ${SVN_REPOS_LOC}/repos/locks" + elog + + elog "If you intend to use svn-hot-backup, you can specify the number of" + elog "backups to keep per repository by specifying an environment variable." + elog "If you want to keep e.g. 2 backups, do the following:" + elog "echo '# hot-backup: Keep that many repository backups around' > /etc/env.d/80subversion" + elog "echo 'SVN_HOTBACKUP_BACKUPS_NUMBER=2' >> /etc/env.d/80subversion" + elog + + if [[ -n "${CHANGED_BDB_VERSION}" ]] ; then + ewarn "You upgraded from an older version of Berkeley DB and may experience" + ewarn "problems with your repository. Run the following commands as root to fix it:" + ewarn " db4_recover -h ${SVN_REPOS_LOC}/repos" + ewarn " chown -Rf apache:apache ${SVN_REPOS_LOC}/repos" + fi +} + +pkg_postrm() { + use emacs && elisp-site-regen + use perl && perl-module_pkg_postrm +} + +pkg_config() { + if [[ ! -x "${ROOT}usr/bin/svnadmin" ]] ; then + die "You seem to only have built the Subversion client" + fi + + einfo ">>> Initializing the database in ${ROOT}${SVN_REPOS_LOC} ..." + if [[ -e "${ROOT}${SVN_REPOS_LOC}/repos" ]] ; then + echo "A Subversion repository already exists and I will not overwrite it." + echo "Delete \"${ROOT}${SVN_REPOS_LOC}/repos\" first if you're sure you want to have a clean version." + else + mkdir -p "${ROOT}${SVN_REPOS_LOC}/conf" + + einfo ">>> Populating repository directory ..." + # Create initial repository. + "${ROOT}usr/bin/svnadmin" create "${ROOT}${SVN_REPOS_LOC}/repos" + + einfo ">>> Setting repository permissions ..." + SVNSERVE_USER="$(. "${ROOT}etc/conf.d/svnserve" ; echo "${SVNSERVE_USER}")" + SVNSERVE_GROUP="$(. "${ROOT}etc/conf.d/svnserve" ; echo "${SVNSERVE_GROUP}")" + if use apache2 ; then + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="apache" + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="apache" + else + [[ -z "${SVNSERVE_USER}" ]] && SVNSERVE_USER="svn" + [[ -z "${SVNSERVE_GROUP}" ]] && SVNSERVE_GROUP="svnusers" + enewgroup "${SVNSERVE_GROUP}" + enewuser "${SVNSERVE_USER}" -1 -1 "${SVN_REPOS_LOC}" "${SVNSERVE_GROUP}" + fi + chown -Rf "${SVNSERVE_USER}:${SVNSERVE_GROUP}" "${ROOT}${SVN_REPOS_LOC}/repos" + chmod -Rf go-rwx "${ROOT}${SVN_REPOS_LOC}/conf" + chmod -Rf o-rwx "${ROOT}${SVN_REPOS_LOC}/repos" + fi +}