forked from pool/hexchat
- Fix execution on i586: the migration script is installed in /usr/lib there (boo#1206323). OBS-URL: https://build.opensuse.org/request/show/1042345 OBS-URL: https://build.opensuse.org/package/show/network/hexchat?expand=0&rev=65
54 lines
1.3 KiB
Diff
54 lines
1.3 KiB
Diff
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
|
|
index 4bf2f47..b2a4525 100644
|
|
--- a/src/common/cfgfiles.c
|
|
+++ b/src/common/cfgfiles.c
|
|
@@ -913,6 +913,24 @@ load_default_config(void)
|
|
g_free (langs);
|
|
}
|
|
|
|
+void migrate_from_xchat(void)
|
|
+{
|
|
+ int pid;
|
|
+
|
|
+ pid = fork();
|
|
+ switch (pid)
|
|
+ {
|
|
+ case -1:
|
|
+ g_warning("fork failed ");
|
|
+ return;
|
|
+ case 0:
|
|
+ execl("/bin/sh","sh", "-c", "@@LIBDIR@@/hexchat/hexchat-migrate-sh",NULL);
|
|
+ _exit(0);
|
|
+ default:
|
|
+ return;
|
|
+ }
|
|
+}
|
|
+
|
|
int
|
|
make_config_dirs (void)
|
|
{
|
|
diff --git a/src/common/cfgfiles.h b/src/common/cfgfiles.h
|
|
index b421884..a183a1c 100644
|
|
--- a/src/common/cfgfiles.h
|
|
+++ b/src/common/cfgfiles.h
|
|
@@ -41,6 +41,7 @@ int check_config_dir (void);
|
|
void load_default_config (void);
|
|
int make_config_dirs (void);
|
|
int make_dcc_dirs (void);
|
|
+void migrate_from_xchat(void);
|
|
int load_config (void);
|
|
int save_config (void);
|
|
void list_free (GSList ** list);
|
|
diff --git a/src/common/hexchat.c b/src/common/hexchat.c
|
|
index caa20eb..4b22f73 100644
|
|
--- a/src/common/hexchat.c
|
|
+++ b/src/common/hexchat.c
|
|
@@ -1088,6 +1088,7 @@ main (int argc, char *argv[])
|
|
load_default_config ();
|
|
make_config_dirs ();
|
|
make_dcc_dirs ();
|
|
+ migrate_from_xchat();
|
|
}
|
|
|
|
/* we MUST do this after load_config () AND before fe_init (thus gtk_init) otherwise it will fail */
|