Commit cf323572 authored by Clint Rogers's avatar Clint Rogers

Closes #5050, closes #5086; moves the settings migrator someplace sensible,...

Closes #5050, closes #5086; moves the settings migrator someplace sensible, causes the migrator to clean up old paths.
parent d7871125
......@@ -558,7 +558,8 @@ 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)/libexec/shotwell
$(INSTALL_PROGRAM) $(MIGRATOR_BIN) $(DESTDIR)$(PREFIX)/libexec/shotwell
mkdir -p $(DESTDIR)$(PREFIX)/share/shotwell/icons
$(INSTALL_DATA) icons/* $(DESTDIR)$(PREFIX)/share/shotwell/icons
mkdir -p $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps
......
......@@ -26,5 +26,8 @@ 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
......@@ -10,6 +10,7 @@ class AppDirs {
private static File exec_dir;
private static File data_dir = null;
private static File tmp_dir = null;
private static File libexec_dir = null;
// Because this is called prior to Debug.init(), this function cannot do any logging calls
public static void init(string arg0) {
......@@ -97,6 +98,23 @@ class AppDirs {
err.message));
}
}
/**
* @brief Returns the build directory if not installed yet, or a path
* to where any helper applets we need will live if installed.
*/
public static File get_libexec_dir() {
if (libexec_dir == null) {
if (get_install_dir() == null) {
// not installed yet - use wherever we were run from
libexec_dir = get_exec_dir();
} else {
libexec_dir = File.new_for_path(Resources.PREFIX + "/libexec/shotwell");
}
}
return libexec_dir;
}
// Return the directory in which Shotwell is installed, or null if uninstalled.
public static File? get_install_dir() {
......@@ -254,10 +272,10 @@ class AppDirs {
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);
File f = File.new_for_path(AppDirs.get_libexec_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);
f = File.new_for_path(AppDirs.get_libexec_dir().get_path() + "/" + filename);
}
return f;
}
......
......@@ -474,7 +474,7 @@ public class GSettingsConfigurationEngine : ConfigurationEngine, GLib.Object {
* over newer data by accident.
*/
public static void run_gsettings_migrator() {
string cmd_line = AppDirs.get_settings_migrator_bin().get_path();
string cmd_line = "sh " + AppDirs.get_settings_migrator_bin().get_path();
try {
Process.spawn_command_line_sync(cmd_line);
......
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