From 94e1e3e4c89ff48609b460f8a9765a0e6d3eb48a Mon Sep 17 00:00:00 2001 From: Christian Krause Date: Jun 27 2011 23:05:01 +0000 Subject: Fix FTBFS issue (BZ 715813) Adding two upstream patches to support python-sqlalchemy-0.7.x --- diff --git a/anki-1.2.8-sqlalchemy-0.7.patch b/anki-1.2.8-sqlalchemy-0.7.patch new file mode 100644 index 0000000..c23d7a6 --- /dev/null +++ b/anki-1.2.8-sqlalchemy-0.7.patch @@ -0,0 +1,30 @@ +diff --git a/anki/deck.py b/anki/deck.py +index 36982b8..e013b13 100644 +--- a/anki/deck.py ++++ b/anki/deck.py +@@ -3779,8 +3779,11 @@ update cards set type = type - 3 where type between 0 and 2 and priority = -3""" + path = "sqlite:///" + path + if pool: + # open and lock connection for single use ++ from sqlalchemy.pool import SingletonThreadPool ++ # temporary tables are effectively useless with the default ++ # settings in 0.7, so we need to force the pool class + engine = create_engine(path, connect_args={'timeout': 0}, +- strategy="threadlocal") ++ poolclass=SingletonThreadPool) + else: + # no pool & concurrent access w/ timeout + engine = create_engine(path, +diff --git a/anki/db.py b/anki/db.py +index e9aa207..3ca6216 100644 +--- a/anki/db.py ++++ b/anki/db.py +@@ -30,7 +30,7 @@ from sqlalchemy import create_engine + from sqlalchemy.orm import mapper, sessionmaker as _sessionmaker, relation, backref, \ + object_session as _object_session, class_mapper + from sqlalchemy.sql import select, text, and_ +-from sqlalchemy.exceptions import DBAPIError, OperationalError ++from sqlalchemy.exc import DBAPIError, OperationalError + from sqlalchemy.pool import NullPool + import sqlalchemy + diff --git a/anki.spec b/anki.spec index 2f41c98..a9257d4 100644 --- a/anki.spec +++ b/anki.spec @@ -2,7 +2,7 @@ Name: anki Version: 1.2.8 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Flashcard program for using space repetition learning Group: Amusements/Games @@ -14,6 +14,9 @@ Source0: http://anki.googlecode.com/files/%{name}-%{version}.tgz # Config change: don't check for new updates. Patch0: anki-1.0-noupdate.patch +# https://github.com/dae/libanki/commit/0e8df85619bb0588750b20446d4d8a02de5c73cc +# https://github.com/dae/libanki/commit/e318f7686c02d4de25804fbdaa85c07f442f80d3 +Patch1: anki-1.2.8-sqlalchemy-0.7.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-devel, python-setuptools, python-sqlalchemy BuildRequires: desktop-file-utils, PyQt4, python-simplejson @@ -32,6 +35,9 @@ as possible. Anki is based on a theory called spaced repetition. %prep %setup -q %patch0 -F 9 -p1 -b .noupdate +pushd libanki +%patch1 -p1 -b .sqlalchemy-0.7 +popd %{__sed} -i -e '/^#!\//, 1d' ankiqt/ui/dropbox.py %build @@ -103,6 +109,10 @@ rm -rf %{buildroot} %{_datadir}/pixmaps/%{name}.png %changelog +* Tue Jun 28 2011 Christian Krause - 1.2.8-2 +- Fix FTBFS issue (BZ 715813) +- Adding two upstream patches to support python-sqlalchemy-0.7.x + * Tue Apr 05 2011 Christian Krause - 1.2.8-1 - Update to new upstream version 1.2.8 (BZ 691342)