Commit 58c45082 authored by Clint Rogers's avatar Clint Rogers

Closes #5050; moves settings path to /org/yorba/shotwell and copies over old...

Closes #5050; moves settings path to /org/yorba/shotwell and copies over old settings data from /apps/.
parent c9b40dfe
PROGRAM = shotwell
PROGRAM_THUMBNAILER = shotwell-video-thumbnailer
PROGRAM_MIGRATOR = shotwell-settings-migrator
VERSION = 0.12.90+trunk
GETTEXT_PACKAGE = $(PROGRAM)
......@@ -378,6 +379,9 @@ THUMBNAILER_DIR := thumbnailer
THUMBNAILER_BIN := $(THUMBNAILER_DIR)/$(PROGRAM_THUMBNAILER)
EXPANDED_THUMBNAILER_SRC_FILES := $(foreach file, $(THUMBNAILER_SRC_FILES), $(THUMBNAILER_DIR)/$(file))
MIGRATOR_DIR := settings-migrator
MIGRATOR_BIN := $(MIGRATOR_DIR)/$(PROGRAM_MIGRATOR)
EXPANDED_CORE_PO_FILES := $(foreach po,$(CORE_SUPPORTED_LANGUAGES),po/shotwell-core/$(po).po)
EXPANDED_EXTRAS_PO_FILES := $(foreach po,$(EXTRAS_SUPPORTED_LANGUAGES),po/shotwell-extras/$(po).po)
......@@ -406,7 +410,7 @@ DIST_FILES = Makefile configure chkver $(EXPANDED_DIST_SRC_FILES) $(EXPANDED_VAP
$(EXPANDED_HELP_FILES) $(EXPANDED_HELP_IMAGES) apport/shotwell.py $(UNIT_RESOURCES) $(UNIT_MKS) \
unitize.mk units.mk $(PC_INPUT) $(PLUGINS_DIST_FILES) \
vapi/gphoto-2.5/libgphoto2.vapi vapi/gphoto-2.4/libgphoto2.vapi \
$(EXPANDED_THUMBNAILER_SRC_FILES)
$(EXPANDED_THUMBNAILER_SRC_FILES) $(MIGRATOR_BIN)
DIST_TAR = $(PROGRAM)-$(VERSION).tar
......@@ -551,6 +555,7 @@ install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
$(INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin
$(INSTALL_PROGRAM) $(THUMBNAILER_BIN) $(DESTDIR)$(PREFIX)/bin
$(INSTALL_PROGRAM) $(MIGRATOR_BIN) $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons
$(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
......@@ -620,6 +625,7 @@ endif
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM_THUMBNAILER)
rm -f $(DESTDIR)$(PREFIX)/bin/$(PROGRAM_MIGRATOR)
rm -fr $(DESTDIR)$(PREFIX)/share/shotwell
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/shotwell.svg
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/shotwell.svg
......
<schemalist>
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-piwigo" path="/apps/shotwell/sharing/org-yorba-shotwell-publishing-piwigo/">
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-piwigo" path="/org/yorba/shotwell/sharing/org-yorba-shotwell-publishing-piwigo/">
<key name="url" type="s">
<default>""</default>
<summary>Piwigio URL</summary>
......@@ -50,7 +50,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-yandex-fotki" path="/apps/shotwell/sharing/org-yorba-shotwell-publishing-yandex-fotki/">
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-yandex-fotki" path="/org/yorba/shotwell/sharing/org-yorba-shotwell-publishing-yandex-fotki/">
<key name="auth-token" type="s">
<default>""</default>
<summary>authentication token</summary>
......@@ -58,7 +58,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-tumblr" path="/apps/shotwell/sharing/org-yorba-shotwell-publishing-tumblr/">
<schema id="org.yorba.shotwell.sharing.org-yorba-shotwell-publishing-tumblr" path="/org/yorba/shotwell/sharing/org-yorba-shotwell-publishing-tumblr/">
<key name="token" type="s">
<default>""</default>
<summary>Token</summary>
......
<schemalist>
<schema id="org.yorba.shotwell" path="/apps/shotwell/">
<schema id="org.yorba.shotwell" path="/org/yorba/shotwell/">
<child name="preferences" schema="org.yorba.shotwell.preferences" />
<child name="sharing" schema="org.yorba.shotwell.sharing" />
<child name="video" schema="org.yorba.shotwell.video" />
......@@ -8,7 +8,7 @@
<child name="plugins" schema="org.yorba.shotwell.plugins" />
</schema>
<schema id="org.yorba.shotwell.preferences" path="/apps/shotwell/preferences/">
<schema id="org.yorba.shotwell.preferences" path="/org/yorba/shotwell/preferences/">
<child name="ui" schema="org.yorba.shotwell.preferences.ui" />
<child name="slideshow" schema="org.yorba.shotwell.preferences.slideshow" />
<child name="window" schema="org.yorba.shotwell.preferences.window" />
......@@ -16,7 +16,7 @@
<child name="editing" schema="org.yorba.shotwell.preferences.editing" />
</schema>
<schema id="org.yorba.shotwell.preferences.ui" path="/apps/shotwell/preferences/ui/">
<schema id="org.yorba.shotwell.preferences.ui" path="/org/yorba/shotwell/preferences/ui/">
<key name="display-basic-properties" type="b">
<default>true</default>
<summary>display basic properties</summary>
......@@ -132,7 +132,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.slideshow" path="/apps/shotwell/preferences/slideshow/">
<schema id="org.yorba.shotwell.preferences.slideshow" path="/org/yorba/shotwell/preferences/slideshow/">
<key name="delay" type="d">
<default>3.0</default>
<summary>delay</summary>
......@@ -158,7 +158,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.window" path="/apps/shotwell/preferences/window/">
<schema id="org.yorba.shotwell.preferences.window" path="/org/yorba/shotwell/preferences/window/">
<key name="library-maximize" type="b">
<default>false</default>
<summary>maximize library window</summary>
......@@ -202,7 +202,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.files" path="/apps/shotwell/preferences/files/">
<schema id="org.yorba.shotwell.preferences.files" path="/org/yorba/shotwell/preferences/files/">
<key name="import-dir" type="s">
<default>""</default>
<summary>import directory</summary>
......@@ -246,7 +246,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.crop-settings" path="/apps/shotwell/crop-settings/">
<schema id="org.yorba.shotwell.crop-settings" path="/org/yorba/shotwell/crop-settings/">
<key name="last-crop-menu-choice" type="i">
<default>1</default>
<summary>Most-recently-used crop aspect ratio menu choice.</summary>
......@@ -264,7 +264,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.preferences.editing" path="/apps/shotwell/preferences/editing/">
<schema id="org.yorba.shotwell.preferences.editing" path="/org/yorba/shotwell/preferences/editing/">
<key name="external-photo-editor" type="s">
<default>""</default>
<summary>external photo editor</summary>
......@@ -278,7 +278,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing" path="/apps/shotwell/sharing/">
<schema id="org.yorba.shotwell.sharing" path="/org/yorba/shotwell/sharing/">
<key name="last-used-service" type="s">
<default>""</default>
<summary>last used publishing service</summary>
......@@ -297,7 +297,7 @@
<child name="youtube" schema="org.yorba.shotwell.sharing.youtube" />
</schema>
<schema id="org.yorba.shotwell.sharing.facebook" path="/apps/shotwell/sharing/facebook/">
<schema id="org.yorba.shotwell.sharing.facebook" path="/org/yorba/shotwell/sharing/facebook/">
<key name="access-token" type="s">
<default>""</default>
<summary>access token</summary>
......@@ -329,7 +329,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.flickr" path="/apps/shotwell/sharing/flickr/">
<schema id="org.yorba.shotwell.sharing.flickr" path="/org/yorba/shotwell/sharing/flickr/">
<key name="access-phase-token" type="s">
<default>""</default>
<summary>OAuth Access Phase Token</summary>
......@@ -367,7 +367,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.picasa" path="/apps/shotwell/sharing/picasa/">
<schema id="org.yorba.shotwell.sharing.picasa" path="/org/yorba/shotwell/sharing/picasa/">
<key name="refresh-token" type="s">
<default>""</default>
<summary>refresh token</summary>
......@@ -393,7 +393,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.sharing.youtube" path="/apps/shotwell/sharing/youtube/">
<schema id="org.yorba.shotwell.sharing.youtube" path="/org/yorba/shotwell/sharing/youtube/">
<key name="user-name" type="s">
<default>""</default>
<summary>username</summary>
......@@ -407,7 +407,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.dataimports" path="/apps/shotwell/dataimports/">
<schema id="org.yorba.shotwell.dataimports" path="/org/yorba/shotwell/dataimports/">
<key name="last-used-dataimports-service" type="s">
<default>""</default>
<summary>last used import service</summary>
......@@ -415,7 +415,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.video" path="/apps/shotwell/video/">
<schema id="org.yorba.shotwell.video" path="/org/yorba/shotwell/video/">
<key name="interpreter-state-cookie" type="i">
<default>-1</default>
<summary>interpreter state cookie</summary>
......@@ -423,7 +423,7 @@
</key>
</schema>
<schema id="org.yorba.shotwell.printing" path="/apps/shotwell/printing/">
<schema id="org.yorba.shotwell.printing" path="/org/yorba/shotwell/printing/">
<key name="content-layout" type="i">
<default>3</default>
<summary>content layout mode</summary>
......@@ -485,11 +485,11 @@
</key>
</schema>
<schema id="org.yorba.shotwell.plugins" path="/apps/shotwell/plugins/" >
<schema id="org.yorba.shotwell.plugins" path="/org/yorba/shotwell/plugins/" >
<child name="enable-state" schema="org.yorba.shotwell.plugins.enable-state" />
</schema>
<schema id="org.yorba.shotwell.plugins.enable-state" path="/apps/shotwell/plugins/enable-state/" >
<schema id="org.yorba.shotwell.plugins.enable-state" path="/org/yorba/shotwell/plugins/enable-state/" >
<key name="publishing-facebook" type="b">
<default>true</default>
<summary>enable facebook publishing plugin</summary>
......
#!/bin/sh
################################################################################
#
# Copyright 2012 Yorba Foundation
#
# 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
# temp file not needed anymore, zap it.
rm -f $temp_file_path
......@@ -251,5 +251,15 @@ class AppDirs {
}
return f;
}
public static File get_settings_migrator_bin() {
const string filename = "shotwell-settings-migrator";
File f = File.new_for_path(AppDirs.get_exec_dir().get_path() + "/settings-migrator/" + filename);
if (!f.query_exists()) {
// If we're running installed.
f = File.new_for_path(AppDirs.get_exec_dir().get_path() + "/" + filename);
}
return f;
}
}
......@@ -469,4 +469,18 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
}
}
/*! @brief Migrates settings data over from old-style /apps/ paths to /org/yorba/ ones.
* Should only be called ONCE, during DB upgrading; otherwise, stale data may be copied
* over newer data by accident.
*/
public static void run_gsettings_migrator() {
string cmd_line = AppDirs.get_settings_migrator_bin().get_path();
try {
Process.spawn_command_line_sync(cmd_line);
} catch (Error err) {
message("Error running shotwell-settings-migrator: %s", err.message);
}
}
}
......@@ -21,7 +21,7 @@ public abstract class DatabaseTable {
* tables are created on demand and tables and columns are easily ignored when already present.
* However, the change should be noted in upgrade_database() as a comment.
***/
public const int SCHEMA_VERSION = 15;
public const int SCHEMA_VERSION = 16;
protected static Sqlite.Database db;
......
......@@ -278,6 +278,22 @@ private VerifyResult upgrade_database(int input_version) {
version = 15;
//
// Version 16:
// * Migration of dconf settings data from /apps/shotwell to /org/yorba/shotwell.
//
// The database itself doesn't change; this is to force the path migration to
// occur.
//
if (input_version < 16) {
// Run the settings migrator to copy settings data from /apps/shotwell to /org/yorba/shotwell.
// Please see https://mail.gnome.org/archives/desktop-devel-list/2011-February/msg00064.html
GSettingsConfigurationEngine.run_gsettings_migrator();
}
version = 16;
//
// Finalize the upgrade process
//
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment