summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-06-22 18:17:21 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-06-22 18:17:21 +0000
commit47d3db7840d1667069e186dc29efb72bce35f931 (patch)
tree39ae5c8d75ff6be938f68205ab4f9cb7332fd99a /dev-vcs/subversion/files
parentAutomated update of use.local.desc (diff)
downloadgentoo-2-47d3db7840d1667069e186dc29efb72bce35f931.tar.gz
gentoo-2-47d3db7840d1667069e186dc29efb72bce35f931.tar.bz2
gentoo-2-47d3db7840d1667069e186dc29efb72bce35f931.zip
dev-util/subversion renamed to dev-vcs/subversion.
(Portage version: HEAD/cvs/Linux x86_64)
Diffstat (limited to 'dev-vcs/subversion/files')
-rw-r--r--dev-vcs/subversion/files/70svn-gentoo.el13
-rw-r--r--dev-vcs/subversion/files/subversion-1.6.0-disable_linking_against_unneeded_libraries.patch56
-rw-r--r--dev-vcs/subversion/files/subversion-1.6.2-local_library_preloading.patch165
-rw-r--r--dev-vcs/subversion/files/subversion-1.6.3-kwallet_window.patch298
-rw-r--r--dev-vcs/subversion/files/svnserve.confd10
-rw-r--r--dev-vcs/subversion/files/svnserve.initd26
-rw-r--r--dev-vcs/subversion/files/svnserve.xinetd14
-rw-r--r--dev-vcs/subversion/files/vc-svn.el414
8 files changed, 996 insertions, 0 deletions
diff --git a/dev-vcs/subversion/files/70svn-gentoo.el b/dev-vcs/subversion/files/70svn-gentoo.el
new file mode 100644
index 000000000000..e5721e2480c1
--- /dev/null
+++ b/dev-vcs/subversion/files/70svn-gentoo.el
@@ -0,0 +1,13 @@
+
+;;; subversion 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)
diff --git a/dev-vcs/subversion/files/subversion-1.6.0-disable_linking_against_unneeded_libraries.patch b/dev-vcs/subversion/files/subversion-1.6.0-disable_linking_against_unneeded_libraries.patch
new file mode 100644
index 000000000000..689b29cd7fc7
--- /dev/null
+++ b/dev-vcs/subversion/files/subversion-1.6.0-disable_linking_against_unneeded_libraries.patch
@@ -0,0 +1,56 @@
+--- Makefile.in
++++ Makefile.in
+@@ -47,6 +47,7 @@
+ SVN_SASL_LIBS = @SVN_SASL_LIBS@
+ SVN_SERF_LIBS = @SVN_SERF_LIBS@
+ SVN_SQLITE_LIBS = @SVN_SQLITE_LIBS@
++SVN_XML_LIBS = -lexpat
+ SVN_ZLIB_LIBS = @SVN_ZLIB_LIBS@
+
+ LIBS = @LIBS@
+--- build/ac-macros/aprutil.m4
++++ build/ac-macros/aprutil.m4
+@@ -77,16 +77,14 @@
+ AC_MSG_ERROR([apu-config --prefix 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`"
diff --git a/dev-vcs/subversion/files/subversion-1.6.2-local_library_preloading.patch b/dev-vcs/subversion/files/subversion-1.6.2-local_library_preloading.patch
new file mode 100644
index 000000000000..704b30026fb3
--- /dev/null
+++ b/dev-vcs/subversion/files/subversion-1.6.2-local_library_preloading.patch
@@ -0,0 +1,165 @@
+--- configure.ac
++++ configure.ac
+@@ -198,6 +198,24 @@
+
+ AC_SUBST(LT_LDFLAGS)
+
++AC_ARG_ENABLE(local-library-preloading,
++ AS_HELP_STRING([--disable-local-library-preloading],
++ [Disable preloading of locally built libraries in locally built executables]),
++ [
++ if test "$enableval" != "no"; then
++ TRANSFORM_LIBTOOL_SCRIPTS="transform-libtool-scripts"
++ else
++ TRANSFORM_LIBTOOL_SCRIPTS=""
++ fi
++ ], [
++ if test "`uname`" != "Darwin"; then
++ TRANSFORM_LIBTOOL_SCRIPTS="transform-libtool-scripts"
++ else
++ TRANSFORM_LIBTOOL_SCRIPTS=""
++ fi
++])
++AC_SUBST(TRANSFORM_LIBTOOL_SCRIPTS)
++
+ dnl Check if -no-undefined is needed for the platform.
+ dnl It should always work but with libtool 1.4.3 on OS X it breaks the build.
+ dnl So we only turn it on for platforms where we know we really need it.
+--- Makefile.in
++++ Makefile.in
+@@ -309,7 +309,10 @@
+
+ @INCLUDE_OUTPUTS@
+
+-local-all: @BUILD_RULES@
++local-all: @BUILD_RULES@ @TRANSFORM_LIBTOOL_SCRIPTS@
++
++transform-libtool-scripts: @BUILD_RULES@
++ @$(top_srcdir)/build/transform_libtool_scripts.sh
+
+ locale-gnu-pot:
+ cd $(abs_srcdir) && XGETTEXT="$(XGETTEXT)" MSGMERGE="$(MSGMERGE)" \
+--- build/transform_libtool_scripts.sh
++++ build/transform_libtool_scripts.sh
+@@ -0,0 +1,121 @@
++#!/bin/sh
++#
++#
++# Licensed to the Apache Software Foundation (ASF) under one
++# or more contributor license agreements. See the NOTICE file
++# distributed with this work for additional information
++# regarding copyright ownership. The ASF licenses this file
++# to you under the Apache License, Version 2.0 (the
++# "License"); you may not use this file except in compliance
++# with the License. You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing,
++# software distributed under the License is distributed on an
++# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++# KIND, either express or implied. See the License for the
++# specific language governing permissions and limitations
++# under the License.
++#
++#
++
++# Dependencies of libraries
++subr="subr"
++auth_gnome_keyring="auth_gnome_keyring $subr"
++auth_kwallet="auth_kwallet $subr"
++delta="delta $subr"
++diff="diff $subr"
++fs_util="fs_util $subr"
++fs_base="fs_base $delta $fs_util $subr"
++fs_fs="fs_fs $delta $fs_util $subr"
++fs="fs $fs_base $fs_fs $fs_util $subr"
++repos="repos $delta $fs $fs_util $subr"
++ra_local="ra_local $delta $fs $fs_util $repos $subr"
++ra_neon="ra_neon $delta $subr"
++ra_serf="ra_serf $delta $subr"
++ra_svn="ra_svn $delta $subr"
++ra="ra $delta $ra_local $ra_neon $ra_serf $ra_svn $subr"
++wc="wc $delta $diff $subr"
++client="client $delta $diff $ra $subr $wc"
++
++# Variable 'libraries' containing names of variables corresponding to libraries
++libraries="auth_gnome_keyring auth_kwallet client delta diff fs fs_base fs_fs fs_util ra ra_local ra_neon ra_serf ra_svn repos subr wc"
++
++for library in $libraries; do
++ # Delete duplicates in dependencies of libraries
++ library_dependencies="$(echo -n $(for x in $(eval echo "\$$library"); do echo $x; done | sort -u))"
++ eval "$library=\$library_dependencies"
++done
++
++# Dependencies of executables
++svn="$auth_gnome_keyring $auth_kwallet $client $delta $diff $ra $subr $wc"
++svnadmin="$delta $fs $repos $subr"
++svndumpfilter="$delta $fs $repos $subr"
++svnlook="$delta $diff $fs $repos $subr"
++svnserve="$delta $fs $ra_svn $repos $subr"
++svnsync="$auth_gnome_keyring $auth_kwallet $delta $ra $subr"
++svnversion="$subr $wc"
++entries_dump="$subr $wc"
++
++# Variable 'executables' containing names of variables corresponding to executables
++executables="svn svnadmin svndumpfilter svnlook svnserve svnsync svnversion entries_dump"
++
++for executable in $executables; do
++ # Set variables containing paths of executables
++ if [ "$executable" != entries_dump ]; then
++ eval "${executable}_path=subversion/$executable/$executable"
++ else
++ eval "${executable}_path=subversion/tests/cmdline/entries-dump"
++ fi
++ # Delete duplicates in dependencies of executables
++ executable_dependencies="$(echo -n $(for x in $(eval echo "\$$executable"); do echo $x; done | sort -u))"
++ eval "$executable=\$executable_dependencies"
++done
++
++test_paths="$(find subversion/tests -mindepth 2 -maxdepth 2 -name '*-test' ! -path '*/.libs/*' | sort)"
++for test in $test_paths; do
++ test_path="$test"
++ # Dependencies of tests are based on names of directories containing tests
++ test_library="$(echo $test | sed -e 's:^subversion/tests/libsvn_\([^/]*\)/.*:\1:')"
++ test_dependencies="$(eval echo "\$$test_library")"
++ # Set variables corresponding to tests and containing dependencies of tests
++ test="$(echo $test | sed -e 's:^subversion/tests/libsvn_[^/]*/\(.*\):\1:' -e 's/-/_/g')"
++ eval "$test=\$test_dependencies"
++ # Set variables containing paths of tests
++ eval "${test}_path=\$test_path"
++ # Set variable 'tests' containing names of variables corresponding to tests
++ tests="$tests $test"
++done
++
++# auth-test dynamically loads libsvn_auth_gnome_keyring and libsvn_auth_kwallet libraries
++auth_test="auth_gnome_keyring auth_kwallet $auth_test"
++
++# Usage: sed_append LINE_NUMBER TEXT FILE
++sed_append()
++{
++ sed -e "$1a\\
++$2" "$3" > "$3.new"
++ mv -f "$3.new" "$3"
++}
++
++current_directory="$(pwd)"
++for libtool_script in $executables $tests; do
++ eval "libtool_script_path=\$${libtool_script}_path"
++ libtool_script_libraries=""
++ if [ -f "$libtool_script_path" ]; then
++ if { grep LD_LIBRARY_PATH "$libtool_script_path" && ! grep LD_PRELOAD "$libtool_script_path"; } > /dev/null; then
++ echo "Transforming $libtool_script_path"
++ libtool_script_dependencies="$(eval echo "\$$libtool_script")"
++ for libtool_script_dependency in $libtool_script_dependencies; do
++ libtool_script_library="$current_directory/subversion/libsvn_$libtool_script_dependency/.libs/libsvn_$libtool_script_dependency-1.so"
++ [ -f "$libtool_script_library" ] && libtool_script_libraries="$libtool_script_libraries $libtool_script_library"
++ done
++ libtool_script_libraries="${libtool_script_libraries# *}"
++ # Append definitions of LD_PRELOAD to libtool scripts
++ sed_append 4 "LD_PRELOAD=\"$libtool_script_libraries\"" "$libtool_script_path"
++ sed_append 5 "export LD_PRELOAD" "$libtool_script_path"
++ chmod +x "$libtool_script_path"
++ fi
++ fi
++done
diff --git a/dev-vcs/subversion/files/subversion-1.6.3-kwallet_window.patch b/dev-vcs/subversion/files/subversion-1.6.3-kwallet_window.patch
new file mode 100644
index 000000000000..4bb9c09f0a4c
--- /dev/null
+++ b/dev-vcs/subversion/files/subversion-1.6.3-kwallet_window.patch
@@ -0,0 +1,298 @@
+https://svn.collab.net/viewvc/svn?view=revision&revision=38004
+https://svn.collab.net/viewvc/svn?view=revision&revision=38014
+https://svn.collab.net/viewvc/svn?view=revision&revision=38028
+https://svn.collab.net/viewvc/svn?view=revision&revision=38122
+
+--- subversion/libsvn_auth_kwallet/kwallet.cpp
++++ subversion/libsvn_auth_kwallet/kwallet.cpp
+@@ -22,6 +22,7 @@
+
+ /*** Includes. ***/
+
++#include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+
+@@ -30,6 +31,9 @@
+ #include "svn_auth.h"
+ #include "svn_config.h"
+ #include "svn_error.h"
++#include "svn_io.h"
++#include "svn_pools.h"
++#include "svn_string.h"
+ #include "svn_version.h"
+
+ #include "private/svn_auth_private.h"
+@@ -38,13 +42,20 @@
+
+ #include <dbus/dbus.h>
+ #include <QtCore/QCoreApplication>
++#include <QtCore/QList>
++#include <QtCore/QMap>
+ #include <QtCore/QString>
++#include <QtGui/QApplication>
++#include <QtGui/QX11Info>
+
+ #include <kaboutdata.h>
+ #include <kcmdlineargs.h>
+ #include <kcomponentdata.h>
+ #include <klocalizedstring.h>
+ #include <kwallet.h>
++#include <kwindowsystem.h>
++#include <netwm.h>
++#include <netwm_def.h>
+
+
+ /*-----------------------------------------------------------------------*/
+@@ -52,6 +63,28 @@
+ /*-----------------------------------------------------------------------*/
+
+
++#define INITIALIZE_APPLICATION \
++ if (apr_hash_get(parameters, \
++ "svn:auth:qapplication-safe", \
++ APR_HASH_KEY_STRING)) \
++ { \
++ QApplication *app; \
++ if (! qApp) \
++ { \
++ int argc = 1; \
++ app = new QApplication(argc, (char *[1]) {(char *) "svn"}); \
++ } \
++ } \
++ else \
++ { \
++ QCoreApplication *app; \
++ if (! qApp) \
++ { \
++ int argc = 1; \
++ app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"}); \
++ } \
++ }
++
+ static const char *
+ get_application_name(apr_hash_t *parameters,
+ apr_pool_t *pool)
+@@ -69,8 +102,7 @@
+ const char *svn_application_name;
+ if (svn_application_name_with_pid)
+ {
+- long pid = getpid();
+- svn_application_name = apr_psprintf(pool, "Subversion [%ld]", pid);
++ svn_application_name = apr_psprintf(pool, "Subversion [%ld]", long(getpid()));
+ }
+ else
+ {
+@@ -102,9 +134,108 @@
+ }
+ }
+
++static pid_t
++get_parent_pid(pid_t pid,
++ apr_pool_t *pool)
++{
++ pid_t parent_pid = 0;
++
++#ifdef __linux__
++ svn_stream_t *stat_file_stream;
++ svn_string_t *stat_file_string;
++ const char *preceeding_space, *following_space, *parent_pid_string;
++
++ const char *path = apr_psprintf(pool, "/proc/%ld/stat", long(pid));
++ svn_error_t *err = svn_stream_open_readonly(&stat_file_stream, path, pool, pool);
++ if (err == SVN_NO_ERROR)
++ {
++ err = svn_string_from_stream(&stat_file_string, stat_file_stream, pool, pool);
++ if (err == SVN_NO_ERROR)
++ {
++ if ((preceeding_space = strchr(stat_file_string->data, ' ')))
++ {
++ if ((preceeding_space = strchr(preceeding_space + 1, ' ')))
++ {
++ if ((preceeding_space = strchr(preceeding_space + 1, ' ')))
++ {
++ if ((following_space = strchr(preceeding_space + 1, ' ')))
++ {
++ parent_pid_string = apr_pstrndup(pool,
++ preceeding_space + 1,
++ following_space - preceeding_space);
++ parent_pid = atol(parent_pid_string);
++ }
++ }
++ }
++ }
++ }
++ }
++
++ if (err)
++ {
++ svn_error_clear(err);
++ }
++#endif
++
++ return parent_pid;
++}
++
++static WId
++get_wid(apr_hash_t *parameters,
++ apr_pool_t *pool)
++{
++ WId wid = 1;
++
++ if (apr_hash_get(parameters,
++ "svn:auth:qapplication-safe",
++ APR_HASH_KEY_STRING))
++ {
++ QMap<pid_t, WId> process_info_list;
++ QList<WId> windows(KWindowSystem::windows());
++ QList<WId>::const_iterator i;
++ for (i = windows.begin(); i != windows.end(); i++)
++ {
++ process_info_list[NETWinInfo(QX11Info::display(),
++ *i,
++ QX11Info::appRootWindow(),
++ NET::WMPid).pid()] = *i;
++ }
++
++ apr_pool_t *iterpool = svn_pool_create(pool);
++ pid_t pid = getpid();
++ while (pid != 0)
++ {
++ svn_pool_clear(iterpool);
++ if (process_info_list.contains(pid))
++ {
++ wid = process_info_list[pid];
++ break;
++ }
++ pid = get_parent_pid(pid, iterpool);
++ }
++ svn_pool_destroy(iterpool);
++ }
++
++ if (wid == 1)
++ {
++ const char *wid_env_string = getenv("WINDOWID");
++ if (wid_env_string)
++ {
++ long wid_env = atol(wid_env_string);
++ if (wid_env != 0)
++ {
++ wid = wid_env;
++ }
++ }
++ }
++
++ return wid;
++}
++
+ static KWallet::Wallet *
+ get_wallet(QString wallet_name,
+- apr_hash_t *parameters)
++ apr_hash_t *parameters,
++ apr_pool_t *pool)
+ {
+ KWallet::Wallet *wallet =
+ static_cast<KWallet::Wallet *> (apr_hash_get(parameters,
+@@ -115,7 +246,7 @@
+ APR_HASH_KEY_STRING))
+ {
+ wallet = KWallet::Wallet::openWallet(wallet_name,
+- -1,
++ pool ? get_wid(parameters, pool) : 1,
+ KWallet::Wallet::Synchronous);
+ }
+ if (wallet)
+@@ -141,7 +272,7 @@
+ apr_hash_t *parameters = static_cast<apr_hash_t *> (data);
+ if (apr_hash_get(parameters, "kwallet-initialized", APR_HASH_KEY_STRING))
+ {
+- KWallet::Wallet *wallet = get_wallet(NULL, parameters);
++ KWallet::Wallet *wallet = get_wallet(NULL, parameters, NULL);
+ delete wallet;
+ apr_hash_set(parameters,
+ "kwallet-initialized",
+@@ -172,12 +303,7 @@
+ return FALSE;
+ }
+
+- QCoreApplication *app;
+- if (! qApp)
+- {
+- int argc = 1;
+- app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+- }
++ INITIALIZE_APPLICATION
+
+ KCmdLineArgs::init(1,
+ (char *[1]) {(char *) "svn"},
+@@ -195,7 +321,7 @@
+ QString::fromUtf8(username) + "@" + QString::fromUtf8(realmstring);
+ if (! KWallet::Wallet::keyDoesNotExist(wallet_name, folder, key))
+ {
+- KWallet::Wallet *wallet = get_wallet(wallet_name, parameters);
++ KWallet::Wallet *wallet = get_wallet(wallet_name, parameters, pool);
+ if (wallet)
+ {
+ apr_hash_set(parameters,
+@@ -242,12 +368,7 @@
+ return FALSE;
+ }
+
+- QCoreApplication *app;
+- if (! qApp)
+- {
+- int argc = 1;
+- app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+- }
++ INITIALIZE_APPLICATION
+
+ KCmdLineArgs::init(1,
+ (char *[1]) {(char *) "svn"},
+@@ -262,7 +383,7 @@
+ QString q_password = QString::fromUtf8(password);
+ QString wallet_name = get_wallet_name(parameters);
+ QString folder = QString::fromUtf8("Subversion");
+- KWallet::Wallet *wallet = get_wallet(wallet_name, parameters);
++ KWallet::Wallet *wallet = get_wallet(wallet_name, parameters, pool);
+ if (wallet)
+ {
+ apr_hash_set(parameters,
+--- subversion/svn/main.c
++++ subversion/svn/main.c
+@@ -2067,6 +2067,9 @@
+ pool)))
+ svn_handle_error2(err, stderr, TRUE, "svn: ");
+
++ /* svn can safely create instance of QApplication class. */
++ svn_auth_set_parameter(ab, "svn:auth:qapplication-safe", "1");
++
+ ctx->auth_baton = ab;
+
+ /* Set up conflict resolution callback. */
+--- subversion/svnsync/main.c
++++ subversion/svnsync/main.c
+@@ -1,6 +1,6 @@
+ /*
+ * ====================================================================
+- * Copyright (c) 2005-2008 CollabNet. All rights reserved.
++ * Copyright (c) 2005-2009 CollabNet. All rights reserved.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+@@ -2362,7 +2362,15 @@
+ check_cancel, NULL,
+ pool);
+ if (! err)
+- err = (*subcommand->cmd_func)(os, &opt_baton, pool);
++ {
++ /* svnsync can safely create instance of QApplication class. */
++ svn_auth_set_parameter(opt_baton.source_auth_baton,
++ "svn:auth:qapplication-safe", "1");
++ svn_auth_set_parameter(opt_baton.sync_auth_baton,
++ "svn:auth:qapplication-safe", "1");
++
++ err = (*subcommand->cmd_func)(os, &opt_baton, pool);
++ }
+ if (err)
+ {
+ /* For argument-related problems, suggest using the 'help'
diff --git a/dev-vcs/subversion/files/svnserve.confd b/dev-vcs/subversion/files/svnserve.confd
new file mode 100644
index 000000000000..83997ce92719
--- /dev/null
+++ b/dev-vcs/subversion/files/svnserve.confd
@@ -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"
diff --git a/dev-vcs/subversion/files/svnserve.initd b/dev-vcs/subversion/files/svnserve.initd
new file mode 100644
index 000000000000..b1ed7e696a0d
--- /dev/null
+++ b/dev-vcs/subversion/files/svnserve.initd
@@ -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-vcs/subversion/files/svnserve.initd,v 1.1 2010/06/22 18:17:21 arfrever 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 $?
+}
diff --git a/dev-vcs/subversion/files/svnserve.xinetd b/dev-vcs/subversion/files/svnserve.xinetd
new file mode 100644
index 000000000000..e29f906b5096
--- /dev/null
+++ b/dev-vcs/subversion/files/svnserve.xinetd
@@ -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
+}
diff --git a/dev-vcs/subversion/files/vc-svn.el b/dev-vcs/subversion/files/vc-svn.el
new file mode 100644
index 000000000000..e591820f3abf
--- /dev/null
+++ b/dev-vcs/subversion/files/vc-svn.el
@@ -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)