From nobody Wed Mar 01 12:37:49 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PRYfk0Q6pz3tq8V; Wed, 1 Mar 2023 12:37:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PRYfj722Sz4c91; Wed, 1 Mar 2023 12:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677674270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0QMcaWw2Ap0IFs8BV7Y7Far9ijygqkRnEB8wY2ivZvs=; b=eQwP8GzwhF++plSo8ZXvFB96jXNiqz+uOImWLrAAIugfQDLqX4U1fCypYHOmrksqBg+5iy 2qvqUqTylNl8+BUFlblVebDihWvp6RXqRJBIuYGJOGhHGRpqeTpiFfZ5t3w1QtVZhAGZg1 agVnY9uw67xj2bLwl5d+R7kNXbE82tHQHg8rywkoE78c7wDAXIaiHMDTjQKtejclxLCQPz IppGataJj2lkx8+HDDL4UaP3GFrY8puvtflvc2J1jqd9Nvusb6SkijHQy3dv6t8CMpj3K8 /u5bVTXUlKzM1L4UQV1m97w+xlP//htIeQJNTwmLjcOn0YMsKh7OzrrJ9FhzNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677674270; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0QMcaWw2Ap0IFs8BV7Y7Far9ijygqkRnEB8wY2ivZvs=; b=MN2V1DRAd9XbX0pOrWRouipooPL5qZeARZETguwYRRvaQTSOuI43tWgL0Pjmhy1HJQmeGs jpYqOHkjuPYzGulpPFI9UnANb6LGhGT0mFw/oIRdDWAtFQrxWGsgOlueA/PQqhxJkrPR/1 PqiXEMEELOqTAFiuJohOaEmyNozXtTs8SneJWlAqWxquIV9UuTBTmnL9I5sUlqDdijmUch UEtgWDhHSOiAeib+hfipuXvxmc3OsguY9i4aA+U/Kdt6tgzo1cwavjAzXUSy5cKAhaGnhn EXLjxnNKaeH2wmaZiRWCYt9iLhjh9Y9TEdx9J+mGKCGqII9vqQYF/9ak5MQQFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677674270; a=rsa-sha256; cv=none; b=m6FoYYtbHErP5/8/zY7lSPBhbvDMInd5wiL6lNp97Q7KQoLt/0kFups6aBJJeOk0w5i5T/ hzW2oqpsqoTa+9ePuZpMpPXDVzQ3Rh2R69bGLZK4WIzdwTnU4mTWnDLxYNBPthCM1IgCrl QjjUIX/uEOziJ0kabpk5xOZfjct5WBWRFI+SsuyHI1m74xianrZw9TsNHVRpvKV0hJBn3j AAdlaSfmybeY622fLCgZpSE/4OiZclmGTx87fkdr/MpAzyKBeIBaAzIftX8W9q4npEG1O1 FScPoP2sXXkGsCDcV/7956AD74u9o2+C6A5JnpSIOfyENOUQOY68YyTfLGSugA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PRYfj67SrzZ59; Wed, 1 Mar 2023 12:37:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 321Cbnji007936; Wed, 1 Mar 2023 12:37:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 321CbnBr007935; Wed, 1 Mar 2023 12:37:49 GMT (envelope-from git) Date: Wed, 1 Mar 2023 12:37:49 GMT Message-Id: <202303011237.321CbnBr007935@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Guido Falsi Subject: git: b27d920aecff - main - deskutils/calibre: Fix at runtime after commit 47912ce2e613 (sqlite3) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: madpilot X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b27d920aecff0eccd07de8feab1f5ee7d2c12621 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by madpilot: URL: https://cgit.FreeBSD.org/ports/commit/?id=b27d920aecff0eccd07de8feab1f5ee7d2c12621 commit b27d920aecff0eccd07de8feab1f5ee7d2c12621 Author: Guido Falsi AuthorDate: 2023-03-01 12:33:37 +0000 Commit: Guido Falsi CommitDate: 2023-03-01 12:33:37 +0000 deskutils/calibre: Fix at runtime after commit 47912ce2e613 (sqlite3) In commit 47912ce2e613 to sqlite3 the default has been changed for the DQS option. Thius causes calibre to fail to open its database, reporting it as corrupted: Traceback (most recent call last): File "/usr/local/lib/calibre/calibre/gui2/main.py", line 331, in initialize_db db = LibraryDatabase(self.library_path) File "/usr/local/lib/calibre/calibre/db/legacy.py", line 195, in __init__ backend = self.backend = create_backend(library_path, default_prefs=default_prefs, File "/usr/local/lib/calibre/calibre/db/legacy.py", line 50, in create_backend return DB(library_path, default_prefs=default_prefs, File "/usr/local/lib/calibre/calibre/db/backend.py", line 501, in __init__ self.initialize_custom_columns() File "/usr/local/lib/calibre/calibre/db/backend.py", line 698, in initialize_custom_columns custom_tables = self.custom_tables File "/usr/local/lib/calibre/calibre/db/backend.py", line 1387, in custom_tables return {x[0] for x in self.conn.get( File "/usr/local/lib/calibre/calibre/db/backend.py", line 370, in get ans = self.cursor().execute(*args) File "src/cursor.c", line 992, in APSWCursor_execute.sqlite3_prepare apsw.SQLError: SQLError: no such column: table This patch fixes the use of double quotes in the code accessing the library database at runtime. Submitted upstream: https://github.com/kovidgoyal/calibre/pull/1830 --- deskutils/calibre/Makefile | 1 + .../calibre/files/patch-src_calibre_db_backend.py | 13 +++++++++++++ .../files/patch-src_calibre_db_schema__upgrades.py | 20 ++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/deskutils/calibre/Makefile b/deskutils/calibre/Makefile index f567078eb1e7..b9372d066444 100644 --- a/deskutils/calibre/Makefile +++ b/deskutils/calibre/Makefile @@ -1,5 +1,6 @@ PORTNAME= calibre PORTVERSION= 6.13.0 +PORTREVISION= 1 CATEGORIES= deskutils python MASTER_SITES= http://download.calibre-ebook.com/${PORTVERSION}/ \ https://curl.haxx.se/ca/:cacert diff --git a/deskutils/calibre/files/patch-src_calibre_db_backend.py b/deskutils/calibre/files/patch-src_calibre_db_backend.py new file mode 100644 index 000000000000..28408c27cef0 --- /dev/null +++ b/deskutils/calibre/files/patch-src_calibre_db_backend.py @@ -0,0 +1,13 @@ +--- src/calibre/db/backend.py.orig 2023-02-17 02:32:09 UTC ++++ src/calibre/db/backend.py +@@ -1385,8 +1385,8 @@ class DB: + @property + def custom_tables(self): + return {x[0] for x in self.conn.get( +- 'SELECT name FROM sqlite_master WHERE type="table" AND ' +- '(name GLOB "custom_column_*" OR name GLOB "books_custom_column_*")')} ++ 'SELECT name FROM sqlite_master WHERE type=\'table\' AND ' ++ '(name GLOB \'custom_column_*\' OR name GLOB \'books_custom_column_*\')')} + + @classmethod + def exists_at(cls, path): diff --git a/deskutils/calibre/files/patch-src_calibre_db_schema__upgrades.py b/deskutils/calibre/files/patch-src_calibre_db_schema__upgrades.py new file mode 100644 index 000000000000..12bf4aa855b4 --- /dev/null +++ b/deskutils/calibre/files/patch-src_calibre_db_schema__upgrades.py @@ -0,0 +1,20 @@ +--- src/calibre/db/schema_upgrades.py.orig 2023-02-17 02:32:09 UTC ++++ src/calibre/db/schema_upgrades.py +@@ -300,7 +300,7 @@ class SchemaUpgrade: + for field in itervalues(self.field_metadata): + if field['is_category'] and not field['is_custom'] and 'link_column' in field: + table = self.db.get( +- 'SELECT name FROM sqlite_master WHERE type="table" AND name=?', ++ 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name=?', + ('books_%s_link'%field['table'],), all=False) + if table is not None: + create_tag_browser_view(field['table'], field['link_column'], field['column']) +@@ -376,7 +376,7 @@ class SchemaUpgrade: + for field in itervalues(self.field_metadata): + if field['is_category'] and not field['is_custom'] and 'link_column' in field: + table = self.db.get( +- 'SELECT name FROM sqlite_master WHERE type="table" AND name=?', ++ 'SELECT name FROM sqlite_master WHERE type=\'table\' AND name=?', + ('books_%s_link'%field['table'],), all=False) + if table is not None: + create_std_tag_browser_view(field['table'], field['link_column'],