diff options
author | Sebastian Pipping <sping@gentoo.org> | 2010-03-05 16:49:36 +0000 |
---|---|---|
committer | Sebastian Pipping <sping@gentoo.org> | 2010-03-05 16:49:36 +0000 |
commit | 9861b383c31ad90bfb2a69ac9c5a1f05224eaca6 (patch) | |
tree | 8ae854fec19a66eda74214342ef4e4d939cd8a61 /dev-vcs/monotone/files | |
parent | Workaround bug 295726 until upstream fixes it (diff) | |
download | gentoo-2-9861b383c31ad90bfb2a69ac9c5a1f05224eaca6.tar.gz gentoo-2-9861b383c31ad90bfb2a69ac9c5a1f05224eaca6.tar.bz2 gentoo-2-9861b383c31ad90bfb2a69ac9c5a1f05224eaca6.zip |
dev-vcs/monotone: Copy from dev-util/monotone
(Portage version: 2.2_rc64/cvs/Linux i686, RepoMan options: --force)
Diffstat (limited to 'dev-vcs/monotone/files')
-rw-r--r-- | dev-vcs/monotone/files/50monotone-gentoo.el | 28 | ||||
-rw-r--r-- | dev-vcs/monotone/files/hooks.lua | 4 | ||||
-rw-r--r-- | dev-vcs/monotone/files/monotone-0.36.initd | 85 | ||||
-rw-r--r-- | dev-vcs/monotone/files/monotone.confd | 26 | ||||
-rw-r--r-- | dev-vcs/monotone/files/read-permissions | 7 | ||||
-rw-r--r-- | dev-vcs/monotone/files/write-permissions | 2 |
6 files changed, 152 insertions, 0 deletions
diff --git a/dev-vcs/monotone/files/50monotone-gentoo.el b/dev-vcs/monotone/files/50monotone-gentoo.el new file mode 100644 index 000000000000..c84f4560c673 --- /dev/null +++ b/dev-vcs/monotone/files/50monotone-gentoo.el @@ -0,0 +1,28 @@ + +;;; monotone site-lisp configuration + +(add-to-list 'load-path "@SITELISP@") + +(autoload 'monotone-toggle-vc-prefix-map "monotone" + "Toggle between the default and monotone vc-maps, ARG set map." t) +(autoload 'monotone "monotone" + "Prompt for a STRING and run monotone with the split string." t) +(autoload 'monotone-pull "monotone" + "Pull updates from a remote server. ARG prompts." t) +(autoload 'monotone-push "monotone" + "Push the DB contents to a remote server. ARG prompts." t) +(autoload 'monotone-vc-commit "monotone" "Do a commit." t) +(autoload 'monotone-vc-print-log "monotone" + "Print the log for this buffer. With prefix ARG the global log." t) +(autoload 'monotone-vc-diff "monotone" + "Print the diffs for this buffer. With prefix ARG, the global diffs." t) +(autoload 'monotone-vc-register "monotone" + "Register this file with monotone for the next commit." t) +(autoload 'monotone-vc-status "monotone" + "Print the status of the current branch." t) +(autoload 'monotone-grab-id "monotone" + "Grab the id under point and put it in the kill buffer for later use." t) + +(autoload 'mnav-revdb-reload "monotone-nav") +(autoload 'mnav-pick "monotone-nav" + "Display browser to pick a monotone revision." t) diff --git a/dev-vcs/monotone/files/hooks.lua b/dev-vcs/monotone/files/hooks.lua new file mode 100644 index 000000000000..bbdb0042a5f6 --- /dev/null +++ b/dev-vcs/monotone/files/hooks.lua @@ -0,0 +1,4 @@ +-- Add custom hooks after the following line. It includes the identification +-- needed to start the server. + +include(get_confdir() .. "/passphrase.lua") diff --git a/dev-vcs/monotone/files/monotone-0.36.initd b/dev-vcs/monotone/files/monotone-0.36.initd new file mode 100644 index 000000000000..442707527cc7 --- /dev/null +++ b/dev-vcs/monotone/files/monotone-0.36.initd @@ -0,0 +1,85 @@ +#!/sbin/runscript +# Copyright 2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/dev-vcs/monotone/files/monotone-0.36.initd,v 1.1 2010/03/05 16:49:36 sping Exp $ + +opts="import" + +depend() { + need net +} + +# Substitute common default values +MTN_USER=${MTN_USER:-monotone} +MTN_GROUP=${MTN_GROUP:-monotone} +MTN_KEY=${MTN_KEY:-monotone@`hostname --fqdn`} +MTN_CONFDIR=${MTN_CONFDIR:-/etc/monotone} +MTN_COMMON="--norc --confdir=${MTN_CONFDIR} \ + --keydir=${MTN_KEYDIR:-/var/lib/monotone/keys} \ + --db=${MTN_DB:-/var/lib/monotone/default.mtn} \ + --rcfile=${MTN_CONFDIR}/hooks.lua --log=/var/log/monotone/monotone.log" + #--dump=$ERRORLOG +MTN_PIDFILE="/var/run/monotone/monotone.pid" +MTN_HOME=$(awk -F: -vuid=$MTN_USER -vuser=$MTN_USER '$3 == uid || $1 == user { print $6 }' < /etc/passwd) + +dbexists() { + # Create the database if it doesn't exist + if [ ! -e ${MTN_DB:-/var/lib/monotone/default.mtn} ]; then + ebegin "Creating monotone database" + start-stop-daemon --start \ + --chuid ${MTN_USER}:${MTN_GROUP} \ + --exec /usr/bin/mtn -- ${MTN_COMMON} db init + eend $? + fi + if [ ! -e ${MTN_KEYDIR:-/var/lib/monotone/keys}/${MTN_KEY} ]; then + ebegin "Creating monotone server keypair" + export MTN_PWD=${RANDOM} + yes "${MTN_PWD}" | \ + start-stop-daemon --start \ + --chuid ${MTN_USER}:${MTN_GROUP} \ + --exec /usr/bin/mtn -- ${MTN_COMMON} genkey ${MTN_KEY} + + eend $? + # Update the password lua hook + cat > ${MTN_CONFDIR}/passphrase.lua <<EOF +-- This file is automaticaly generated by the init scripts. +-- If you want to add custom hooks, edit ${MTN_CONFDIR}/hooks.lua +-- If you want to change the settings, please edit /etc/conf.d/monotone + +function get_passphrase(identity) + if (identity == "${MTN_KEY}") then + return "${MTN_PWD}" + end + return false +end +EOF + fi +} + +start() { + cd ${MTN_HOME} + dbexists + + ebegin "Starting monotone server" + start-stop-daemon --start --background \ + --chuid ${MTN_USER}:${MTN_GROUP} \ + --exec /usr/bin/mtn -- ${MTN_COMMON} --pid-file=${MTN_PIDFILE} \ + --key=${MTN_KEY} --bind=${MTN_ADDRESS:-0.0.0.0} serve + eend $? +} + +stop() { + ebegin "Stopping monotone server" + start-stop-daemon --stop --quiet --pidfile ${MTN_PIDFILE} + eend $? +} + +import() { + cd ${MTN_HOME} + dbexists + + # Read packets into the database + einfo "Importing packets to monotone database" + cat | /usr/bin/mtn ${MTN_COMMON} read + eend $? +} diff --git a/dev-vcs/monotone/files/monotone.confd b/dev-vcs/monotone/files/monotone.confd new file mode 100644 index 000000000000..e95d69fdacd8 --- /dev/null +++ b/dev-vcs/monotone/files/monotone.confd @@ -0,0 +1,26 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-vcs/monotone/files/monotone.confd,v 1.1 2010/03/05 16:49:36 sping Exp $ + +# 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. + +# Location of the served database +#MTN_DB="/var/lib/monotone/default.mtn" + +# Server identification +#MTN_KEY="monotone@`hostname --fqdn`" +#MTN_PWD="" + +# User and group as which to run monotone +#MTN_USER="monotone" +#MTN_GROUP="monotone" + +# The address and or port (ADDRESS[:PORT]) monotone should listen on +#MTN_ADDRESS=0.0.0.0 + +# Advanced options +#MTN_CONFDIR=/etc/monotone +#MTN_KEYDIR=/var/lib/monotone/keys diff --git a/dev-vcs/monotone/files/read-permissions b/dev-vcs/monotone/files/read-permissions new file mode 100644 index 000000000000..d08200aa0059 --- /dev/null +++ b/dev-vcs/monotone/files/read-permissions @@ -0,0 +1,7 @@ +pattern "net.example.project.{private,security}*" +allow "joe@example.net" +allow "jim@example.net" + +comment "everyone can read these branches" +pattern "net.example.{public,project}*" +allow "*" diff --git a/dev-vcs/monotone/files/write-permissions b/dev-vcs/monotone/files/write-permissions new file mode 100644 index 000000000000..1b138c7fc6c0 --- /dev/null +++ b/dev-vcs/monotone/files/write-permissions @@ -0,0 +1,2 @@ +joe@example.net +jim@example.net |