[epiphany] profile-migrator: Reduce warnings after duplicate migrations
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] profile-migrator: Reduce warnings after duplicate migrations
- Date: Sun, 6 Aug 2017 15:49:20 +0000 (UTC)
commit 5a7ea14668c89ec905d14152746ee30ff4b6d679
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Aug 6 10:48:44 2017 -0500
profile-migrator: Reduce warnings after duplicate migrations
src/profile-migrator/ephy-profile-migrator.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index b62579d..6b826bd 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -990,7 +990,8 @@ migrate_icon_database (void)
ephy_file_delete_dir_recursively (path, &error);
if (error) {
- g_warning ("Failed to delete %s: %s", path, error->message);
+ if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
+ g_warning ("Failed to delete %s: %s", path, error->message);
g_error_free (error);
}
@@ -1095,7 +1096,8 @@ migrate_history_to_firefox_sync_history (void)
sql_query = "ALTER TABLE urls ADD COLUMN sync_id LONGVARCAR";
ephy_sqlite_connection_execute (history_db, sql_query, &error);
if (error) {
- g_warning ("Failed to add new column to urls table: %s", error->message);
+ /* SQLite gives only a generic error code if the column already exists, so
+ * assume this migrator has been run already and don't print a warning. */
goto out;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]