summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /dev-vcs/monotone/files
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'dev-vcs/monotone/files')
-rw-r--r--dev-vcs/monotone/files/50monotone-gentoo.el28
-rw-r--r--dev-vcs/monotone/files/hooks.lua4
-rw-r--r--dev-vcs/monotone/files/monotone-0.36.initd85
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-bash-completion-tests.patch18
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-boost-1.53.patch92
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch644
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-botan-1.10.patch412
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-glibc-2.14-file-handle.patch166
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-pcre3.patch26
-rw-r--r--dev-vcs/monotone/files/monotone-1.0-texinfo-5.1.patch625
-rw-r--r--dev-vcs/monotone/files/monotone.confd26
-rw-r--r--dev-vcs/monotone/files/read-permissions7
-rw-r--r--dev-vcs/monotone/files/write-permissions2
13 files changed, 2135 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..1718fd2c4416
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-0.36.initd
@@ -0,0 +1,85 @@
+#!/sbin/runscript
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Id$
+
+extra_commands="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 \
+ --user ${MTN_USER} --group ${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 \
+ --user ${MTN_USER} --group ${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 \
+ --user ${MTN_USER} --group ${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-1.0-bash-completion-tests.patch b/dev-vcs/monotone/files/monotone-1.0-bash-completion-tests.patch
new file mode 100644
index 000000000000..5b877d4d31cd
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-bash-completion-tests.patch
@@ -0,0 +1,18 @@
+https://code.monotone.ca/p/monotone/issues/180/
+--- test/extra/bash_completion/bashrc 2011-09-07 09:00:12 +0000
++++ test/extra/bash_completion/bashrc 2011-09-07 12:14:59 +0000
+@@ -18,6 +18,13 @@
+ . /etc/bash_completion
+ elif [ -f /usr/local/etc/bash_completion ]; then
+ . /usr/local/etc/bash_completion
++ elif [ -f /usr/share/bash-completion/.pre -a \
++ -f /usr/share/bash-completion/base ]; then
++ # In Gentoo /etc/profile.d/bash-completion.sh sources required
++ # functions only if enabled with `eselect bashcomp`. We source
++ # required definitions manually.
++ source /usr/share/bash-completion/.pre
++ source /usr/share/bash-completion/base
+ else
+ echo No bash completion package present.
+ exit
+
diff --git a/dev-vcs/monotone/files/monotone-1.0-boost-1.53.patch b/dev-vcs/monotone/files/monotone-1.0-boost-1.53.patch
new file mode 100644
index 000000000000..e72a57e4cdee
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-boost-1.53.patch
@@ -0,0 +1,92 @@
+============================================================
+--- src/database.cc 87efeeff2d3263ba98af684a4022f1897434ed2d
++++ src/database.cc 39ab2644b936e09a536b99ebd28b93f6e0d7c162
+@@ -92,7 +92,7 @@ using boost::shared_ptr;
+ using std::accumulate;
+
+ using boost::shared_ptr;
+-using boost::shared_dynamic_cast;
++using boost::dynamic_pointer_cast;
+ using boost::lexical_cast;
+ using boost::get;
+ using boost::tuple;
+@@ -3430,7 +3430,7 @@ database::encrypt_rsa(key_id const & pub
+
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+ shared_ptr<RSA_PublicKey> pub_key
+- = shared_dynamic_cast<RSA_PublicKey>(x509_key);
++ = dynamic_pointer_cast<RSA_PublicKey>(x509_key);
+ if (!pub_key)
+ throw recoverable_failure(origin::system,
+ "Failed to get RSA encrypting key");
+@@ -3481,7 +3481,7 @@ database::check_signature(key_id const &
+ L(FL("building verifier for %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+ shared_ptr<RSA_PublicKey> pub_key
+- = boost::shared_dynamic_cast<RSA_PublicKey>(x509_key);
++ = boost::dynamic_pointer_cast<RSA_PublicKey>(x509_key);
+
+ E(pub_key, id.inner().made_from,
+ F("failed to get RSA verifying key for %s") % id);
+============================================================
+--- src/key_store.cc b7859345f7c665914d16357409bdff24a48b7996
++++ src/key_store.cc 1ca13b7ee527bc2872d9fc325cf5ef327ca053c2
+@@ -43,7 +43,7 @@ using boost::shared_ptr;
+
+ using boost::scoped_ptr;
+ using boost::shared_ptr;
+-using boost::shared_dynamic_cast;
++using boost::dynamic_pointer_cast;
+
+ using Botan::RSA_PrivateKey;
+ using Botan::RSA_PublicKey;
+@@ -641,7 +641,7 @@ key_store_state::decrypt_private_key(key
+ I(pkcs8_key);
+
+ shared_ptr<RSA_PrivateKey> priv_key;
+- priv_key = shared_dynamic_cast<RSA_PrivateKey>(pkcs8_key);
++ priv_key = dynamic_pointer_cast<RSA_PrivateKey>(pkcs8_key);
+ E(priv_key, origin::no_fault,
+ F("failed to extract RSA private key from PKCS#8 keypair"));
+
+@@ -879,7 +879,8 @@ key_store::make_signature(database & db,
+ L(FL("make_signature: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+- shared_ptr<RSA_PublicKey> pub_key = shared_dynamic_cast<RSA_PublicKey>(x509_key);
++ shared_ptr<RSA_PublicKey> pub_key =
++ dynamic_pointer_cast<RSA_PublicKey>(x509_key);
+
+ if (!pub_key)
+ throw recoverable_failure(origin::system,
+@@ -1092,7 +1093,7 @@ key_store_state::migrate_old_key_pair
+ continue;
+ }
+
+- priv_key = shared_dynamic_cast<RSA_PrivateKey>(pkcs8_key);
++ priv_key = dynamic_pointer_cast<RSA_PrivateKey>(pkcs8_key);
+ I(priv_key);
+
+ // now we can write out the new key
+============================================================
+--- src/ssh_agent.cc 4a0dcab873559e934e41c5f220b5434d35600d9b
++++ src/ssh_agent.cc 6313ee3cdfca4112ba3957dc4a5f318472289dfa
+@@ -32,7 +32,7 @@ using boost::shared_ptr;
+ using std::vector;
+
+ using boost::shared_ptr;
+-using boost::shared_dynamic_cast;
++using boost::dynamic_pointer_cast;
+
+ using Botan::RSA_PublicKey;
+ using Botan::RSA_PrivateKey;
+@@ -391,7 +391,8 @@ ssh_agent::has_key(const keypair & key)
+ L(FL("has_key: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+- shared_ptr<RSA_PublicKey> pub_key = shared_dynamic_cast<RSA_PublicKey>(x509_key);
++ shared_ptr<RSA_PublicKey> pub_key =
++ dynamic_pointer_cast<RSA_PublicKey>(x509_key);
+
+ if (!pub_key)
+ throw recoverable_failure(origin::system,
diff --git a/dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch b/dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch
new file mode 100644
index 000000000000..a86bac555b18
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-botan-1.10-v2.patch
@@ -0,0 +1,644 @@
+Make monotone work with botan 1.10.
+
+Patch generated using the following command:
+mtn diff -r 972ee5c3eab3fb5ba0b80684193293d18438a9d0 \
+ -r f4feb3fdc68e4f955909450b2dcb3ff9312dbc9e
+
+Authors: Martin von Gagern, Markus Wanner
+
+References:
+https://bugs.gentoo.org/380257
+https://code.monotone.ca/p/monotone/issues/182/
+https://code.monotone.ca/p/monotone/source/commit/f4feb3fd
+
+============================================================
+--- src/database.cc 4c259f963c440fc95564dfec99b2f832f0bad643
++++ src/database.cc 87efeeff2d3263ba98af684a4022f1897434ed2d
+@@ -3425,9 +3425,8 @@ database::encrypt_rsa(key_id const & pub
+ rsa_pub_key pub;
+ get_key(pub_id, pub);
+
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>(pub().data()),
+- pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(pub().data()), pub().size());
+
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+ shared_ptr<RSA_PublicKey> pub_key
+@@ -3471,14 +3470,13 @@ database::check_signature(key_id const &
+ else
+ {
+ rsa_pub_key pub;
+- SecureVector<Botan::byte> pub_block;
+
+ if (!public_key_exists(id))
+ return cert_unknown;
+
+ get_key(id, pub);
+- pub_block.set(reinterpret_cast<Botan::byte const *>(pub().data()),
+- pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(pub().data()), pub().size());
+
+ L(FL("building verifier for %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+============================================================
+--- src/gzip.cc e7c19bee910e3d421fd073933810ec52092b1d9b
++++ src/gzip.cc 9da41f6820cdf39707b22c716e3682e0fa0fd745
+@@ -110,7 +110,7 @@ Gzip_Compression::Gzip_Compression(u32bi
+ if(deflateInit2(&(zlib->stream), level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) != Z_OK)
+ {
+ delete zlib; zlib = 0;
+- throw Exception("Gzip_Compression: Memory allocation error");
++ throw Memory_Exhaustion();
+ }
+ }
+
+@@ -137,7 +137,7 @@ void Gzip_Compression::start_msg()
+ /*************************************************
+ * Compress Input with Gzip *
+ *************************************************/
+-void Gzip_Compression::write(const byte input[], u32bit length)
++void Gzip_Compression::write(const byte input[], filter_length_t length)
+ {
+
+ count += length;
+@@ -152,7 +152,7 @@ void Gzip_Compression::write(const byte
+ zlib->stream.avail_out = buffer.size();
+ int rc = deflate(&(zlib->stream), Z_NO_FLUSH);
+ if (rc != Z_OK && rc != Z_STREAM_END)
+- throw Exception("Internal error in Gzip_Compression deflate.");
++ throw Invalid_State("Internal error in Gzip_Compression deflate.");
+ send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+ }
+ }
+@@ -172,7 +172,7 @@ void Gzip_Compression::end_msg()
+ zlib->stream.avail_out = buffer.size();
+ rc = deflate(&(zlib->stream), Z_FINISH);
+ if (rc != Z_OK && rc != Z_STREAM_END)
+- throw Exception("Internal error in Gzip_Compression finishing deflate.");
++ throw Invalid_State("Internal error in Gzip_Compression finishing deflate.");
+ send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+ }
+
+@@ -228,7 +228,7 @@ Gzip_Decompression::Gzip_Decompression()
+ no_writes(true), pipe(new Hash_Filter("CRC32")), footer(0)
+ {
+ if (DEFAULT_BUFFERSIZE < sizeof(GZIP::GZIP_HEADER))
+- throw Exception("DEFAULT_BUFFERSIZE is too small");
++ throw Decoding_Error("DEFAULT_BUFFERSIZE is too small");
+
+ zlib = new Zlib_Stream;
+
+@@ -237,7 +237,7 @@ Gzip_Decompression::Gzip_Decompression()
+ if(inflateInit2(&(zlib->stream), -15) != Z_OK)
+ {
+ delete zlib; zlib = 0;
+- throw Exception("Gzip_Decompression: Memory allocation error");
++ throw Memory_Exhaustion();
+ }
+ }
+
+@@ -256,7 +256,7 @@ void Gzip_Decompression::start_msg()
+ void Gzip_Decompression::start_msg()
+ {
+ if (!no_writes)
+- throw Exception("Gzip_Decompression: start_msg after already writing");
++ throw Decoding_Error("Gzip_Decompression: start_msg after already writing");
+
+ pipe.start_msg();
+ datacount = 0;
+@@ -267,7 +267,7 @@ void Gzip_Decompression::start_msg()
+ /*************************************************
+ * Decompress Input with Gzip *
+ *************************************************/
+-void Gzip_Decompression::write(const byte input[], u32bit length)
++void Gzip_Decompression::write(const byte input[], filter_length_t length)
+ {
+ if(length) no_writes = false;
+
+@@ -277,15 +277,16 @@ void Gzip_Decompression::write(const byt
+ u32bit eat_len = eat_footer(input, length);
+ input += eat_len;
+ length -= eat_len;
+- if (length == 0)
+- return;
+ }
+
++ if (length == 0)
++ return;
++
+ // Check the gzip header
+ if (pos < sizeof(GZIP::GZIP_HEADER))
+ {
+- u32bit len = std::min((u32bit)sizeof(GZIP::GZIP_HEADER)-pos, length);
+- u32bit cmplen = len;
++ filter_length_t len = std::min((filter_length_t)sizeof(GZIP::GZIP_HEADER)-pos, length);
++ filter_length_t cmplen = len;
+ // The last byte is the OS flag - we don't care about that
+ if (pos + len - 1 >= GZIP::HEADER_POS_OS)
+ cmplen--;
+@@ -317,8 +318,8 @@ void Gzip_Decompression::write(const byt
+ if(rc == Z_NEED_DICT)
+ throw Decoding_Error("Gzip_Decompression: Need preset dictionary");
+ if(rc == Z_MEM_ERROR)
+- throw Exception("Gzip_Decompression: Memory allocation error");
+- throw Exception("Gzip_Decompression: Unknown decompress error");
++ throw Memory_Exhaustion();
++ throw Decoding_Error("Gzip_Decompression: Unknown decompress error");
+ }
+ send(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+ pipe.write(buffer.begin(), buffer.size() - zlib->stream.avail_out);
+@@ -346,8 +347,14 @@ u32bit Gzip_Decompression::eat_footer(co
+ if (footer.size() >= GZIP::FOOTER_LENGTH)
+ throw Decoding_Error("Gzip_Decompression: Data integrity error in footer");
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ size_t eat_len = std::min(GZIP::FOOTER_LENGTH-footer.size(),
++ static_cast<size_t>(length));
++ footer += std::make_pair(input, eat_len);
++#else
+ u32bit eat_len = std::min(GZIP::FOOTER_LENGTH-footer.size(), length);
+ footer.append(input, eat_len);
++#endif
+
+ if (footer.size() == GZIP::FOOTER_LENGTH)
+ {
+@@ -364,7 +371,7 @@ void Gzip_Decompression::check_footer()
+ void Gzip_Decompression::check_footer()
+ {
+ if (footer.size() != GZIP::FOOTER_LENGTH)
+- throw Exception("Gzip_Decompression: Error finalizing decompression");
++ throw Decoding_Error("Gzip_Decompression: Error finalizing decompression");
+
+ pipe.end_msg();
+
+@@ -377,7 +384,12 @@ void Gzip_Decompression::check_footer()
+ for (int i = 0; i < 4; i++)
+ buf[3-i] = tmpbuf[i];
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ tmpbuf.resize(4);
++ tmpbuf.copy(footer.begin(), 4);
++#else
+ tmpbuf.set(footer.begin(), 4);
++#endif
+ if (buf != tmpbuf)
+ throw Decoding_Error("Gzip_Decompression: Data integrity error - CRC32 error");
+
+@@ -400,7 +412,7 @@ void Gzip_Decompression::end_msg()
+ // read, clear() will reset no_writes
+ if(no_writes) return;
+
+- throw Exception("Gzip_Decompression: didn't find footer");
++ throw Decoding_Error("Gzip_Decompression: didn't find footer");
+
+ }
+
+@@ -412,7 +424,11 @@ void Gzip_Decompression::clear()
+ no_writes = true;
+ inflateReset(&(zlib->stream));
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ footer.clear();
++#else
+ footer.destroy();
++#endif
+ pos = 0;
+ datacount = 0;
+ }
+============================================================
+--- src/gzip.hh 649dfc0b250954f39c0f73870f8bec3f32f7fa43
++++ src/gzip.hh aff9da63bb22366bccf69c2d75ee7790406d2455
+@@ -7,11 +7,18 @@
+ #ifndef BOTAN_EXT_GZIP_H__
+ #define BOTAN_EXT_GZIP_H__
+
++#include <botan/version.h>
+ #include <botan/filter.h>
+ #include <botan/pipe.h>
+
+ namespace Botan {
+
++#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,4)
++// Only 1.9.4 and newer export the Memory_Exception. Give this gzip
++// implementation something compatible to work with.
++typedef std::bad_alloc Memory_Exhaustion;
++#endif
++
+ namespace GZIP {
+
+ /* A basic header - we only need to set the IDs and compression method */
+@@ -30,13 +37,19 @@ namespace GZIP {
+
+ }
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++typedef size_t filter_length_t;
++#else
++typedef u32bit filter_length_t;
++#endif
++
+ /*************************************************
+ * Gzip Compression Filter *
+ *************************************************/
+ class Gzip_Compression : public Filter
+ {
+ public:
+- void write(const byte input[], u32bit length);
++ void write(const byte input[], filter_length_t length);
+ void start_msg();
+ void end_msg();
+ std::string name() const { return "Gzip_Compression"; }
+@@ -60,7 +73,7 @@ class Gzip_Decompression : public Filter
+ class Gzip_Decompression : public Filter
+ {
+ public:
+- void write(const byte input[], u32bit length);
++ void write(const byte input[], filter_length_t length);
+ void start_msg();
+ void end_msg();
+ std::string name() const { return "Gzip_Decompression"; }
+============================================================
+--- src/key_packet.cc d1306df89dd684badac02c03744cd446381c07d3
++++ src/key_packet.cc c97262d161b23c9640972188979669b3e95afe7b
+@@ -106,8 +106,8 @@ namespace
+ void validate_public_key_data(string const & name, string const & keydata) const
+ {
+ string decoded = decode_base64_as<string>(keydata, origin::user);
+- Botan::SecureVector<Botan::byte> key_block;
+- key_block.set(reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
++ Botan::SecureVector<Botan::byte> key_block
++ (reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
+ try
+ {
+ Botan::X509::load_key(key_block);
+============================================================
+--- src/key_store.cc 64c4c4bed1fadc26b51207b9f61343f9dd7d3c6e
++++ src/key_store.cc b7859345f7c665914d16357409bdff24a48b7996
+@@ -572,13 +572,21 @@ key_store_state::decrypt_private_key(key
+ try // with empty passphrase
+ {
+ Botan::DataSource_Memory ds(kp.priv());
+-#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), Dummy_UI()));
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), ""));
+ #else
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, ""));
+ #endif
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ catch (Passphrase_Required & e)
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (Botan::Invalid_Argument & e)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ L(FL("failed to load key with no passphrase: %s") % e.what());
+
+@@ -605,13 +613,18 @@ key_store_state::decrypt_private_key(key
+ {
+ Botan::DataSource_Memory ds(kp.priv());
+ #if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+- pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), phrase()));
++ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(),
++ phrase()));
+ #else
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, phrase()));
+ #endif
+ break;
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (Botan::Invalid_Argument)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ cycles++;
+ L(FL("decrypt_private_key: failure %d to load encrypted key: %s")
+@@ -822,10 +835,14 @@ key_store::decrypt_rsa(key_id const & id
+ plaintext = string(reinterpret_cast<char const*>(plain.begin()),
+ plain.size());
+ }
+- catch (Botan::Exception & ex)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (std::exception & e)
++#else
++ catch (Botan::Exception & e)
++#endif
+ {
+ E(false, ciphertext.made_from,
+- F("Botan error decrypting data: '%s'") % ex.what());
++ F("Botan error decrypting data: '%s'") % e.what());
+ }
+ }
+
+@@ -856,9 +873,9 @@ key_store::make_signature(database & db,
+ {
+ if (agent.connected()) {
+ //grab the monotone public key as an RSA_PublicKey
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>(key.pub().data()),
+- key.pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(key.pub().data()),
++ key.pub().size());
+ L(FL("make_signature: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+@@ -1031,8 +1048,14 @@ key_store_state::migrate_old_key_pair
+ for (;;)
+ try
+ {
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ arc4_key.resize(phrase().size());
++ arc4_key.copy(reinterpret_cast<Botan::byte const *>(phrase().data()),
++ phrase().size());
++#else
+ arc4_key.set(reinterpret_cast<Botan::byte const *>(phrase().data()),
+ phrase().size());
++#endif
+
+ Pipe arc4_decryptor(get_cipher("ARC4", arc4_key, Botan::DECRYPTION));
+
+@@ -1051,7 +1074,11 @@ key_store_state::migrate_old_key_pair
+ #endif
+ break;
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,4)
++ catch (Botan::Invalid_Argument & e)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ L(FL("migrate_old_key_pair: failure %d to load old private key: %s")
+ % cycles % e.what());
+============================================================
+--- src/monotone.cc a25ecdd170a601db798b63a60add7681609a34c4
++++ src/monotone.cc 764bc9ca406b41d21efd552a0d810bc2849e0588
+@@ -156,27 +156,53 @@ cpp_main(int argc, char ** argv)
+ E(linked_botan_version != BOTAN_VERSION_CODE_FOR(1,7,14), origin::system,
+ F("monotone does not support Botan 1.7.14"));
+
+-#if BOTAN_VERSION_CODE <= BOTAN_VERSION_CODE_FOR(1,7,6)
++ // In Botan 1.9.9, the DataSink_Stream cannot be instantiated per
++ // se. As 1.10.1 is already out, let's simply disable support for
++ // that specific (testing) version of botan.
++ E(linked_botan_version != BOTAN_VERSION_CODE_FOR(1,9,9), origin::system,
++ F("monotone does not support Botan 1.9.9"));
++
++#if BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,7,7)
++ // motonote binary compiled against botan younger than 1.7.7
+ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,6,3), origin::system,
+ F("this monotone binary requires Botan 1.6.3 or newer"));
+- E(linked_botan_version <= BOTAN_VERSION_CODE_FOR(1,7,6), origin::system,
+- F("this monotone binary does not work with Botan newer than 1.7.6"));
+-#elif BOTAN_VERSION_CODE <= BOTAN_VERSION_CODE_FOR(1,7,22)
+- E(linked_botan_version > BOTAN_VERSION_CODE_FOR(1,7,6), origin::system,
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,7,7), origin::system,
++ F("this monotone binary does not work with Botan 1.7.7 or newer"));
++
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,7,22)
++ // motonote binary compiled against botan 1.7.7 - 1.7.21
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,7,7), origin::system,
+ F("this monotone binary requires Botan 1.7.7 or newer"));
+- // While compiling against 1.7.22 or newer is recommended, because
+- // it enables new features of Botan, the monotone binary compiled
+- // against Botan 1.7.21 and before should still work with newer Botan
+- // versions, including all of the stable branch 1.8.x.
+- E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,0), origin::system,
+- F("this monotone binary does not work with Botan 1.9.x"));
+-#else
+- E(linked_botan_version > BOTAN_VERSION_CODE_FOR(1,7,22), origin::system,
++ // While compiling against 1.7.22 or newer is recommended, because it
++ // enables new features of Botan, the monotone binary compiled against
++ // Botan 1.7.21 and before should still work with newer Botan version,
++ // including all of the stable branch 1.8.x, up to and including
++ // 1.9.3.
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,4), origin::system,
++ F("this monotone binary does not work with Botan 1.9.4 or newer"));
++
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,4)
++ // motonote binary compiled against botan 1.7.22 - 1.9.3
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,7,22), origin::system,
+ F("this monotone binary requires Botan 1.7.22 or newer"));
+- E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,0), origin::system,
+- F("this monotone binary does not work with Botan 1.9.x"));
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,4), origin::system,
++ F("this monotone binary does not work with Botan 1.9.4 or newer"));
++
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11)
++ // motonote binary compiled against botan 1.9.4 - 1.9.10
++#pragma message ( "The resulting monotone binary won't be able to run with any stable release of botan." )
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,9,4), origin::system,
++ F("this monotone binary requires Botan 1.9.4 or newer"));
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,11), origin::system,
++ F("this monotone binary does not work with Botan 1.9.11 or newer"));
++
++#else
++ // motonote binary compiled against botan 1.9.11 and newer
++ E(linked_botan_version >= BOTAN_VERSION_CODE_FOR(1,9,11), origin::system,
++ F("this monotone binary requires Botan 1.9.11 or newer"));
+ #endif
+
++
+ app_state app;
+ try
+ {
+============================================================
+--- src/packet.cc f61360ed2524fdf53411bd24d022a2a3c9e6e9c7
++++ src/packet.cc 571ff6eae1d269a146da74f2730b70376957d3bb
+@@ -156,8 +156,8 @@ namespace
+ void validate_public_key_data(string const & name, string const & keydata) const
+ {
+ string decoded = decode_base64_as<string>(keydata, origin::user);
+- Botan::SecureVector<Botan::byte> key_block;
+- key_block.set(reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
++ Botan::SecureVector<Botan::byte> key_block
++ (reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
+ try
+ {
+ Botan::X509::load_key(key_block);
+@@ -175,7 +175,9 @@ namespace
+ Botan::DataSource_Memory ds(decoded);
+ try
+ {
+-#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ Botan::PKCS8::load_key(ds, lazy_rng::get(), Dummy_UI());
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+ Botan::PKCS8::load_key(ds, lazy_rng::get(), string());
+ #else
+ Botan::PKCS8::load_key(ds, string());
+@@ -189,7 +191,11 @@ namespace
+ }
+ // since we do not want to prompt for a password to decode it finally,
+ // we ignore all other exceptions
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ catch (Passphrase_Required) {}
++#else
+ catch (Botan::Invalid_Argument) {}
++#endif
+ }
+ void validate_certname(string const & cn) const
+ {
+@@ -460,8 +466,16 @@ read_packets(istream & in, packet_consum
+ return count;
+ }
+
++// Dummy User_Interface implementation for Botan
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++std::string
++Dummy_UI::get_passphrase(const std::string &, const std::string &,
++ Botan::User_Interface::UI_Result&) const
++{
++ throw Passphrase_Required("Passphrase required");
++}
++#endif
+
+-
+ // Local Variables:
+ // mode: C++
+ // fill-column: 76
+============================================================
+--- src/packet.hh 0a224e6e92f244e2c3e9a5cdb935eb8613d7e85b
++++ src/packet.hh 9c43d30145f0292d6ceda5e717e366fdead5a4d6
+@@ -10,6 +10,10 @@
+ #ifndef __PACKET_HH__
+ #define __PACKET_HH__
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++#include <botan/ui.h>
++#endif
++
+ #include "vocab.hh"
+
+ struct cert;
+@@ -84,8 +88,23 @@ size_t read_packets(std::istream & in, p
+
+ size_t read_packets(std::istream & in, packet_consumer & cons);
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++// A helper class implementing Botan::User_Interface - which doesn't really
++// interface with the user, but provides the necessary plumbing for Botan.
++//
++// See Botan commit 2d09d7d0cd4bd0e7155d001dd65a4f29103b158c
++typedef std::runtime_error Passphrase_Required;
++
++class Dummy_UI : public Botan::User_Interface
++{
++public:
++ virtual std::string get_passphrase(const std::string &, const std::string &,
++ Botan::User_Interface::UI_Result &) const;
++};
+ #endif
+
++#endif
++
+ // Local Variables:
+ // mode: C++
+ // fill-column: 76
+============================================================
+--- src/sha1.cc 5e1aa972d7c7d66e06320b039989652b830dcd75
++++ src/sha1.cc 42e48b22fd88b25e0d38d4f91e1f13f8a83c7120
+@@ -50,9 +50,12 @@ CMD_HIDDEN(benchmark_sha1, "benchmark_sh
+ Botan::Default_Benchmark_Timer timer;
+ std::map<std::string, double> results =
+ Botan::algorithm_benchmark("SHA-1", milliseconds, timer, rng, af);
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11)
++ std::map<std::string, double> results =
++ Botan::algorithm_benchmark("SHA-1", milliseconds, rng, af);
+ #else
+ std::map<std::string, double> results =
+- Botan::algorithm_benchmark("SHA-1", milliseconds, rng, af);
++ Botan::algorithm_benchmark("SHA-1", af, rng, milliseconds, 16);
+ #endif
+
+ for(std::map<std::string, double>::const_iterator i = results.begin();
+============================================================
+--- src/ssh_agent.cc 6d188e7012a0b82f782563b09bbd7adf3f70cf75
++++ src/ssh_agent.cc 4a0dcab873559e934e41c5f220b5434d35600d9b
+@@ -385,9 +385,9 @@ ssh_agent::has_key(const keypair & key)
+ ssh_agent::has_key(const keypair & key)
+ {
+ //grab the monotone public key as an RSA_PublicKey
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>((key.pub)().data()),
+- (key.pub)().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>((key.pub)().data()),
++ (key.pub)().size());
+ L(FL("has_key: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+============================================================
+--- src/transforms.cc cdfb6854ef4992faba21074145f3c8269b845b11
++++ src/transforms.cc b99278ffe95c0081bf4986bc74d3699c37a52948
+@@ -53,15 +53,16 @@ using Botan::Hash_Filter;
+ // paradigm "must" be used. this program is intended for source code
+ // control and I make no bones about it.
+
+-NORETURN(static inline void error_in_transform(Botan::Exception & e));
++NORETURN(static inline void error_in_transform(std::exception & e));
+
+ static inline void
+-error_in_transform(Botan::Exception & e, origin::type caused_by)
++error_in_transform(std::exception & e, origin::type caused_by)
+ {
+ // these classes can all indicate data corruption
+ if (typeid(e) == typeid(Botan::Encoding_Error)
+ || typeid(e) == typeid(Botan::Decoding_Error)
+ || typeid(e) == typeid(Botan::Stream_IO_Error)
++ || typeid(e) == typeid(Botan::Invalid_Argument)
+ || typeid(e) == typeid(Botan::Integrity_Failure))
+ {
+ // clean up the what() string a little: throw away the
+@@ -107,7 +108,7 @@ error_in_transform(Botan::Exception & e,
+ pipe->process_msg(in); \
+ out = pipe->read_all_as_string(Pipe::LAST_MESSAGE); \
+ } \
+- catch (Botan::Exception & e) \
++ catch (std::exception & e) \
+ { \
+ pipe.reset(new Pipe(new T(carg))); \
+ error_in_transform(e, made_from); \
+@@ -173,7 +174,7 @@ template<> string xform<Botan::Hex_Decod
+ {
+ throw Botan::Decoding_Error(string("invalid hex character '") + (char)c + "'");
+ }
+- catch(Botan::Exception & e)
++ catch(std::exception & e)
+ {
+ error_in_transform(e, made_from);
+ }
+@@ -219,7 +220,7 @@ void pack(T const & in, base64< gzip<T>
+ tmp = pipe->read_all_as_string(Pipe::LAST_MESSAGE);
+ out = base64< gzip<T> >(tmp, in.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ pipe.reset(new Pipe(new Gzip_Compression,
+ new Base64_Encoder));
+@@ -237,7 +238,7 @@ void unpack(base64< gzip<T> > const & in
+ pipe->process_msg(in());
+ out = T(pipe->read_all_as_string(Pipe::LAST_MESSAGE), in.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ pipe.reset(new Pipe(new Base64_Decoder,
+ new Gzip_Decompression));
+@@ -264,7 +265,7 @@ calculate_ident(data const & dat,
+ p->process_msg(dat());
+ ident = id(p->read_all_as_string(Pipe::LAST_MESSAGE), dat.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ p.reset(new Pipe(new Hash_Filter("SHA-160")));
+ error_in_transform(e, dat.made_from);
diff --git a/dev-vcs/monotone/files/monotone-1.0-botan-1.10.patch b/dev-vcs/monotone/files/monotone-1.0-botan-1.10.patch
new file mode 100644
index 000000000000..daf73ca833a8
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-botan-1.10.patch
@@ -0,0 +1,412 @@
+by Martin von Gagern:
+https://code.monotone.ca/p/monotone/issues/182/
+
+============================================================
+--- src/database.cc 4c259f963c440fc95564dfec99b2f832f0bad643
++++ src/database.cc 87efeeff2d3263ba98af684a4022f1897434ed2d
+@@ -3425,9 +3425,8 @@ database::encrypt_rsa(key_id const & pub
+ rsa_pub_key pub;
+ get_key(pub_id, pub);
+
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>(pub().data()),
+- pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(pub().data()), pub().size());
+
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+ shared_ptr<RSA_PublicKey> pub_key
+@@ -3471,14 +3470,13 @@ database::check_signature(key_id const &
+ else
+ {
+ rsa_pub_key pub;
+- SecureVector<Botan::byte> pub_block;
+
+ if (!public_key_exists(id))
+ return cert_unknown;
+
+ get_key(id, pub);
+- pub_block.set(reinterpret_cast<Botan::byte const *>(pub().data()),
+- pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(pub().data()), pub().size());
+
+ L(FL("building verifier for %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key(Botan::X509::load_key(pub_block));
+============================================================
+--- src/gzip.cc e7c19bee910e3d421fd073933810ec52092b1d9b
++++ src/gzip.cc bab290412cff6031b2d3bf9d1439a08499d39640
+@@ -137,7 +137,7 @@ void Gzip_Compression::start_msg()
+ /*************************************************
+ * Compress Input with Gzip *
+ *************************************************/
+-void Gzip_Compression::write(const byte input[], u32bit length)
++void Gzip_Compression::write(const byte input[], filter_length_t length)
+ {
+
+ count += length;
+@@ -267,7 +267,7 @@ void Gzip_Decompression::start_msg()
+ /*************************************************
+ * Decompress Input with Gzip *
+ *************************************************/
+-void Gzip_Decompression::write(const byte input[], u32bit length)
++void Gzip_Decompression::write(const byte input[], filter_length_t length)
+ {
+ if(length) no_writes = false;
+
+@@ -284,8 +284,8 @@ void Gzip_Decompression::write(const byt
+ // Check the gzip header
+ if (pos < sizeof(GZIP::GZIP_HEADER))
+ {
+- u32bit len = std::min((u32bit)sizeof(GZIP::GZIP_HEADER)-pos, length);
+- u32bit cmplen = len;
++ filter_length_t len = std::min((filter_length_t)sizeof(GZIP::GZIP_HEADER)-pos, length);
++ filter_length_t cmplen = len;
+ // The last byte is the OS flag - we don't care about that
+ if (pos + len - 1 >= GZIP::HEADER_POS_OS)
+ cmplen--;
+@@ -346,8 +346,14 @@ u32bit Gzip_Decompression::eat_footer(co
+ if (footer.size() >= GZIP::FOOTER_LENGTH)
+ throw Decoding_Error("Gzip_Decompression: Data integrity error in footer");
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ size_t eat_len = std::min(GZIP::FOOTER_LENGTH-footer.size(),
++ static_cast<size_t>(length));
++ footer += std::make_pair(input, eat_len);
++#else
+ u32bit eat_len = std::min(GZIP::FOOTER_LENGTH-footer.size(), length);
+ footer.append(input, eat_len);
++#endif
+
+ if (footer.size() == GZIP::FOOTER_LENGTH)
+ {
+@@ -377,7 +383,12 @@ void Gzip_Decompression::check_footer()
+ for (int i = 0; i < 4; i++)
+ buf[3-i] = tmpbuf[i];
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ tmpbuf.resize(4);
++ tmpbuf.copy(footer.begin(), 4);
++#else
+ tmpbuf.set(footer.begin(), 4);
++#endif
+ if (buf != tmpbuf)
+ throw Decoding_Error("Gzip_Decompression: Data integrity error - CRC32 error");
+
+@@ -412,7 +423,11 @@ void Gzip_Decompression::clear()
+ no_writes = true;
+ inflateReset(&(zlib->stream));
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ footer.clear();
++#else
+ footer.destroy();
++#endif
+ pos = 0;
+ datacount = 0;
+ }
+============================================================
+--- src/gzip.hh 649dfc0b250954f39c0f73870f8bec3f32f7fa43
++++ src/gzip.hh f462dfc1df71ae1e9a8203606fd29d9e0eda9b2a
+@@ -7,6 +7,7 @@
+ #ifndef BOTAN_EXT_GZIP_H__
+ #define BOTAN_EXT_GZIP_H__
+
++#include <botan/version.h>
+ #include <botan/filter.h>
+ #include <botan/pipe.h>
+
+@@ -30,13 +31,19 @@ namespace GZIP {
+
+ }
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ typedef size_t filter_length_t;
++#else
++ typedef u32bit filter_length_t;
++#endif
++
+ /*************************************************
+ * Gzip Compression Filter *
+ *************************************************/
+ class Gzip_Compression : public Filter
+ {
+ public:
+- void write(const byte input[], u32bit length);
++ void write(const byte input[], filter_length_t length);
+ void start_msg();
+ void end_msg();
+ std::string name() const { return "Gzip_Compression"; }
+@@ -60,7 +67,7 @@ class Gzip_Decompression : public Filter
+ class Gzip_Decompression : public Filter
+ {
+ public:
+- void write(const byte input[], u32bit length);
++ void write(const byte input[], filter_length_t length);
+ void start_msg();
+ void end_msg();
+ std::string name() const { return "Gzip_Decompression"; }
+============================================================
+--- src/key_packet.cc d1306df89dd684badac02c03744cd446381c07d3
++++ src/key_packet.cc c97262d161b23c9640972188979669b3e95afe7b
+@@ -106,8 +106,8 @@ namespace
+ void validate_public_key_data(string const & name, string const & keydata) const
+ {
+ string decoded = decode_base64_as<string>(keydata, origin::user);
+- Botan::SecureVector<Botan::byte> key_block;
+- key_block.set(reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
++ Botan::SecureVector<Botan::byte> key_block
++ (reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
+ try
+ {
+ Botan::X509::load_key(key_block);
+============================================================
+--- src/key_store.cc 64c4c4bed1fadc26b51207b9f61343f9dd7d3c6e
++++ src/key_store.cc 1b1f1a989c21ee0dc69c540783ffb1fe4bceabf5
+@@ -572,13 +572,19 @@ key_store_state::decrypt_private_key(key
+ try // with empty passphrase
+ {
+ Botan::DataSource_Memory ds(kp.priv());
+-#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), Dummy_UI()));
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, lazy_rng::get(), ""));
+ #else
+ pkcs8_key.reset(Botan::PKCS8::load_key(ds, ""));
+ #endif
+ }
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ catch (Passphrase_Required & e)
++#else
+ catch (Botan::Exception & e)
++#endif
+ {
+ L(FL("failed to load key with no passphrase: %s") % e.what());
+
+@@ -856,9 +862,9 @@ key_store::make_signature(database & db,
+ {
+ if (agent.connected()) {
+ //grab the monotone public key as an RSA_PublicKey
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>(key.pub().data()),
+- key.pub().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>(key.pub().data()),
++ key.pub().size());
+ L(FL("make_signature: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+@@ -1031,8 +1037,14 @@ key_store_state::migrate_old_key_pair
+ for (;;)
+ try
+ {
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ arc4_key.resize(phrase().size());
++ arc4_key.copy(reinterpret_cast<Botan::byte const *>(phrase().data()),
++ phrase().size());
++#else
+ arc4_key.set(reinterpret_cast<Botan::byte const *>(phrase().data()),
+ phrase().size());
++#endif
+
+ Pipe arc4_decryptor(get_cipher("ARC4", arc4_key, Botan::DECRYPTION));
+
+============================================================
+--- src/monotone.cc a25ecdd170a601db798b63a60add7681609a34c4
++++ src/monotone.cc 2c5f57762bc687a90f75e732f39d2181fc50bd6d
+@@ -170,11 +170,16 @@ cpp_main(int argc, char ** argv)
+ // versions, including all of the stable branch 1.8.x.
+ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,0), origin::system,
+ F("this monotone binary does not work with Botan 1.9.x"));
+-#else
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11)
+ E(linked_botan_version > BOTAN_VERSION_CODE_FOR(1,7,22), origin::system,
+ F("this monotone binary requires Botan 1.7.22 or newer"));
+ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,9,0), origin::system,
+ F("this monotone binary does not work with Botan 1.9.x"));
++#else
++ E(linked_botan_version > BOTAN_VERSION_CODE_FOR(1,9,11), origin::system,
++ F("this monotone binary requires Botan 1.9.11 or newer"));
++ E(linked_botan_version < BOTAN_VERSION_CODE_FOR(1,11,0), origin::system,
++ F("this monotone binary does not work with Botan 1.11.x"));
+ #endif
+
+ app_state app;
+============================================================
+--- src/packet.cc f61360ed2524fdf53411bd24d022a2a3c9e6e9c7
++++ src/packet.cc 6f6739c4756933843a2d865dc6790de9013626b7
+@@ -156,8 +156,8 @@ namespace
+ void validate_public_key_data(string const & name, string const & keydata) const
+ {
+ string decoded = decode_base64_as<string>(keydata, origin::user);
+- Botan::SecureVector<Botan::byte> key_block;
+- key_block.set(reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
++ Botan::SecureVector<Botan::byte> key_block
++ (reinterpret_cast<Botan::byte const *>(decoded.c_str()), decoded.size());
+ try
+ {
+ Botan::X509::load_key(key_block);
+@@ -175,7 +175,9 @@ namespace
+ Botan::DataSource_Memory ds(decoded);
+ try
+ {
+-#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ Botan::PKCS8::load_key(ds, lazy_rng::get(), Dummy_UI());
++#elif BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,7,7)
+ Botan::PKCS8::load_key(ds, lazy_rng::get(), string());
+ #else
+ Botan::PKCS8::load_key(ds, string());
+@@ -189,7 +191,11 @@ namespace
+ }
+ // since we do not want to prompt for a password to decode it finally,
+ // we ignore all other exceptions
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++ catch (Passphrase_Required) {}
++#else
+ catch (Botan::Invalid_Argument) {}
++#endif
+ }
+ void validate_certname(string const & cn) const
+ {
+@@ -460,8 +466,14 @@ read_packets(istream & in, packet_consum
+ return count;
+ }
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++std::string Dummy_UI::get_passphrase(const std::string&,
++ const std::string&,
++ Botan::User_Interface::UI_Result&) const {
++ throw Passphrase_Required();
++}
++#endif
+
+-
+ // Local Variables:
+ // mode: C++
+ // fill-column: 76
+============================================================
+--- src/packet.hh 0a224e6e92f244e2c3e9a5cdb935eb8613d7e85b
++++ src/packet.hh 6c7d90e0bd9abe1e2e97da8ed40808fe438ea34b
+@@ -84,8 +84,26 @@ size_t read_packets(std::istream & in, p
+
+ size_t read_packets(std::istream & in, packet_consumer & cons);
+
++#if BOTAN_VERSION_CODE >= BOTAN_VERSION_CODE_FOR(1,9,11)
++// work around botan commit 2d09d7d0cd4bd0e7155d001dd65a4f29103b158c
++#include <botan/ui.h>
++class Dummy_UI : public Botan::User_Interface
++{
++public:
++ virtual std::string get_passphrase(const std::string&,
++ const std::string&,
++ Botan::User_Interface::UI_Result&) const;
++};
++class Passphrase_Required : public Botan::Exception {
++public:
++ Passphrase_Required(const std::string& m = "Passphrase required") :
++ Botan::Exception(m)
++ {}
++};
+ #endif
+
++#endif
++
+ // Local Variables:
+ // mode: C++
+ // fill-column: 76
+============================================================
+--- src/sha1.cc 5e1aa972d7c7d66e06320b039989652b830dcd75
++++ src/sha1.cc 42e48b22fd88b25e0d38d4f91e1f13f8a83c7120
+@@ -50,9 +50,12 @@ CMD_HIDDEN(benchmark_sha1, "benchmark_sh
+ Botan::Default_Benchmark_Timer timer;
+ std::map<std::string, double> results =
+ Botan::algorithm_benchmark("SHA-1", milliseconds, timer, rng, af);
++#elif BOTAN_VERSION_CODE < BOTAN_VERSION_CODE_FOR(1,9,11)
++ std::map<std::string, double> results =
++ Botan::algorithm_benchmark("SHA-1", milliseconds, rng, af);
+ #else
+ std::map<std::string, double> results =
+- Botan::algorithm_benchmark("SHA-1", milliseconds, rng, af);
++ Botan::algorithm_benchmark("SHA-1", af, rng, milliseconds, 16);
+ #endif
+
+ for(std::map<std::string, double>::const_iterator i = results.begin();
+============================================================
+--- src/ssh_agent.cc 6d188e7012a0b82f782563b09bbd7adf3f70cf75
++++ src/ssh_agent.cc 4a0dcab873559e934e41c5f220b5434d35600d9b
+@@ -385,9 +385,9 @@ ssh_agent::has_key(const keypair & key)
+ ssh_agent::has_key(const keypair & key)
+ {
+ //grab the monotone public key as an RSA_PublicKey
+- SecureVector<Botan::byte> pub_block;
+- pub_block.set(reinterpret_cast<Botan::byte const *>((key.pub)().data()),
+- (key.pub)().size());
++ SecureVector<Botan::byte> pub_block
++ (reinterpret_cast<Botan::byte const *>((key.pub)().data()),
++ (key.pub)().size());
+ L(FL("has_key: building %d-byte pub key") % pub_block.size());
+ shared_ptr<X509_PublicKey> x509_key =
+ shared_ptr<X509_PublicKey>(Botan::X509::load_key(pub_block));
+============================================================
+--- src/transforms.cc cdfb6854ef4992faba21074145f3c8269b845b11
++++ src/transforms.cc 789e01bbff42020d04d8dba8f6b97588fbe4ca3d
+@@ -53,10 +53,10 @@ using Botan::Hash_Filter;
+ // paradigm "must" be used. this program is intended for source code
+ // control and I make no bones about it.
+
+-NORETURN(static inline void error_in_transform(Botan::Exception & e));
++NORETURN(static inline void error_in_transform(std::exception & e));
+
+ static inline void
+-error_in_transform(Botan::Exception & e, origin::type caused_by)
++error_in_transform(std::exception & e, origin::type caused_by)
+ {
+ // these classes can all indicate data corruption
+ if (typeid(e) == typeid(Botan::Encoding_Error)
+@@ -107,7 +107,7 @@ error_in_transform(Botan::Exception & e,
+ pipe->process_msg(in); \
+ out = pipe->read_all_as_string(Pipe::LAST_MESSAGE); \
+ } \
+- catch (Botan::Exception & e) \
++ catch (std::exception & e) \
+ { \
+ pipe.reset(new Pipe(new T(carg))); \
+ error_in_transform(e, made_from); \
+@@ -173,7 +173,7 @@ template<> string xform<Botan::Hex_Decod
+ {
+ throw Botan::Decoding_Error(string("invalid hex character '") + (char)c + "'");
+ }
+- catch(Botan::Exception & e)
++ catch(std::exception & e)
+ {
+ error_in_transform(e, made_from);
+ }
+@@ -219,7 +219,7 @@ void pack(T const & in, base64< gzip<T>
+ tmp = pipe->read_all_as_string(Pipe::LAST_MESSAGE);
+ out = base64< gzip<T> >(tmp, in.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ pipe.reset(new Pipe(new Gzip_Compression,
+ new Base64_Encoder));
+@@ -237,7 +237,7 @@ void unpack(base64< gzip<T> > const & in
+ pipe->process_msg(in());
+ out = T(pipe->read_all_as_string(Pipe::LAST_MESSAGE), in.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ pipe.reset(new Pipe(new Base64_Decoder,
+ new Gzip_Decompression));
+@@ -264,7 +264,7 @@ calculate_ident(data const & dat,
+ p->process_msg(dat());
+ ident = id(p->read_all_as_string(Pipe::LAST_MESSAGE), dat.made_from);
+ }
+- catch (Botan::Exception & e)
++ catch (std::exception & e)
+ {
+ p.reset(new Pipe(new Hash_Filter("SHA-160")));
+ error_in_transform(e, dat.made_from);
diff --git a/dev-vcs/monotone/files/monotone-1.0-glibc-2.14-file-handle.patch b/dev-vcs/monotone/files/monotone-1.0-glibc-2.14-file-handle.patch
new file mode 100644
index 000000000000..a6e282232223
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-glibc-2.14-file-handle.patch
@@ -0,0 +1,166 @@
+Revision: da62cad10eda55aa233ac124273f3db4f541137a
+Parent: 65bcb8cf8b32f68a5b48629b328f6d65979e58df
+Author: Thomas Moschny <thomas.moschny@gmx.de>
+Date: 07.05.2011 13:32:06
+Branch: net.venge.monotone
+
+Changelog:
+
+* src/rcs_file.cc: Rename struct "file_handle" to "rcs_file_handle"
+ to avoid a name clash with a struct of same name defined by newer
+ glibc's "fcntl.h". For aesthetic reasons, also rename struct
+ "file_source".
+
+References:
+https://code.monotone.ca/p/monotone/source/commit/da62cad10eda55aa233ac124273f3db4f541137a/
+https://bugs.gentoo.org/396651
+
+============================================================
+--- src/rcs_file.cc 885b3fbe7b6cfed78816f0e57cd71d44616213c6
++++ src/rcs_file.cc 03cf68912a4a708545ebce3d415c0e970ddead0b
+@@ -42,12 +42,12 @@ struct
+
+ #ifdef HAVE_MMAP
+ struct
+-file_handle
++rcs_file_handle
+ {
+ string const & filename;
+ off_t length;
+ int fd;
+- file_handle(string const & fn) :
++ rcs_file_handle(string const & fn) :
+ filename(fn),
+ length(0),
+ fd(-1)
+@@ -60,13 +60,13 @@ file_handle
+ if (fd == -1)
+ throw oops("open of " + filename + " failed");
+ }
+- ~file_handle()
++ ~rcs_file_handle()
+ {
+ if (close(fd) == -1)
+ throw oops("close of " + filename + " failed");
+ }
+ };
+-struct file_source
++struct rcs_file_source
+ {
+ string const & filename;
+ int fd;
+@@ -91,7 +91,7 @@ struct file_source
+ ++pos;
+ return good();
+ }
+- file_source(string const & fn,
++ rcs_file_source(string const & fn,
+ int f,
+ off_t len) :
+ filename(fn),
+@@ -104,7 +104,7 @@ struct file_source
+ if (mapping == MAP_FAILED)
+ throw oops("mmap of " + filename + " failed");
+ }
+- ~file_source()
++ ~rcs_file_source()
+ {
+ if (munmap(mapping, length) == -1)
+ throw oops("munmapping " + filename + " failed, after reading RCS file");
+@@ -112,12 +112,12 @@ struct
+ };
+ #elif defined(WIN32)
+ struct
+-file_handle
++rcs_file_handle
+ {
+ string const & filename;
+ off_t length;
+ HANDLE fd;
+- file_handle(string const & fn) :
++ rcs_file_handle(string const & fn) :
+ filename(fn),
+ length(0),
+ fd(NULL)
+@@ -134,7 +134,7 @@ file_handle
+ if (fd == NULL)
+ throw oops("open of " + filename + " failed");
+ }
+- ~file_handle()
++ ~rcs_file_handle()
+ {
+ if (CloseHandle(fd)==0)
+ throw oops("close of " + filename + " failed");
+@@ -142,7 +142,7 @@ struct
+ };
+
+ struct
+-file_source
++rcs_file_source
+ {
+ string const & filename;
+ HANDLE fd,map;
+@@ -167,7 +167,7 @@ file_source
+ ++pos;
+ return good();
+ }
+- file_source(string const & fn,
++ rcs_file_source(string const & fn,
+ HANDLE f,
+ off_t len) :
+ filename(fn),
+@@ -183,7 +183,7 @@ file_source
+ if (mapping==NULL)
+ throw oops("MapViewOfFile of " + filename + " failed");
+ }
+- ~file_source()
++ ~rcs_file_source()
+ {
+ if (UnmapViewOfFile(mapping)==0)
+ throw oops("UnmapViewOfFile of " + filename + " failed");
+@@ -193,7 +193,7 @@ file_source
+ };
+ #else
+ // no mmap at all
+-typedef istream file_source;
++typedef istream rcs_file_source;
+ #endif
+
+ typedef enum
+@@ -220,7 +220,7 @@ static token_type
+ }
+
+ static token_type
+-get_token(file_source & ist,
++get_token(rcs_file_source & ist,
+ string & str,
+ size_t & line,
+ size_t & col)
+@@ -303,14 +303,14 @@ struct parser
+
+ struct parser
+ {
+- file_source & ist;
++ rcs_file_source & ist;
+ rcs_file & r;
+ string token;
+ token_type ttype;
+
+ size_t line, col;
+
+- parser(file_source & s,
++ parser(rcs_file_source & s,
+ rcs_file & r)
+ : ist(s), r(r), line(1), col(1)
+ {}
+@@ -489,8 +489,8 @@ parse_rcs_file(string const & filename,
+ parse_rcs_file(string const & filename, rcs_file & r)
+ {
+ #if defined(HAVE_MMAP) || defined(WIN32)
+- file_handle handle(filename);
+- file_source ifs(filename, handle.fd, handle.length);
++ rcs_file_handle handle(filename);
++ rcs_file_source ifs(filename, handle.fd, handle.length);
+ #else
+ ifstream ifs(filename.c_str());
+ ifs.unsetf(ios_base::skipws);
diff --git a/dev-vcs/monotone/files/monotone-1.0-pcre3.patch b/dev-vcs/monotone/files/monotone-1.0-pcre3.patch
new file mode 100644
index 000000000000..932538e38a4b
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-pcre3.patch
@@ -0,0 +1,26 @@
+Author: Francis Russell
+Bug-Debian: http://bugs.debian.org/665448
+Description: The test 'syntax_errors_in_.mtn-ignore' from the monotone
+ test suite contains a .mtn-ignore file which contains a number of
+ regular expressions. Some of these are intended to match and fail to
+ match the names of files created by the test harness. The rest have
+ invalid syntax and should be ignored.
+ .
+ One regex, '(?<=\C)' is presumably intended to be invalid, but with
+ the most recent version of pcre3 matches most files and therefore
+ causes the test to fail. In fact, it appears to be a valid regex that
+ performs a positive look behind to match a single data unit (usually a
+ byte, even in UTF mode). This patch removes the problematic regex until
+ the issue can be addressed upstream.
+Index: monotone-1.0/test/func/syntax_errors_in_.mtn-ignore/mtn-ignore
+===================================================================
+--- monotone-1.0.orig/test/func/syntax_errors_in_.mtn-ignore/mtn-ignore 2011-03-26 06:41:05.000000000 +0000
++++ monotone-1.0/test/func/syntax_errors_in_.mtn-ignore/mtn-ignore 2012-03-25 20:02:37.695875219 +0100
+@@ -21,7 +21,6 @@
+ [[:fnord:]]
+ \\x{123456}
+ (?(0))
+-(?<=\C)
+ \l
+ (?C256)
+ (?C1
diff --git a/dev-vcs/monotone/files/monotone-1.0-texinfo-5.1.patch b/dev-vcs/monotone/files/monotone-1.0-texinfo-5.1.patch
new file mode 100644
index 000000000000..cb457b547d19
--- /dev/null
+++ b/dev-vcs/monotone/files/monotone-1.0-texinfo-5.1.patch
@@ -0,0 +1,625 @@
+Fixes build issue with texinfo-5.1
+https://bugs.gentoo.org/show_bug.cgi?id=483122
+
+============================================================
+--- doc/monotone.texi fcc02ef992214968bfbdd4a1f968846535de22f7
++++ doc/monotone.texi 4feaab5a3c304a6a465402d6069d214137d63198
+@@ -4845,7 +4845,7 @@ @subsection Global Options
+ Cancel all previous @option{--rcfile} options (standard rcfiles are
+ still loaded). See @ref{rcfiles}.
+
+-@itemx --root <arg>
++@item --root <arg>
+ Limit the search for a workspace to the specified root directory
+
+ @item --ssh-sign <arg>
+@@ -6247,7 +6247,7 @@ @section Informative
+ the root directory of the specified path (or the workspace, if no path
+ is given).
+
+-@itemx mtn list vars [@var{domain}]
++@item mtn list vars [@var{domain}]
+ @itemx mtn ls vars
+ @command{ls vars} is an alias for @command{list vars}.
+
+============================================================
+--- doc/pcrepattern.texi 43ef52850c1fd113b8a21d63634bafe61b3aec45
++++ doc/pcrepattern.texi 7ae6fb9367a2410c588230742d63ff4f83daa909
+@@ -74,32 +74,32 @@ @subsubheading Characters and Metacharac
+ brackets, the metacharacters are as follows:
+
+ @table @code
+-@itemx \
++@item \
+ general escape character with several uses
+-@itemx ^
++@item ^
+ assert start of string (or line, in multiline mode)
+-@itemx $
++@item $
+ assert end of string (or line, in multiline mode)
+-@itemx .
++@item .
+ match any character except newline (by default)
+-@itemx [
++@item [
+ start character class definition
+-@itemx |
++@item |
+ start of alternative branch
+-@itemx (
++@item (
+ start subpattern
+-@itemx )
++@item )
+ end subpattern
+-@itemx ?
++@item ?
+ extends the meaning of @samp{(}
+ also 0 or 1 quantifier
+ also quantifier minimizer
+-@itemx *
++@item *
+ 0 or more quantifier
+-@itemx +
++@item +
+ 1 or more quantifier
+ also ``possessive quantifier''
+-@itemx @{
++@item @{
+ start min/max quantifier
+ @end table
+
+@@ -108,16 +108,16 @@ @subsubheading Characters and Metacharac
+ class". In a character class the only metacharacters are:
+
+ @table @code
+-@itemx \
++@item \
+ general escape character
+-@itemx ^
++@item ^
+ negate the class, but only if the first character
+-@itemx -
++@item -
+ indicates character range
+-@itemx [
++@item [
+ POSIX character class (only if followed by POSIX
+ syntax)
+-@itemx ]
++@item ]
+ terminates the character class
+ @end table
+
+@@ -159,25 +159,25 @@ @subsubheading Non-printing Characters
+ represents:
+
+ @table @code
+-@itemx \a
++@item \a
+ alarm, that is, the BEL character (hex 07)
+-@itemx \c@var{x}
++@item \c@var{x}
+ "control-@var{x}", where @var{x} is any character
+-@itemx \e
++@item \e
+ escape (hex 1B)
+-@itemx \f
++@item \f
+ formfeed (hex 0C)
+-@itemx \n
++@item \n
+ linefeed (hex 0A)
+-@itemx \r
++@item \r
+ carriage return (hex 0D)
+-@itemx \t
++@item \t
+ tab (hex 09)
+-@itemx \@var{ddd}
++@item \@var{ddd}
+ character with octal code @var{ddd}, or backreference
+-@itemx \x@var{hh}
++@item \x@var{hh}
+ character with hex code @var{hh}
+-@itemx \x@{@var{hhh...}@}
++@item \x@{@var{hhh...}@}
+ character with hex code @var{hhh...}
+ @end table
+
+@@ -244,27 +244,27 @@ @subsubheading Non-printing Characters
+ @samp{\777} are permitted. For example:
+
+ @table @code
+-@itemx \040
++@item \040
+ is another way of writing a space
+-@itemx \40
++@item \40
+ is the same, provided there are fewer than 40
+ previous capturing subpatterns
+-@itemx \7
++@item \7
+ is always a back reference
+-@itemx \11
++@item \11
+ might be a back reference, or another way of
+ writing a tab
+-@itemx \011
++@item \011
+ is always a tab
+-@itemx \0113
++@item \0113
+ is a tab followed by the character @samp{3}
+-@itemx \113
++@item \113
+ might be a back reference, otherwise the
+ character with octal code 113
+-@itemx \377
++@item \377
+ might be a back reference, otherwise
+ the byte consisting entirely of 1 bits
+-@itemx \81
++@item \81
+ is either a back reference, or a binary zero
+ followed by the two characters @samp{8} and @samp{1}
+ @end table
+@@ -294,25 +294,25 @@ @subsubheading Generic character types
+ following are always recognized:
+
+ @table @code
+-@itemx \d
++@item \d
+ any decimal digit
+-@itemx \D
++@item \D
+ any character that is not a decimal digit
+-@itemx \h
++@item \h
+ any horizontal whitespace character
+-@itemx \H
++@item \H
+ any character that is not a horizontal whitespace character
+-@itemx \s
++@item \s
+ any whitespace character
+-@itemx \S
++@item \S
+ any character that is not a whitespace character
+-@itemx \v
++@item \v
+ any vertical whitespace character
+-@itemx \V
++@item \V
+ any character that is not a vertical whitespace character
+-@itemx \w
++@item \w
+ any ``word'' character
+-@itemx \W
++@item \W
+ any ``non-word'' character
+ @end table
+
+@@ -342,43 +342,43 @@ @subsubheading Generic character types
+ characters are:
+
+ @table @code
+-@itemx U+0009
++@item U+0009
+ Horizontal tab
+-@itemx U+0020
++@item U+0020
+ Space
+-@itemx U+00A0
++@item U+00A0
+ Non-break space
+-@itemx U+1680
++@item U+1680
+ Ogham space mark
+-@itemx U+180E
++@item U+180E
+ Mongolian vowel separator
+ @item U+2000
+ En quad
+-@itemx U+2001
++@item U+2001
+ Em quad
+-@itemx U+2002
++@item U+2002
+ En space
+-@itemx U+2003
++@item U+2003
+ Em space
+-@itemx U+2004
++@item U+2004
+ Three-per-em space
+-@itemx U+2005
++@item U+2005
+ Four-per-em space
+-@itemx U+2006
++@item U+2006
+ Six-per-em space
+ @item U+2007
+ Figure space
+-@itemx U+2008
++@item U+2008
+ Punctuation space
+-@itemx U+2009
++@item U+2009
+ Thin space
+-@itemx U+200A
++@item U+200A
+ Hair space
+-@itemx U+202F
++@item U+202F
+ Narrow no-break space
+-@itemx U+205F
++@item U+205F
+ Medium mathematical space
+-@itemx U+3000
++@item U+3000
+ Ideographic space
+ @end table
+
+@@ -386,19 +386,19 @@ @subsubheading Generic character types
+ The vertical space characters are:
+
+ @table @code
+-@itemx U+000A
++@item U+000A
+ Linefeed
+-@itemx U+000B
++@item U+000B
+ Vertical tab
+-@itemx U+000C
++@item U+000C
+ Formfeed
+-@itemx U+000D
++@item U+000D
+ Carriage return
+-@itemx U+0085
++@item U+0085
+ Next line
+-@itemx U+2028
++@item U+2028
+ Line separator
+-@itemx U+2029
++@item U+2029
+ Paragraph separator
+ @end table
+
+@@ -418,15 +418,15 @@ @subsubheading Newline Conventions
+ the following five sequences:
+
+ @table @code
+-@itemx (*CR)
++@item (*CR)
+ carriage return
+-@itemx (*LF)
++@item (*LF)
+ linefeed
+-@itemx (*CRLF)
++@item (*CRLF)
+ carriage return, followed by linefeed
+-@itemx (*ANYCRLF)
++@item (*ANYCRLF)
+ any of the three above
+-@itemx (*ANY)
++@item (*ANY)
+ all Unicode newline sequences
+ @end table
+
+@@ -474,9 +474,9 @@ @subsubheading Newline Sequences
+ pattern string with one of the following sequences:
+
+ @table @code
+-@itemx (*BSR_ANYCRLF)
++@item (*BSR_ANYCRLF)
+ @key{CR}, @key{LF}, or @key{CR}@key{LF} only
+-@itemx (*BSR_UNICODE)
++@item (*BSR_UNICODE)
+ any Unicode newline sequence (the default)
+ @end table
+
+@@ -501,11 +501,11 @@ @subsubheading Unicode Character Propert
+ 256, but they do work in this mode. The extra escape sequences are:
+
+ @table @code
+-@itemx \p@{@var{xx}@}
++@item \p@{@var{xx}@}
+ a character with the @var{xx} property
+-@itemx \P@{@var{xx}@}
++@item \P@{@var{xx}@}
+ a character without the @var{xx} property
+-@itemx \X
++@item \X
+ an extended Unicode sequence
+ @end table
+
+@@ -618,83 +618,83 @@ @subsubheading Unicode Character Propert
+ @table @code
+ @item C
+ Other
+-@itemx Cc
++@item Cc
+ Control
+-@itemx Cf
++@item Cf
+ Format
+-@itemx Cn
++@item Cn
+ Unassigned
+-@itemx Co
++@item Co
+ Private use
+-@itemx Cs
++@item Cs
+ Surrogate
+
+ @item L
+ Letter
+-@itemx Ll
++@item Ll
+ Lower case letter
+-@itemx Lm
++@item Lm
+ Modifier letter
+-@itemx Lo
++@item Lo
+ Other letter
+-@itemx Lt
++@item Lt
+ Title case letter
+-@itemx Lu
++@item Lu
+ Upper case letter
+
+ @item M
+ Mark
+-@itemx Mc
++@item Mc
+ Spacing mark
+-@itemx Me
++@item Me
+ Enclosing mark
+-@itemx Mn
++@item Mn
+ Non-spacing mark
+
+ @item N
+ Number
+-@itemx Nd
++@item Nd
+ Decimal number
+-@itemx Nl
++@item Nl
+ Letter number
+-@itemx No
++@item No
+ Other number
+
+ @item P
+ Punctuation
+-@itemx Pc
++@item Pc
+ Connector punctuation
+-@itemx Pd
++@item Pd
+ Dash punctuation
+-@itemx Pe
++@item Pe
+ Close punctuation
+-@itemx Pf
++@item Pf
+ Final punctuation
+-@itemx Pi
++@item Pi
+ Initial punctuation
+-@itemx Po
++@item Po
+ Other punctuation
+-@itemx Ps
++@item Ps
+ Open punctuation
+
+ @item S
+ Symbol
+-@itemx Sc
++@item Sc
+ Currency symbol
+-@itemx Sk
++@item Sk
+ Modifier symbol
+-@itemx Sm
++@item Sm
+ Mathematical symbol
+-@itemx So
++@item So
+ Other symbol
+
+ @item Z
+ Separator
+-@itemx Zl
++@item Zl
+ Line separator
+-@itemx Zp
++@item Zp
+ Paragraph separator
+-@itemx Zs
++@item Zs
+ Space separator
+ @end table
+
+@@ -771,18 +771,18 @@ @subsubheading Simple assertions
+ described below. The backslashed assertions are:
+
+ @table @code
+-@itemx \b
++@item \b
+ matches at a word boundary
+-@itemx \B
++@item \B
+ matches when not at a word boundary
+-@itemx \A
++@item \A
+ matches at the start of the subject
+-@itemx \Z
++@item \Z
+ matches at the end of the subject
+ also matches before a newline at the end of the subject
+-@itemx \z
++@item \z
+ matches only at the end of the subject
+-@itemx \G
++@item \G
+ matches at the first matching position in the subject
+ @end table
+
+@@ -993,33 +993,33 @@ @subsubheading POSIX Character Classes
+ supported class names are
+
+ @table @code
+-@itemx alnum
++@item alnum
+ letters and digits
+-@itemx alpha
++@item alpha
+ letters
+-@itemx ascii
++@item ascii
+ character codes 0 -- 127
+-@itemx blank
++@item blank
+ space or tab only
+-@itemx cntrl
++@item cntrl
+ control characters
+-@itemx digit
++@item digit
+ decimal digits (same as @samp{\d})
+-@itemx graph
++@item graph
+ printing characters, excluding space
+-@itemx lower
++@item lower
+ lower case letters
+-@itemx print
++@item print
+ printing characters, including space
+-@itemx punct
++@item punct
+ printing characters, excluding letters and digits
+-@itemx space
++@item space
+ white space (not quite the same as @samp{\s})
+-@itemx upper
++@item upper
+ upper case letters
+-@itemx word
++@item word
+ ``word'' characters (same as @samp{\w})
+-@itemx xdigit
++@item xdigit
+ hexadecimal digits
+ @end table
+
+@@ -1071,22 +1071,22 @@ @subsubheading Internal Option Setting
+ @samp{)}. The option letters are
+
+ @table @code
+-@itemx i
++@item i
+ Caseless: characters in one case match the corresponding
+ characters in other cases as well.
+-@itemx m
++@item m
+ Multiline: @samp{^} and @samp{$} match at newlines
+ as well as at beginning and end of string.
+-@itemx s
++@item s
+ Dotall: dot matches any character, including newline characters.
+-@itemx x
++@item x
+ Extended syntax: unescaped white space is ignored and embedded
+ comments are possible.
+-@itemx J
++@item J
+ Dupnames: names for capturing subpattern need not be unique.
+-@itemx U
++@item U
+ Ungreedy: quantifiers match as few times as possible by default.
+-@itemx X
++@item X
+ Extra: for forward compatibility, give an error if any escape sequence
+ with no defined meaning appears.
+ @end table
+@@ -1358,11 +1358,11 @@ @subsubheading Repetition
+ single-character abbreviations:
+
+ @table @code
+-@itemx *
++@item *
+ is equivalent to @{0,@}
+-@itemx +
++@item +
+ is equivalent to @{1,@}
+-@itemx ?
++@item ?
+ is equivalent to @{0,1@}
+ @end table
+
+@@ -2302,7 +2302,7 @@ @subsubheading Verbs that act immediatel
+ The following verbs act as soon as they are encountered:
+
+ @table @code
+-@itemx (*ACCEPT)
++@item (*ACCEPT)
+
+ This verb causes the match to end successfully, skipping the remainder
+ of the pattern. When inside a recursion, only the innermost pattern is
+@@ -2317,7 +2317,7 @@ @subsubheading Verbs that act immediatel
+ This matches @samp{AB}, @samp{AAD}, or @samp{ACD}, but when it matches
+ @samp{AB}, no data is captured.
+
+-@itemx (*FAIL) @r{or} (*F)
++@item (*FAIL) @r{or} (*F)
+
+ This verb causes the match to fail, forcing backtracking to occur. It
+ is equivalent to @samp{(?!)} but easier to read. It is not clear
+@@ -2334,7 +2334,7 @@ @subsubheading Verbs that act after back
+ occurs.
+
+ @table @code
+-@itemx (*COMMIT)
++@item (*COMMIT)
+
+ This verb causes the whole match to fail outright if the rest of the
+ pattern does not match. Even if the pattern is unanchored, no further
+@@ -2350,7 +2350,7 @@ @subsubheading Verbs that act after back
+ This matches @samp{xxaab} but not @samp{aacaab}. It can be thought of
+ as a kind of dynamic anchor, or ``I've started, so I must finish.''
+
+-@itemx (*PRUNE)
++@item (*PRUNE)
+
+ This verb causes the match to fail at the current position if the rest
+ of the pattern does not match. If the pattern is unanchored, the
+@@ -2363,7 +2363,7 @@ @subsubheading Verbs that act after back
+ are some uses of @code{(*PRUNE)} that cannot be expressed in any other
+ way.
+
+-@itemx (*SKIP)
++@item (*SKIP)
+
+ This verb is like @code{(*PRUNE)}, except that if the pattern is
+ unanchored, the "bumpalong" advance is not to the next character, but
+@@ -2383,7 +2383,7 @@ @subsubheading Verbs that act after back
+ attempt would start at the second character instead of skipping on to
+ @samp{c}.
+
+-@itemx (*THEN)
++@item (*THEN)
+
+ This verb causes a skip to the next alternation if the rest of the
+ pattern does not match. That is, it cancels pending backtracking, but
diff --git a/dev-vcs/monotone/files/monotone.confd b/dev-vcs/monotone/files/monotone.confd
new file mode 100644
index 000000000000..bf9366584108
--- /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
+# $Id$
+
+# 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