[shotwell/wip/phako/move-gsettings-prefix: 18/20] Restore gsettings hierarchy migrator



commit 159f427a945c581c9171f0f1c461e995c7253a85
Author: Jens Georg <mail jensge org>
Date:   Sun Jan 5 14:33:43 2020 +0100

    Restore gsettings hierarchy migrator

 settings-migrator/meson.build                |  3 +++
 settings-migrator/shotwell-settings-migrator | 33 ++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
---
diff --git a/settings-migrator/meson.build b/settings-migrator/meson.build
new file mode 100644
index 00000000..449eba91
--- /dev/null
+++ b/settings-migrator/meson.build
@@ -0,0 +1,3 @@
+install_data('shotwell-settings-migrator',
+           install_mode : 'rwxr-xr-x',
+           install_dir : join_paths(get_option('libexecdir'), 'shotwell'))
diff --git a/settings-migrator/shotwell-settings-migrator b/settings-migrator/shotwell-settings-migrator
new file mode 100644
index 00000000..20bc510b
--- /dev/null
+++ b/settings-migrator/shotwell-settings-migrator
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+################################################################################
+#
+# Copyright 2016 Software Freedom Conservancy Inc.
+#
+# This software is licensed under the GNU LGPL (version 2.1 or later).
+# See the COPYING file in this distribution.
+#
+# Helper script to copy settings data from /apps/shotwell/ to
+#   /org/yorba/shotwell/
+#
+# NOTE: this should only be run ONCE as part of the upgrade process; otherwise,
+#   any stale data in the old location may be inadvertently copied over again,
+#   overwriting newer data.
+#
+################################################################################
+
+sec_since_epoch=`date +%s`
+temp_file_path_prefix=/tmp/shotwell-migrate-settings-path-
+temp_file_path=$temp_file_path_prefix$sec_since_epoch
+
+# Copy from deprecated path...
+dconf dump /apps/shotwell/ > $temp_file_path
+
+# ...and into officially-blessed one.
+dconf load /org/yorba/shotwell/ < $temp_file_path
+
+# Clean out the stale paths...
+dconf reset -f /apps/shotwell/
+
+# temp file not needed anymore, zap it.
+rm -f $temp_file_path


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]