summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2009-05-27 22:56:04 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2009-05-27 22:56:04 +0000
commit6767319894a06a86ff7f97dbef491be351ead0b8 (patch)
treeca3478daa9fd000355bdd81f26dd7e9ae53fd21b /dev-util
parentAdd support for PYTHON_USE_WITH* variables (diff)
downloadgentoo-2-6767319894a06a86ff7f97dbef491be351ead0b8.tar.gz
gentoo-2-6767319894a06a86ff7f97dbef491be351ead0b8.tar.bz2
gentoo-2-6767319894a06a86ff7f97dbef491be351ead0b8.zip
Fix src_test and don't use deprecated modules in python >= 2.5. Fixes bug #247023.
(Portage version: 2.2_rc28/cvs/Linux i686)
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/cvs2svn/ChangeLog7
-rw-r--r--dev-util/cvs2svn/cvs2svn-2.2.0.ebuild15
-rw-r--r--dev-util/cvs2svn/files/2.2.0-deprecated-modules.patch54
3 files changed, 72 insertions, 4 deletions
diff --git a/dev-util/cvs2svn/ChangeLog b/dev-util/cvs2svn/ChangeLog
index cf75d2ac0979..6d7a731b3985 100644
--- a/dev-util/cvs2svn/ChangeLog
+++ b/dev-util/cvs2svn/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for dev-util/cvs2svn
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/cvs2svn/ChangeLog,v 1.23 2009/02/01 16:52:32 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/cvs2svn/ChangeLog,v 1.24 2009/05/27 22:56:04 betelgeuse Exp $
+
+ 27 May 2009; Petteri Räty <betelgeuse@gentoo.org>
+ +files/2.2.0-deprecated-modules.patch, cvs2svn-2.2.0.ebuild:
+ Fix src_test and don't use deprecated modules in python >= 2.5. Fixes bug
+ #247023.
*cvs2svn-2.2.0 (01 Feb 2009)
diff --git a/dev-util/cvs2svn/cvs2svn-2.2.0.ebuild b/dev-util/cvs2svn/cvs2svn-2.2.0.ebuild
index f42cb8a2d942..91fc537efb04 100644
--- a/dev-util/cvs2svn/cvs2svn-2.2.0.ebuild
+++ b/dev-util/cvs2svn/cvs2svn-2.2.0.ebuild
@@ -1,6 +1,10 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/cvs2svn/cvs2svn-2.2.0.ebuild,v 1.1 2009/02/01 16:52:32 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-util/cvs2svn/cvs2svn-2.2.0.ebuild,v 1.2 2009/05/27 22:56:04 betelgeuse Exp $
+
+EAPI="2"
+PYTHON_USE_WITH_OR="berkdb gdbm"
+PYTHON_USE_WITH_OPT="test"
inherit distutils
@@ -13,13 +17,18 @@ SRC_URI="http://cvs2svn.tigris.org/files/documents/1462/${FILEVER}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86"
-IUSE=""
+IUSE="test"
DEPEND="dev-lang/python
>=dev-util/subversion-1.0.9"
RDEPEND="${DEPEND}
app-text/rcs"
+src_prepare() {
+ epatch "${FILESDIR}/2.2.0-deprecated-modules.patch"
+ distutils_src_prepare
+}
+
src_install() {
distutils_src_install
insinto "/usr/share/${PN}"
@@ -30,7 +39,7 @@ src_install() {
src_test() {
# Need this because subversion is localized, but the tests aren't
export LC_ALL=C
- python run-tests.py || die "tests failed"
+ python -W ignore run-tests.py || die "tests failed"
}
pkg_postinst() {
diff --git a/dev-util/cvs2svn/files/2.2.0-deprecated-modules.patch b/dev-util/cvs2svn/files/2.2.0-deprecated-modules.patch
new file mode 100644
index 000000000000..94ceaa2b2fa2
--- /dev/null
+++ b/dev-util/cvs2svn/files/2.2.0-deprecated-modules.patch
@@ -0,0 +1,54 @@
+Index: cvs2svn_lib/dumpfile_delegate.py
+===================================================================
+--- cvs2svn_lib/dumpfile_delegate.py (revision 4808)
++++ cvs2svn_lib/dumpfile_delegate.py (working copy)
+@@ -16,9 +16,11 @@
+
+ """This module contains database facilities used by cvs2svn."""
+
++try:
++ from hashlib import md5
++except ImportError:
++ from md5 import new as md5
+
+-import md5
+-
+ from cvs2svn_lib import config
+ from cvs2svn_lib.common import FatalError
+ from cvs2svn_lib.common import InternalError
+@@ -320,7 +322,7 @@
+ self.dumpfile.write(prop_contents)
+
+ # Insert the rev contents, calculating length and checksum as we go.
+- checksum = md5.new()
++ checksum = md5()
+ length = 0
+ if buf is None:
+ buf = stream.read(config.PIPE_READ_SIZE)
+Index: cvs2svn_lib/metadata_database.py
+===================================================================
+--- cvs2svn_lib/metadata_database.py (revision 4808)
++++ cvs2svn_lib/metadata_database.py (working copy)
+@@ -16,9 +16,11 @@
+
+ """This module contains classes to manage CVSRevision metadata."""
+
++try:
++ from hashlib import sha1
++except ImportError:
++ from sha import new as sha1
+
+-import sha
+-
+ from cvs2svn_lib.context import Ctx
+ from cvs2svn_lib.database import IndexedDatabase
+ from cvs2svn_lib.key_generator import KeyGenerator
+@@ -86,7 +88,7 @@
+ if not Ctx().cross_branch_commits:
+ key.append(branch_name or '')
+
+- digest = sha.new('\0'.join(key)).digest()
++ digest = sha1('\0'.join(key)).digest()
+ try:
+ # See if it is already known:
+ return self._digest_to_id[digest]