commit hexchat for openSUSE:Factory
Hello community, here is the log from the commit of package hexchat for openSUSE:Factory checked in at 2016-07-30 00:28:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hexchat (Old) and /work/SRC/openSUSE:Factory/.hexchat.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "hexchat" Changes: -------- --- /work/SRC/openSUSE:Factory/hexchat/hexchat.changes 2016-05-08 10:46:22.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.hexchat.new/hexchat.changes 2016-07-30 00:28:36.000000000 +0200 @@ -1,0 +2,6 @@ +Thu Jul 28 08:38:38 UTC 2016 - tyang@suse.com + +- Modified migrate-configuration-from-xchat.patch. + To realize the migration of servlist.conf file.(bnc#989961) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ migrate-configuration-from-xchat.patch ++++++ --- /var/tmp/diff_new_pack.NfaRAM/_old 2016-07-30 00:28:38.000000000 +0200 +++ /var/tmp/diff_new_pack.NfaRAM/_new 2016-07-30 00:28:38.000000000 +0200 @@ -1,16 +1,14 @@ diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c -index 4bf2f47..35c330f 100644 +index 4bf2f47..1800d3f 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c -@@ -938,6 +938,84 @@ make_config_dirs (void) +@@ -950,6 +950,38 @@ make_dcc_dirs (void) return 0; } -+void -+migrate_conf_from_xchat (void) ++void migrate_from_xchat (void) +{ -+ char *xchat_conf; -+ char *logs_xchat; ++ char *servlist_conf, *logs_xchat; + char *xchat_dir = g_build_filename (g_get_home_dir (), ".xchat2", NULL); + if (!g_file_test (xchat_dir, G_FILE_TEST_EXISTS)) + { @@ -18,15 +16,14 @@ + g_free (xchat_dir); + return; + } -+ -+ xchat_conf = g_build_filename (xchat_dir, "xchat.conf", NULL); -+ if (g_file_test (xchat_conf, G_FILE_TEST_EXISTS)) ++ servlist_conf = g_build_filename (xchat_dir, "servlist_.conf", NULL); ++ if (g_file_test (servlist_conf, G_FILE_TEST_EXISTS)) + { -+ char *hexchat_conf = g_build_filename (get_xdir (), "hexchat.conf", NULL); -+ g_rename (xchat_conf, hexchat_conf); -+ g_free (hexchat_conf); ++ char *servlist_target = g_build_filename (get_xdir (), "servlist_.conf", NULL); ++ g_rename (servlist_conf, servlist_target); ++ g_free (servlist_target); + } -+ g_free (xchat_conf); ++ g_free (servlist_conf); + + logs_xchat = g_build_filename (xchat_dir, "xchatlogs", NULL); + if (g_file_test (logs_xchat, G_FILE_TEST_EXISTS)) @@ -40,80 +37,31 @@ + g_free (xchat_dir); +} + -+static void move_file_from_xchat_xdir (char *des_dir, char *src) -+{ -+ GFile *file = g_file_new_for_path (src); -+ char *filename = g_file_get_basename (file); -+ g_print ("move %s to %s\n",src,des_dir); -+ if (g_file_test (des_dir, G_FILE_TEST_EXISTS)) -+ { -+ char *des = g_build_filename (des_dir, filename, NULL); -+ g_print ("from %s to %s\n",src,des); -+ g_rename (src,des); -+ g_free (des); -+ } -+ -+ g_free (filename); -+ g_object_unref (file); -+} -+ -+static void move_to_dir_addons (char *filename) -+{ -+ char *des_dir = g_build_filename (get_xdir (), "addons", NULL); -+ move_file_from_xchat_xdir (des_dir, filename); -+ g_free (des_dir); -+} -+ -+static void move_to_dir_certs (char* filename) -+{ -+ char *des_dir = g_build_filename (get_xdir (), "certs", NULL); -+ move_file_from_xchat_xdir (des_dir, filename); -+ g_free (des_dir); -+} -+ -+void -+migrate_addons_and_certs_from_xchat (void) -+{ -+ char *xchat_dir = g_build_filename (g_get_home_dir (), ".xchat2", NULL); -+ if (g_file_test (xchat_dir, G_FILE_TEST_EXISTS)) -+ { -+ g_print ("~/.xchat/ exixts\n"); -+ for_files (xchat_dir, "*.so", move_to_dir_addons); -+ for_files (xchat_dir, "*.pem", move_to_dir_certs); -+ } -+ g_free (xchat_dir); -+} + int - make_dcc_dirs (void) + load_config (void) { diff --git a/src/common/cfgfiles.h b/src/common/cfgfiles.h -index b421884..a2e7620 100644 +index b421884..151e9bd 100644 --- a/src/common/cfgfiles.h +++ b/src/common/cfgfiles.h -@@ -39,6 +39,8 @@ int cfg_put_color (int fh, guint16 r, guint16 g, guint16 b, char *var); - char *get_xdir (void); - int check_config_dir (void); +@@ -41,6 +41,7 @@ int check_config_dir (void); void load_default_config (void); -+void migrate_conf_from_xchat (void); -+void migrate_addons_and_certs_from_xchat (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..e07d7a8 100644 +index caa20eb..056ae84 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c -@@ -1041,8 +1041,11 @@ main (int argc, char *argv[]) - } else - { - /* this is probably the first run */ -- load_default_config (); +@@ -1044,6 +1044,7 @@ main (int argc, char *argv[]) + load_default_config (); make_config_dirs (); -+ migrate_conf_from_xchat (); -+ if (load_config () != 0) -+ load_default_config (); -+ migrate_addons_and_certs_from_xchat (); make_dcc_dirs (); ++ migrate_from_xchat (); } + /* we MUST do this after load_config () AND before fe_init (thus gtk_init) otherwise it will fail */
participants (1)
-
root@hilbert.suse.de