Hello community, here is the log from the commit of package hexchat for openSUSE:Factory checked in at 2016-09-08 17:39:09 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-07-30 00:28:36.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.hexchat.new/hexchat.changes 2016-09-08 17:39:10.000000000 +0200 @@ -1,0 +2,7 @@ +Mon Sep 5 08:19:38 UTC 2016 - [email protected] + +- Modified migrate-configuration-from-xchat.patch + Add hexchat-migrate-sh + Realizing the migration job with shell script(bnc#989961) + +------------------------------------------------------------------- New: ---- hexchat-migrate-sh ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hexchat.spec ++++++ --- /var/tmp/diff_new_pack.5etiTg/_old 2016-09-08 17:39:11.000000000 +0200 +++ /var/tmp/diff_new_pack.5etiTg/_new 2016-09-08 17:39:11.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package hexchat # -# Copyright (c) 2016 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2013 Andrey Karepin <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -25,6 +25,7 @@ Group: Productivity/Networking/IRC Url: https://hexchat.github.io/ Source0: https://dl.%{name}.net/%{name}/%{name}-%{version}.tar.xz +Source1: hexchat-migrate-sh # PATCH-FIX-UPSTREAM: Fix build with python3 Patch0: hexchat-python3.patch # PATCH-FEATURE-SLE migrate-configuration-from-xchat.patch [email protected] fate#318480 -- replace xchat with hexchat @@ -114,6 +115,7 @@ make V=1 %{?_smp_mflags} %install +install -Dm 0755 %{S:1} %{buildroot}%{_libdir}/hexchat/$(basename %{S:1}) %make_install # Get rid of libtool archives @@ -137,6 +139,7 @@ %{_bindir}/%{name} %dir %{_libdir}/%{name} %dir %{_libdir}/%{name}/plugins +%{_libdir}/hexchat/hexchat-migrate-sh %{_libdir}/%{name}/plugins/checksum.so %{_libdir}/%{name}/plugins/doat.so %{_libdir}/%{name}/plugins/fishlim.so ++++++ hexchat-migrate-sh ++++++ #!/bin/sh # This script is for migrating the logs from xchat to # hexchat automatically. _DEBUG="off" function DEBUG() { [ "$_DEBUG" == "on" ] && $@ } XCHAT_DIR=~/.xchat2/ HEXCHAT_DIR=~/.config/hexchat/ SERVLIST_=servlist_.conf SERVLIST=servlist.conf SCROLL_PATH=scrollback/ XCHAT_LOGS=xchatlogs/ HEXCHAT_LOGS=logs/ CP_PATH=/usr/bin/cp MV_PATH=/usr/bin/mv MD_PATH=/usr/bin/mkdir doCopyServlist(){ if [ -e $XCHAT_DIR$SERVLIST_ ]; then if [ -d $HEXCHAT_DIR ]; then $CP_PATH $XCHAT_DIR$SERVLIST_ $HEXCHAT_DIR$SERVLIST else DEBUG echo $HEXCHAT_DIR" does not exist" fi else DEBUG echo "servlist does not exist" fi } doCopyScroll(){ if [ -d $XCHAT_DIR$SCROLL_PATH ]; then if [ -d $HEXCHAT_DIR ]; then if [ ! -e $HEXCHAT_DIR$SCROLL_PATH ]; then $CP_PATH -a $XCHAT_DIR$SCROLL_PATH $HEXCHAT_DIR$SCROLL_PATH else DEBUG echo $HEXCHAT_DIR$SCROLL_PATH" already exists" fi else DEBUG echo $HEXCHAT_DIR" does not exist" fi else DEBUG echo $XCHAT_DIR$SCROLL_PATH" does not exist" fi } doCopyLogs(){ if [ -d $XCHAT_DIR$XCHAT_LOGS ]; then if [ -d $HEXCHAT_DIR ]; then if [ ! -e $HEXCHAT_DIR$HEXCHAT_LOGS ]; then $CP_PATH -a $XCHAT_DIR$XCHAT_LOGS $HEXCHAT_DIR$HEXCHAT_LOGS if [ -d $HEXCHAT_DIR$HEXCHAT_LOGS ]; then for file in `ls $HEXCHAT_DIR$HEXCHAT_LOGS` do path=$file paths=(${path//-/ }) $MD_PATH $HEXCHAT_DIR$HEXCHAT_LOGS${paths[0]} $MV_PATH $HEXCHAT_DIR$HEXCHAT_LOGS$file $HEXCHAT_DIR$HEXCHAT_LOGS${paths[0]}/${paths[1]} done else DEBUG echo "Copy fails" fi else DEBUG echo $HEXCHAT_DIR$HEXCHAT_LOGS" already exists" fi else DEBUG echo $HEXCHAT_DIR" does not exist" fi else DEBUG echo $XCHAT_DIR$XCHAT_LOGS" does not exist" fi } if [ -d $XCHAT_DIR ]; then doCopyServlist doCopyScroll doCopyLogs else DEBUG echo $XCHAT_DIR" does not exsit. Stop migrating..." fi ++++++ migrate-configuration-from-xchat.patch ++++++ --- /var/tmp/diff_new_pack.5etiTg/_old 2016-09-08 17:39:11.000000000 +0200 +++ /var/tmp/diff_new_pack.5etiTg/_new 2016-09-08 17:39:11.000000000 +0200 @@ -1,67 +1,53 @@ diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c -index 4bf2f47..1800d3f 100644 +index 4bf2f47..b2a4525 100644 --- a/src/common/cfgfiles.c +++ b/src/common/cfgfiles.c -@@ -950,6 +950,38 @@ make_dcc_dirs (void) - return 0; +@@ -911,6 +911,24 @@ load_default_config(void) + g_free (langs); } -+void migrate_from_xchat (void) ++void migrate_from_xchat(void) +{ -+ 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)) -+ { -+ g_printf ("%s not exists",xchat_dir); -+ g_free (xchat_dir); -+ return; -+ } -+ servlist_conf = g_build_filename (xchat_dir, "servlist_.conf", NULL); -+ if (g_file_test (servlist_conf, G_FILE_TEST_EXISTS)) -+ { -+ char *servlist_target = g_build_filename (get_xdir (), "servlist_.conf", NULL); -+ g_rename (servlist_conf, servlist_target); -+ g_free (servlist_target); -+ } -+ g_free (servlist_conf); -+ -+ logs_xchat = g_build_filename (xchat_dir, "xchatlogs", NULL); -+ if (g_file_test (logs_xchat, G_FILE_TEST_EXISTS)) -+ { -+ char *logs_hexchat = g_build_filename (get_xdir (), "logs", NULL); -+ g_rename (logs_xchat, logs_hexchat); -+ g_free (logs_hexchat); -+ } -+ g_free (logs_xchat); -+ -+ g_free (xchat_dir); ++ int pid; ++ ++ pid = fork(); ++ switch (pid) ++ { ++ case -1: ++ g_warning("fork failed "); ++ return; ++ case 0: ++ execl("/bin/sh","sh", "-c", "/usr/lib64/hexchat/hexchat-migrate-sh",NULL); ++ _exit(0); ++ default: ++ return; ++ } +} + -+ int - load_config (void) + make_config_dirs (void) { diff --git a/src/common/cfgfiles.h b/src/common/cfgfiles.h -index b421884..151e9bd 100644 +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); ++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..056ae84 100644 +index caa20eb..4b22f73 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -1044,6 +1044,7 @@ main (int argc, char *argv[]) load_default_config (); make_config_dirs (); make_dcc_dirs (); -+ migrate_from_xchat (); ++ migrate_from_xchat(); } /* we MUST do this after load_config () AND before fe_init (thus gtk_init) otherwise it will fail */
