From dd03ff58b43369a246e706b31fd174c2d89003bd Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sun, 31 Jan 2010 10:27:59 +0100 Subject: [PATCH] [entropy.db] EntropyRepository: make insertSignatures() working with older db schema --- libraries/entropy/db/__init__.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libraries/entropy/db/__init__.py b/libraries/entropy/db/__init__.py index acbe599c8..2a8dfb9d7 100644 --- a/libraries/entropy/db/__init__.py +++ b/libraries/entropy/db/__init__.py @@ -2240,9 +2240,14 @@ class EntropyRepository(EntropyRepositoryPluginStore, TextInterface): @keyword gpg: GPG signature file content @type gpg: string """ - self._cursor().execute(""" - INSERT INTO packagesignatures VALUES (?,?,?,?,?) - """, (idpackage, sha1, sha256, sha512, gpg)) + try: + self._cursor().execute(""" + INSERT INTO packagesignatures VALUES (?,?,?,?,?) + """, (idpackage, sha1, sha256, sha512, gpg)) + except OperationalError: # FIXME: remove this before 2010-12-31 + self._cursor().execute(""" + INSERT INTO packagesignatures VALUES (?,?,?,?) + """, (idpackage, sha1, sha256, sha512)) def _insertSpmPhases(self, idpackage, phases): """