From 4394cebbff69ae142abb292f220aaa576483daec Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 31 Jul 2010 20:30:35 +0200 Subject: [PATCH 1/4] adapt ebuild to work with snapshots too --- ...d_testing.ebuild => current_stable.ebuild} | 0 packaging/gentoo/current_testing.ebuild | 60 +++++++++++++++++++ packaging/gentoo/readme.txt | 3 + 3 files changed, 63 insertions(+) rename packaging/gentoo/{current_stable_and_testing.ebuild => current_stable.ebuild} (100%) create mode 100644 packaging/gentoo/current_testing.ebuild diff --git a/packaging/gentoo/current_stable_and_testing.ebuild b/packaging/gentoo/current_stable.ebuild similarity index 100% rename from packaging/gentoo/current_stable_and_testing.ebuild rename to packaging/gentoo/current_stable.ebuild diff --git a/packaging/gentoo/current_testing.ebuild b/packaging/gentoo/current_testing.ebuild new file mode 100644 index 00000000..05483b62 --- /dev/null +++ b/packaging/gentoo/current_testing.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# created by Steffen Schaumburg, steffen@schaumburger.info + +inherit eutils +inherit games + +EAPI="2" +NEED_PYTHON=2.5 + +DESCRIPTION="A free/open source tracker/HUD for use with online poker" +HOMEPAGE="http://fpdb.wiki.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/Snapshots/${P}.tar.bz2" + +LICENSE="AGPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +#note: this should work on other architectures too, please send me your experiences + +IUSE="graph mysql postgres sqlite" +RDEPEND=" + mysql? ( virtual/mysql + dev-python/mysql-python ) + postgres? ( dev-db/postgresql-server + dev-python/psycopg ) + sqlite? ( dev-lang/python[sqlite] + dev-python/numpy ) + >=x11-libs/gtk+-2.10 + dev-python/pygtk + graph? ( dev-python/numpy + dev-python/matplotlib[gtk] ) + dev-python/python-xlib + dev-python/pytz" +DEPEND="${RDEPEND}" + +src_install() { + insinto "${GAMES_DATADIR}"/${PN} + doins -r gfx + doins -r pyfpdb + doins readme.txt + + exeinto "${GAMES_DATADIR}"/${PN} + doexe run_fpdb.py + + dodir "${GAMES_BINDIR}" + dosym "${GAMES_DATADIR}"/${PN}/run_fpdb.py "${GAMES_BINDIR}"/${PN} + + newicon gfx/fpdb-icon.png ${PN}.png + make_desktop_entry ${PN} + + prepgamesdirs + fperms +x "${GAMES_DATADIR}"/${PN}/pyfpdb/*.pyw +} + +pkg_postinst() { + games_pkg_postinst + elog "Note that if you really want to use mysql or postgresql you will have to create" + elog "the database and user yourself and enter it into the fpdb config." + elog "You can find the instructions on the project's website." +} diff --git a/packaging/gentoo/readme.txt b/packaging/gentoo/readme.txt index 66d3b452..e8317e9d 100644 --- a/packaging/gentoo/readme.txt +++ b/packaging/gentoo/readme.txt @@ -1,2 +1,5 @@ +If you want to run a stable version please use current_stable.ebuild +If you want to run a testing version please use current_testing.ebuild + To use the ebuild please simply copy it into your local portage tree and rename it to fpdb-version.ebuild, for example fpdb-0.20.1.ebuild or fpdb-0.20.902.ebuild. Here's a little howto on how to utilise 3rd party ebuilds such as this one: http://www.gentoo-wiki.info/HOWTO_Installing_3rd_Party_Ebuilds From c136f7a2dcab1809b2a243d8eb0252e70dbd2580 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 31 Jul 2010 22:27:24 +0200 Subject: [PATCH 2/4] fix pgsql table creation --- pyfpdb/SQL.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index fcebc5c9..7ba5641b 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -146,8 +146,8 @@ class Sql: id BIGSERIAL, PRIMARY KEY (id), tourneysPlayerId INT NOT NULL, FOREIGN KEY (tourneysPlayerId) REFERENCES TourneysPlayers(id), playerId INT NOT NULL, FOREIGN KEY (playerId) REFERENCES Players(id), - buyInPercentage FLOAT UNSIGNED NOT NULL, - payOffPercentage FLOAT UNSIGNED NOT NULL)""" + buyInPercentage FLOAT NOT NULL, + payOffPercentage FLOAT NOT NULL)""" elif db_server == 'sqlite': self.query['createBackingsTable'] = """CREATE TABLE Backings ( id INTEGER PRIMARY KEY, From b4ff46ec4fe834e50c7843643e8a491263877322 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 31 Jul 2010 22:31:55 +0200 Subject: [PATCH 3/4] fix typo in pgsql raiseFirstInChance --- pyfpdb/SQL.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyfpdb/SQL.py b/pyfpdb/SQL.py index 7ba5641b..06c6d648 100644 --- a/pyfpdb/SQL.py +++ b/pyfpdb/SQL.py @@ -3275,7 +3275,7 @@ class Sql: ,sum(CAST(foldToOtherRaisedStreet2 as integer)) ,sum(CAST(foldToOtherRaisedStreet3 as integer)) ,sum(CAST(foldToOtherRaisedStreet4 as integer)) - ,sum(CAST(raisedFirstInChance as integer)) + ,sum(CAST(raiseFirstInChance as integer)) ,sum(CAST(raisedFirstIn as integer)) ,sum(CAST(foldBbToStealChance as integer)) ,sum(CAST(foldedBbToSteal as integer)) From ed239668c0e19d228017f5c421faf4d4291ebae0 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sat, 31 Jul 2010 23:55:05 +0200 Subject: [PATCH 4/4] fix pgsql index and foreign key drops --- pyfpdb/Database.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyfpdb/Database.py b/pyfpdb/Database.py index 500dfb0a..2aea6790 100644 --- a/pyfpdb/Database.py +++ b/pyfpdb/Database.py @@ -951,6 +951,7 @@ class Database: # hmmm, tested by commenting out rollback in grapher. lock seems to work but # then drop still hangs :-( does work in some tests though?? # will leave code here for now pending further tests/enhancement ... + c.execute("BEGIN TRANSACTION") c.execute( "lock table %s in exclusive mode nowait" % (fk['fktab'],) ) #print "after lock, status:", c.statusmessage #print "alter table %s drop constraint %s_%s_fkey" % (fk['fktab'], fk['fktab'], fk['fkcol']) @@ -961,6 +962,7 @@ class Database: if "does not exist" not in str(sys.exc_value): print "warning: drop pg fk %s_%s_fkey failed: %s, continuing ..." \ % (fk['fktab'], fk['fkcol'], str(sys.exc_value).rstrip('\n') ) + c.execute("END TRANSACTION") except: print "warning: constraint %s_%s_fkey not dropped: %s, continuing ..." \ % (fk['fktab'],fk['fkcol'], str(sys.exc_value).rstrip('\n')) @@ -984,6 +986,7 @@ class Database: print "dropping pg index ", idx['tab'], idx['col'] try: # try to lock table to see if index drop will work: + c.execute("BEGIN TRANSACTION") c.execute( "lock table %s in exclusive mode nowait" % (idx['tab'],) ) #print "after lock, status:", c.statusmessage try: @@ -995,6 +998,7 @@ class Database: if "does not exist" not in str(sys.exc_value): print "warning: drop index %s_%s_idx failed: %s, continuing ..." \ % (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n')) + c.execute("END TRANSACTION") except: print "warning: index %s_%s_idx not dropped %s, continuing ..." \ % (idx['tab'],idx['col'], str(sys.exc_value).rstrip('\n'))