git: 7f9936379856 - 2024Q2 - databases/evolution-data-server: make usable when sqlite3 has option DQS disabled

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Fri, 12 Apr 2024 08:39:54 UTC
The branch 2024Q2 has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7f9936379856372d8dd8d7a7eb005a0fd94b1b6b

commit 7f9936379856372d8dd8d7a7eb005a0fd94b1b6b
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2024-04-08 09:52:26 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-04-12 08:39:16 +0000

    databases/evolution-data-server: make usable when sqlite3 has option DQS disabled
    
    This port uses "%s" in some SQL queries where '%s' should have been
    used.  When the DQS (double-quoted string) misfeatures of SQLite3 is
    disabled, these queries fail and cause the error "no such column: %s".
    Change these queries to fix evolution.
    
    PR:             278249
    Approved by:    fluffy (gnome)
    MFH:            2024Q2
    
    (cherry picked from commit 50154e657e63e12df3938dcd7dc15b7e340f5a6f)
---
 databases/evolution-data-server/Makefile           |  2 +-
 .../files/patch-src_camel_camel-db.c               | 36 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git a/databases/evolution-data-server/Makefile b/databases/evolution-data-server/Makefile
index e1208fc20932..e56f1c5cd37e 100644
--- a/databases/evolution-data-server/Makefile
+++ b/databases/evolution-data-server/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	evolution-data-server
 DISTVERSION=	3.44.4
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	databases gnome
 MASTER_SITES=	GNOME
 DIST_SUBDIR=	gnome
diff --git a/databases/evolution-data-server/files/patch-src_camel_camel-db.c b/databases/evolution-data-server/files/patch-src_camel_camel-db.c
new file mode 100644
index 000000000000..2ff44c2cb5e8
--- /dev/null
+++ b/databases/evolution-data-server/files/patch-src_camel_camel-db.c
@@ -0,0 +1,36 @@
+Allow evolution to be used when databases/sqlite3 has been compiled
+with option DQS disabled.
+
+--- src/camel/camel-db.c.orig	2024-04-08 09:37:09 UTC
++++ src/camel/camel-db.c
+@@ -1823,8 +1823,8 @@ camel_db_migrate_folder_prepare (CamelDB *cdb,
+ 			"mail_to , mail_cc , mlist , followup_flag , "
+ 			"followup_completed_on , followup_due_by , "
+ 			"part , labels , usertags , cinfo , bdata , '', '', "
+-			"strftime(\"%%s\", 'now'), "
+-			"strftime(\"%%s\", 'now') FROM %Q",
++			"strftime('%%s', 'now'), "
++			"strftime('%%s', 'now') FROM %Q",
+ 			folder_name, folder_name);
+ 		ret = camel_db_add_to_transaction (cdb, table_creation_query, error);
+ 		sqlite3_free (table_creation_query);
+@@ -2093,8 +2093,8 @@ camel_db_write_message_info_record (CamelDB *cdb,
+ 		"%Q, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, "
+ 		"%lld, %lld, %Q, %Q, %Q, %Q, %Q, %Q, %Q, %Q, "
+ 		"%Q, %Q, %Q, %Q, %Q, %Q, %Q, "
+-		"strftime(\"%%s\", 'now'), "
+-		"strftime(\"%%s\", 'now') )",
++		"strftime('%%s', 'now'), "
++		"strftime('%%s', 'now') )",
+ 		folder_name,
+ 		record->uid,
+ 		record->flags,
+@@ -2578,7 +2578,7 @@ camel_db_rename_folder (CamelDB *cdb,
+ 	ret = camel_db_add_to_transaction (cdb, cmd, error);
+ 	sqlite3_free (cmd);
+ 
+-	cmd = sqlite3_mprintf ("UPDATE %Q SET modified=strftime(\"%%s\", 'now'), created=strftime(\"%%s\", 'now')", new_folder_name);
++	cmd = sqlite3_mprintf ("UPDATE %Q SET modified=strftime('%%s', 'now'), created=strftime('%%s', 'now')", new_folder_name);
+ 	ret = camel_db_add_to_transaction (cdb, cmd, error);
+ 	sqlite3_free (cmd);
+