From 631d87a8ac318c2189ea64b62ef549a47fd77fc098e8e6847f54d3e054b559d8 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sat, 26 Jul 2014 12:57:14 +0000 Subject: [PATCH 1/6] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinit?expand=0&rev=35 --- kinit.spec | 2 + more_verbose.patch | 218 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 220 insertions(+) create mode 100644 more_verbose.patch diff --git a/kinit.spec b/kinit.spec index 2b18e78..8f7080d 100644 --- a/kinit.spec +++ b/kinit.spec @@ -44,6 +44,7 @@ Group: System/GUI/KDE Url: http://www.kde.org Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{version}.tar.xz Source1: baselibs.conf +Patch0: more_verbose.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -63,6 +64,7 @@ booting UNIX. Development files. %lang_package %prep %setup -q +%patch0 -p1 %build %cmake_kf5 -d build -- -DCMAKE_CXX_FLAGS="%{optflags} -fpie" -DCMAKE_C_FLAGS="%{optflags} -fpie" -DCMAKE_SHARED_LINKER_FLAGS="-pie" -DCMAKE_EXE_LINKER_FLAGS="-pie" -DCMAKE_MODULE_LINKER_FLAGS="-pie" diff --git a/more_verbose.patch b/more_verbose.patch new file mode 100644 index 0000000..1b05681 --- /dev/null +++ b/more_verbose.patch @@ -0,0 +1,218 @@ +diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.cpp +--- kinit-5.0.0/src/kdeinit/kinit.cpp 2014-07-01 20:31:22.000000000 +0200 ++++ kinit-5.0.0.new/src/kdeinit/kinit.cpp 2014-07-26 14:54:45.372904933 +0200 +@@ -448,7 +448,7 @@ + if (write(oom_pipe, &pid, sizeof(pid_t)) > 0) { + sigsuspend(&oldsigs); // wait for the signal to come + } else { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "Failed to reset OOM protection: %d\n", pid); + #endif + } +@@ -512,7 +512,7 @@ + } + } + } +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: preparing to launch '%s'\n", libpath.isEmpty() + ? execpath.constData() : libpath.toUtf8().constData()); + #endif +@@ -742,7 +742,7 @@ + d.n = read(d.fd[0], &d.result, 1); + if (d.n == 1) { + if (d.result == 2) { +-#ifndef NDEBUG ++#ifndef NODEBUG + //fprintf(stderr, "kdeinit5: no kdeinit module, trying exec....\n"); + #endif + exec = true; +@@ -1020,7 +1020,7 @@ + sprintf(args + 5, "%d", d.launcher[1]); + d.launcher_pid = launch(2, "klauncher", args); + close(d.launcher[1]); +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Launched KLauncher, pid = %ld, result = %d\n", + (long) d.launcher_pid, d.result); + #endif +@@ -1036,7 +1036,7 @@ + } + + // KLauncher died... restart +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: KLauncher died unexpectedly.\n"); + #endif + // Make sure it's really dead. +@@ -1055,7 +1055,7 @@ + + static bool handle_launcher_request(int sock, const char *who) + { +- (void)who; // for NDEBUG ++ (void)who; // for NODEBUG + + klauncher_header request_header; + char *request_data = 0L; +@@ -1098,7 +1098,7 @@ + int avoid_loops = 0; + const char *startup_id_str = "0"; // krazy:exclude=doublequote_chars + +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Got %s '%s' from %s.\n", + commandToString(request_header.cmd), + name, who); +@@ -1148,7 +1148,7 @@ + } + + if ((arg_n - request_data) != request_header.arg_length) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: EXEC request has invalid format.\n"); + #endif + free(request_data); +@@ -1208,13 +1208,13 @@ + env_name = request_data; + env_value = env_name + strlen(env_name) + 1; + +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Got SETENV '%s=%s' from %s.\n", env_name, env_value, who); + #endif + + if (request_header.arg_length != + (int)(strlen(env_name) + strlen(env_value) + 2)) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: SETENV request has invalid format.\n"); + #endif + free(request_data); +@@ -1222,14 +1222,14 @@ + } + qputenv(env_name, env_value); + } else if (request_header.cmd == LAUNCHER_TERMINATE_KDE) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: terminate KDE.\n"); + #endif + #if HAVE_X11 + kdeinit_xio_errhandler(0L); + #endif + } else if (request_header.cmd == LAUNCHER_TERMINATE_KDEINIT) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Got termination request (PID %ld).\n", (long) getpid()); + #endif + if (d.launcher_pid) { +@@ -1242,14 +1242,14 @@ + if (children) { + close(d.wrapper); + d.wrapper = -1; +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Closed sockets, but not exiting until all children terminate.\n"); + #endif + } else { + raise(SIGTERM); + } + } else if (request_header.cmd == LAUNCHER_DEBUG_WAIT) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Debug wait activated.\n"); + #endif + d.debug_wait = true; +@@ -1293,7 +1293,7 @@ + do { + exit_pid = waitpid(-1, &exit_status, WNOHANG); + if (exit_pid > 0) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: PID %ld terminated.\n", (long) exit_pid); + #endif + if (waitForPid && (exit_pid == waitForPid)) { +@@ -1308,7 +1308,7 @@ + child_died(exit_pid, exit_status); + + if (d.wrapper < 0 && !children) { +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Last child terminated, exiting (PID %ld).\n", + (long) getpid()); + #endif +@@ -1463,7 +1463,7 @@ + + int kdeinit_x_errhandler(Display *dpy, XErrorEvent *err) + { +-#ifndef NDEBUG ++#ifndef NODEBUG + char errstr[256]; + // kdeinit almost doesn't use X, and therefore there shouldn't be any X error + XGetErrorText(dpy, err->error_code, errstr, 256); +@@ -1536,7 +1536,7 @@ + 0, + BlackPixelOfScreen(DefaultScreenOfDisplay(X11display)), + BlackPixelOfScreen(DefaultScreenOfDisplay(X11display))); +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: opened connection to %s\n", DisplayString(X11display)); + #endif + int fd = XConnectionNumber(X11display); +@@ -1595,7 +1595,7 @@ + switch (x_fork_result) { + + case -1: +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "Mac OS X workaround fork() failed!\n"); + #endif + ::_exit(255); +@@ -1766,7 +1766,7 @@ + l.setLoadHints(QLibrary::ExportExternalSymbolsHint); + (void)l.load(); + } +-#ifndef NDEBUG ++#ifndef NODEBUG + else { + fprintf(stderr, "%s was not found.\n", extra_libs[i]); + } +@@ -1799,7 +1799,7 @@ + qputenv("KDED_STARTED_BY_KDEINIT", "1"); + pid = launch(1, KDED_EXENAME, 0); + unsetenv("KDED_STARTED_BY_KDEINIT"); +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Launched KDED, pid = %ld result = %d\n", (long) pid, d.result); + #endif + d.kded_pid = pid; +@@ -1810,7 +1810,7 @@ + for (int i = 1; i < argc; i++) { + if (safe_argv[i][0] == '+') { + pid = launch(1, safe_argv[i] + 1, 0); +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Launched '%s', pid = %ld result = %d\n", safe_argv[i] + 1, (long) pid, d.result); + #endif + handle_requests(pid); +@@ -1822,7 +1822,7 @@ + // Ignore + } else { + pid = launch(1, safe_argv[i], 0); +-#ifndef NDEBUG ++#ifndef NODEBUG + fprintf(stderr, "kdeinit5: Launched '%s', pid = %ld result = %d\n", safe_argv[i], (long) pid, d.result); + #endif + } +diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher/klauncher.cpp +--- kinit-5.0.0/src/klauncher/klauncher.cpp 2014-07-01 20:31:22.000000000 +0200 ++++ kinit-5.0.0.new/src/klauncher/klauncher.cpp 2014-07-26 14:51:53.553052977 +0200 +@@ -65,7 +65,7 @@ + // Dispose slaves after being idle for SLAVE_MAX_IDLE seconds + #define SLAVE_MAX_IDLE 30 + +-// #define KLAUNCHER_VERBOSE_OUTPUT ++#define KLAUNCHER_VERBOSE_OUTPUT + + static const char *const s_DBusStartupTypeToString[] = + { "DBusNone", "DBusUnique", "DBusMulti", "ERROR" }; From 86d76cbda76b4ecf0c116ea5a211e0c279957098800209337571038e6d2c9c14 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sat, 26 Jul 2014 13:01:28 +0000 Subject: [PATCH 2/6] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinit?expand=0&rev=36 --- more_verbose.patch | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/more_verbose.patch b/more_verbose.patch index 1b05681..b25db7e 100644 --- a/more_verbose.patch +++ b/more_verbose.patch @@ -206,7 +206,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c } diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher/klauncher.cpp --- kinit-5.0.0/src/klauncher/klauncher.cpp 2014-07-01 20:31:22.000000000 +0200 -+++ kinit-5.0.0.new/src/klauncher/klauncher.cpp 2014-07-26 14:51:53.553052977 +0200 ++++ kinit-5.0.0.new/src/klauncher/klauncher.cpp 2014-07-26 15:00:17.385754202 +0200 @@ -65,7 +65,7 @@ // Dispose slaves after being idle for SLAVE_MAX_IDLE seconds #define SLAVE_MAX_IDLE 30 @@ -216,3 +216,12 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher static const char *const s_DBusStartupTypeToString[] = { "DBusNone", "DBusUnique", "DBusMulti", "ERROR" }; +@@ -617,7 +617,7 @@ + request_header.arg_length = requestData.length(); + + #ifdef KLAUNCHER_VERBOSE_OUTPUT +- // qDebug() << "Asking kdeinit to start" << request->name << request->arg_list ++ qDebug() << "Asking kdeinit to start" << request->name << request->arg_list + << "cmd=" << commandToString(request_header.cmd); + #endif + From 61392c13aa7518418d6b7cca24908968f424ec96d67ad7ff725351695608aaf4 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sat, 26 Jul 2014 13:04:04 +0000 Subject: [PATCH 3/6] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinit?expand=0&rev=37 --- more_verbose.patch | 64 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/more_verbose.patch b/more_verbose.patch index b25db7e..ad094d5 100644 --- a/more_verbose.patch +++ b/more_verbose.patch @@ -206,7 +206,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c } diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher/klauncher.cpp --- kinit-5.0.0/src/klauncher/klauncher.cpp 2014-07-01 20:31:22.000000000 +0200 -+++ kinit-5.0.0.new/src/klauncher/klauncher.cpp 2014-07-26 15:00:17.385754202 +0200 ++++ kinit-5.0.0.new/src/klauncher/klauncher.cpp 2014-07-26 15:02:27.770124173 +0200 @@ -65,7 +65,7 @@ // Dispose slaves after being idle for SLAVE_MAX_IDLE seconds #define SLAVE_MAX_IDLE 30 @@ -225,3 +225,65 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher << "cmd=" << commandToString(request_header.cmd); #endif +@@ -782,7 +782,7 @@ + } + + #ifdef KLAUNCHER_VERBOSE_OUTPUT +- // qDebug() << "name=" << request->name << "dbus_name=" << request->dbus_name ++ qDebug() << "name=" << request->name << "dbus_name=" << request->dbus_name + << "startup type=" << s_DBusStartupTypeToString[request->dbus_startup_type]; + #endif + +@@ -957,7 +957,7 @@ + if (request->status != KLaunchRequest::Launching) { + // Request handled. + #ifdef KLAUNCHER_VERBOSE_OUTPUT +- // qDebug() << "Request handled already"; ++ qDebug() << "Request handled already"; + #endif + requestDone(request); + continue; +@@ -1063,8 +1063,8 @@ + QString name = slaveModulePath; + #endif + +- // qDebug() << "KLauncher: launching new slave " << name << " with protocol=" << protocol +- // << " args=" << arg_list << endl; ++ qDebug() << "KLauncher: launching new slave " << name << " with protocol=" << protocol ++ << " args=" << arg_list << endl; + + #ifdef Q_OS_UNIX + #ifndef USE_KPROCESS_FOR_KIOSLAVES +@@ -1104,7 +1104,7 @@ + requestStart(request); + pid_t pid = request->pid; + +-// qDebug() << "Slave launched, pid = " << pid; ++ qDebug() << "Slave launched, pid = " << pid; + + // We don't care about this request any longer.... + requestDone(request); +@@ -1208,7 +1208,7 @@ + #ifdef USE_KPROCESS_FOR_KIOSLAVES + QProcess *p = static_cast(sender()); + QByteArray _stdout = p->readAllStandardOutput(); +- // qDebug() << _stdout.data(); ++ qDebug() << _stdout.data(); + #endif + } + +@@ -1217,12 +1217,12 @@ + { + #ifdef USE_KPROCESS_FOR_KIOSLAVES + QProcess *p = static_cast(sender()); +- // qDebug() << "process finished exitcode=" << exitCode << "exitStatus=" << exitStatus; ++ qDebug() << "process finished exitcode=" << exitCode << "exitStatus=" << exitStatus; + + foreach (KLaunchRequest *request, requestList) { + if (request->process == p) { + #ifdef KLAUNCHER_VERBOSE_OUTPUT +- // qDebug() << "found KProcess, request done"; ++ qDebug() << "found KProcess, request done"; + #endif + if (exitCode == 0 && exitStatus == QProcess::NormalExit) { + request->status = KLaunchRequest::Done; From 1248a1a47ff8930e96c1eeac6f7e573e941f3b485f2b5af1f4cc393390d35ae1 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sun, 27 Jul 2014 01:11:09 +0000 Subject: [PATCH 4/6] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinit?expand=0&rev=38 --- fpie.patch | 16 +++++++++++ kinit.changes | 7 +++++ kinit.spec | 4 +++ more_verbose.patch | 68 ++++++++++++++++++++++++---------------------- 4 files changed, 62 insertions(+), 33 deletions(-) create mode 100644 fpie.patch diff --git a/fpie.patch b/fpie.patch new file mode 100644 index 0000000..7ab4c5e --- /dev/null +++ b/fpie.patch @@ -0,0 +1,16 @@ +diff --git a/src/start_kdeinit/CMakeLists.txt b/src/start_kdeinit/CMakeLists.txt +index 56a91e3..1af14de 100644 +--- a/src/start_kdeinit/CMakeLists.txt ++++ b/src/start_kdeinit/CMakeLists.txt +@@ -2,6 +2,11 @@ add_executable(start_kdeinit start_kdeinit.c) + if (Libcap_FOUND) + target_link_libraries(start_kdeinit ${Libcap_LIBRARIES}) + endif() ++ ++set_property(TARGET start_kdeinit APPEND_STRING PROPERTY COMPILE_FLAGS " -fPIE") ++ ++set_property(TARGET start_kdeinit APPEND_STRING PROPERTY LINK_FLAGS " -pie") ++ + add_executable(start_kdeinit_wrapper start_kdeinit_wrapper.c) + + install(TARGETS start_kdeinit DESTINATION ${KF5_LIBEXEC_INSTALL_DIR}) diff --git a/kinit.changes b/kinit.changes index 5262d48..900a285 100644 --- a/kinit.changes +++ b/kinit.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sun Jul 27 01:07:34 UTC 2014 - hrvoje.senjan@gmail.com + +- Added fpie.patch: add -(f)pie link flags to start_kdeinit target +- Added more_verbose.patch: add more usefull verbosity to kdeinit5 + and klauncher + ------------------------------------------------------------------- Fri Jul 11 09:48:44 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/kinit.spec b/kinit.spec index 8f7080d..4f4f521 100644 --- a/kinit.spec +++ b/kinit.spec @@ -44,7 +44,10 @@ Group: System/GUI/KDE Url: http://www.kde.org Source: http://download.kde.org/stable/frameworks/%{version}/%{name}-%{version}.tar.xz Source1: baselibs.conf +# PATCH-FIX-OPENSUSE more_verbose.patch -- add more usefull verbosity to kdeinit5 and klauncher Patch0: more_verbose.patch +# PATCH-FIX-OPENSUSE fpie.patch -- add -(f)pie link flags to start_kdeinit target +Patch1: fpie.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -65,6 +68,7 @@ booting UNIX. Development files. %prep %setup -q %patch0 -p1 +%patch1 -p1 %build %cmake_kf5 -d build -- -DCMAKE_CXX_FLAGS="%{optflags} -fpie" -DCMAKE_C_FLAGS="%{optflags} -fpie" -DCMAKE_SHARED_LINKER_FLAGS="-pie" -DCMAKE_EXE_LINKER_FLAGS="-pie" -DCMAKE_MODULE_LINKER_FLAGS="-pie" diff --git a/more_verbose.patch b/more_verbose.patch index ad094d5..f6beec1 100644 --- a/more_verbose.patch +++ b/more_verbose.patch @@ -1,7 +1,8 @@ -diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.cpp ---- kinit-5.0.0/src/kdeinit/kinit.cpp 2014-07-01 20:31:22.000000000 +0200 -+++ kinit-5.0.0.new/src/kdeinit/kinit.cpp 2014-07-26 14:54:45.372904933 +0200 -@@ -448,7 +448,7 @@ +diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp +index 296ebfd..dedbc9c 100644 +--- a/src/kdeinit/kinit.cpp ++++ b/src/kdeinit/kinit.cpp +@@ -448,7 +448,7 @@ static void reset_oom_protect() if (write(oom_pipe, &pid, sizeof(pid_t)) > 0) { sigsuspend(&oldsigs); // wait for the signal to come } else { @@ -10,7 +11,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "Failed to reset OOM protection: %d\n", pid); #endif } -@@ -512,7 +512,7 @@ +@@ -512,7 +512,7 @@ static pid_t launch(int argc, const char *_name, const char *args, } } } @@ -19,7 +20,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: preparing to launch '%s'\n", libpath.isEmpty() ? execpath.constData() : libpath.toUtf8().constData()); #endif -@@ -742,7 +742,7 @@ +@@ -742,7 +742,7 @@ static pid_t launch(int argc, const char *_name, const char *args, d.n = read(d.fd[0], &d.result, 1); if (d.n == 1) { if (d.result == 2) { @@ -28,7 +29,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c //fprintf(stderr, "kdeinit5: no kdeinit module, trying exec....\n"); #endif exec = true; -@@ -1020,7 +1020,7 @@ +@@ -1020,7 +1020,7 @@ static void start_klauncher() sprintf(args + 5, "%d", d.launcher[1]); d.launcher_pid = launch(2, "klauncher", args); close(d.launcher[1]); @@ -37,7 +38,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Launched KLauncher, pid = %ld, result = %d\n", (long) d.launcher_pid, d.result); #endif -@@ -1036,7 +1036,7 @@ +@@ -1036,7 +1036,7 @@ static void launcher_died() } // KLauncher died... restart @@ -46,7 +47,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: KLauncher died unexpectedly.\n"); #endif // Make sure it's really dead. -@@ -1055,7 +1055,7 @@ +@@ -1055,7 +1055,7 @@ static void launcher_died() static bool handle_launcher_request(int sock, const char *who) { @@ -55,7 +56,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c klauncher_header request_header; char *request_data = 0L; -@@ -1098,7 +1098,7 @@ +@@ -1098,7 +1098,7 @@ static bool handle_launcher_request(int sock, const char *who) int avoid_loops = 0; const char *startup_id_str = "0"; // krazy:exclude=doublequote_chars @@ -64,7 +65,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Got %s '%s' from %s.\n", commandToString(request_header.cmd), name, who); -@@ -1148,7 +1148,7 @@ +@@ -1148,7 +1148,7 @@ static bool handle_launcher_request(int sock, const char *who) } if ((arg_n - request_data) != request_header.arg_length) { @@ -73,7 +74,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: EXEC request has invalid format.\n"); #endif free(request_data); -@@ -1208,13 +1208,13 @@ +@@ -1208,13 +1208,13 @@ static bool handle_launcher_request(int sock, const char *who) env_name = request_data; env_value = env_name + strlen(env_name) + 1; @@ -89,7 +90,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: SETENV request has invalid format.\n"); #endif free(request_data); -@@ -1222,14 +1222,14 @@ +@@ -1222,14 +1222,14 @@ static bool handle_launcher_request(int sock, const char *who) } qputenv(env_name, env_value); } else if (request_header.cmd == LAUNCHER_TERMINATE_KDE) { @@ -106,7 +107,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Got termination request (PID %ld).\n", (long) getpid()); #endif if (d.launcher_pid) { -@@ -1242,14 +1242,14 @@ +@@ -1242,14 +1242,14 @@ static bool handle_launcher_request(int sock, const char *who) if (children) { close(d.wrapper); d.wrapper = -1; @@ -123,7 +124,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Debug wait activated.\n"); #endif d.debug_wait = true; -@@ -1293,7 +1293,7 @@ +@@ -1293,7 +1293,7 @@ static void handle_requests(pid_t waitForPid) do { exit_pid = waitpid(-1, &exit_status, WNOHANG); if (exit_pid > 0) { @@ -132,7 +133,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: PID %ld terminated.\n", (long) exit_pid); #endif if (waitForPid && (exit_pid == waitForPid)) { -@@ -1308,7 +1308,7 @@ +@@ -1308,7 +1308,7 @@ static void handle_requests(pid_t waitForPid) child_died(exit_pid, exit_status); if (d.wrapper < 0 && !children) { @@ -141,7 +142,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Last child terminated, exiting (PID %ld).\n", (long) getpid()); #endif -@@ -1463,7 +1463,7 @@ +@@ -1463,7 +1463,7 @@ int kdeinit_xio_errhandler(Display *disp) int kdeinit_x_errhandler(Display *dpy, XErrorEvent *err) { @@ -150,7 +151,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c char errstr[256]; // kdeinit almost doesn't use X, and therefore there shouldn't be any X error XGetErrorText(dpy, err->error_code, errstr, 256); -@@ -1536,7 +1536,7 @@ +@@ -1536,7 +1536,7 @@ static int initXconnection() 0, BlackPixelOfScreen(DefaultScreenOfDisplay(X11display)), BlackPixelOfScreen(DefaultScreenOfDisplay(X11display))); @@ -159,7 +160,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: opened connection to %s\n", DisplayString(X11display)); #endif int fd = XConnectionNumber(X11display); -@@ -1595,7 +1595,7 @@ +@@ -1595,7 +1595,7 @@ mac_fork_and_reexec_self() switch (x_fork_result) { case -1: @@ -168,7 +169,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "Mac OS X workaround fork() failed!\n"); #endif ::_exit(255); -@@ -1766,7 +1766,7 @@ +@@ -1766,7 +1766,7 @@ int main(int argc, char **argv) l.setLoadHints(QLibrary::ExportExternalSymbolsHint); (void)l.load(); } @@ -177,7 +178,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c else { fprintf(stderr, "%s was not found.\n", extra_libs[i]); } -@@ -1799,7 +1799,7 @@ +@@ -1799,7 +1799,7 @@ int main(int argc, char **argv) qputenv("KDED_STARTED_BY_KDEINIT", "1"); pid = launch(1, KDED_EXENAME, 0); unsetenv("KDED_STARTED_BY_KDEINIT"); @@ -186,7 +187,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Launched KDED, pid = %ld result = %d\n", (long) pid, d.result); #endif d.kded_pid = pid; -@@ -1810,7 +1810,7 @@ +@@ -1810,7 +1810,7 @@ int main(int argc, char **argv) for (int i = 1; i < argc; i++) { if (safe_argv[i][0] == '+') { pid = launch(1, safe_argv[i] + 1, 0); @@ -195,7 +196,7 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Launched '%s', pid = %ld result = %d\n", safe_argv[i] + 1, (long) pid, d.result); #endif handle_requests(pid); -@@ -1822,7 +1822,7 @@ +@@ -1822,7 +1822,7 @@ int main(int argc, char **argv) // Ignore } else { pid = launch(1, safe_argv[i], 0); @@ -204,9 +205,10 @@ diff -Naur kinit-5.0.0/src/kdeinit/kinit.cpp kinit-5.0.0.new/src/kdeinit/kinit.c fprintf(stderr, "kdeinit5: Launched '%s', pid = %ld result = %d\n", safe_argv[i], (long) pid, d.result); #endif } -diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher/klauncher.cpp ---- kinit-5.0.0/src/klauncher/klauncher.cpp 2014-07-01 20:31:22.000000000 +0200 -+++ kinit-5.0.0.new/src/klauncher/klauncher.cpp 2014-07-26 15:02:27.770124173 +0200 +diff --git a/src/klauncher/klauncher.cpp b/src/klauncher/klauncher.cpp +index 31498e0..fbcb064 100644 +--- a/src/klauncher/klauncher.cpp ++++ b/src/klauncher/klauncher.cpp @@ -65,7 +65,7 @@ // Dispose slaves after being idle for SLAVE_MAX_IDLE seconds #define SLAVE_MAX_IDLE 30 @@ -216,7 +218,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher static const char *const s_DBusStartupTypeToString[] = { "DBusNone", "DBusUnique", "DBusMulti", "ERROR" }; -@@ -617,7 +617,7 @@ +@@ -617,7 +617,7 @@ KLauncher::requestStart(KLaunchRequest *request) request_header.arg_length = requestData.length(); #ifdef KLAUNCHER_VERBOSE_OUTPUT @@ -225,7 +227,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher << "cmd=" << commandToString(request_header.cmd); #endif -@@ -782,7 +782,7 @@ +@@ -782,7 +782,7 @@ KLauncher::start_service(KService::Ptr service, const QStringList &_urls, } #ifdef KLAUNCHER_VERBOSE_OUTPUT @@ -234,7 +236,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher << "startup type=" << s_DBusStartupTypeToString[request->dbus_startup_type]; #endif -@@ -957,7 +957,7 @@ +@@ -957,7 +957,7 @@ KLauncher::slotDequeue() if (request->status != KLaunchRequest::Launching) { // Request handled. #ifdef KLAUNCHER_VERBOSE_OUTPUT @@ -243,7 +245,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher #endif requestDone(request); continue; -@@ -1063,8 +1063,8 @@ +@@ -1063,8 +1063,8 @@ KLauncher::requestSlave(const QString &protocol, QString name = slaveModulePath; #endif @@ -254,7 +256,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher #ifdef Q_OS_UNIX #ifndef USE_KPROCESS_FOR_KIOSLAVES -@@ -1104,7 +1104,7 @@ +@@ -1104,7 +1104,7 @@ KLauncher::requestSlave(const QString &protocol, requestStart(request); pid_t pid = request->pid; @@ -263,7 +265,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher // We don't care about this request any longer.... requestDone(request); -@@ -1208,7 +1208,7 @@ +@@ -1208,7 +1208,7 @@ KLauncher::slotGotOutput() #ifdef USE_KPROCESS_FOR_KIOSLAVES QProcess *p = static_cast(sender()); QByteArray _stdout = p->readAllStandardOutput(); @@ -272,7 +274,7 @@ diff -Naur kinit-5.0.0/src/klauncher/klauncher.cpp kinit-5.0.0.new/src/klauncher #endif } -@@ -1217,12 +1217,12 @@ +@@ -1217,12 +1217,12 @@ KLauncher::slotFinished(int exitCode, QProcess::ExitStatus exitStatus) { #ifdef USE_KPROCESS_FOR_KIOSLAVES QProcess *p = static_cast(sender()); From c43d4d1cdee4460f6b7df62d3d012899e222ddf3c1f458c8f3d3d8ebed44de8c Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sun, 27 Jul 2014 01:13:22 +0000 Subject: [PATCH 5/6] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinit?expand=0&rev=39 --- kinit.changes | 1 + kinit.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/kinit.changes b/kinit.changes index 900a285..d827134 100644 --- a/kinit.changes +++ b/kinit.changes @@ -2,6 +2,7 @@ Sun Jul 27 01:07:34 UTC 2014 - hrvoje.senjan@gmail.com - Added fpie.patch: add -(f)pie link flags to start_kdeinit target + (also stop passing those flags to cmake cmdline) - Added more_verbose.patch: add more usefull verbosity to kdeinit5 and klauncher diff --git a/kinit.spec b/kinit.spec index 4f4f521..fd03d1b 100644 --- a/kinit.spec +++ b/kinit.spec @@ -71,7 +71,7 @@ booting UNIX. Development files. %patch1 -p1 %build - %cmake_kf5 -d build -- -DCMAKE_CXX_FLAGS="%{optflags} -fpie" -DCMAKE_C_FLAGS="%{optflags} -fpie" -DCMAKE_SHARED_LINKER_FLAGS="-pie" -DCMAKE_EXE_LINKER_FLAGS="-pie" -DCMAKE_MODULE_LINKER_FLAGS="-pie" + %cmake_kf5 -d build %make_jobs %install From b36ad6cb6a8e857b45d24530d6d60a7918436f4abc34fa19d7099907dc20e83f Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Sat, 2 Aug 2014 13:18:16 +0000 Subject: [PATCH 6/6] 5.1.0 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinit?expand=0&rev=40 --- kinit-5.0.0.tar.xz | 3 --- kinit-5.1.0.tar.xz | 3 +++ kinit.changes | 7 +++++++ kinit.spec | 4 ++-- 4 files changed, 12 insertions(+), 5 deletions(-) delete mode 100644 kinit-5.0.0.tar.xz create mode 100644 kinit-5.1.0.tar.xz diff --git a/kinit-5.0.0.tar.xz b/kinit-5.0.0.tar.xz deleted file mode 100644 index db3eade..0000000 --- a/kinit-5.0.0.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a77575bec3d2938fb03ba9f169f2bd0bce4ec18918a3f815f0f45359e51fa234 -size 2790544 diff --git a/kinit-5.1.0.tar.xz b/kinit-5.1.0.tar.xz new file mode 100644 index 0000000..83a55f6 --- /dev/null +++ b/kinit-5.1.0.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c6b8c7027456df25d66260be0b6d68391c9c17beaf4eedb862de1ad260915b0 +size 107332 diff --git a/kinit.changes b/kinit.changes index d827134..1549bd6 100644 --- a/kinit.changes +++ b/kinit.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Aug 2 10:20:15 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 5.1.0 + * For more details please see: + http://www.kde.org/announcements/kde-frameworks-5.1.php + ------------------------------------------------------------------- Sun Jul 27 01:07:34 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/kinit.spec b/kinit.spec index fd03d1b..b8dc22e 100644 --- a/kinit.spec +++ b/kinit.spec @@ -17,11 +17,11 @@ Name: kinit -Version: 5.0.0 +Version: 5.1.0 Release: 0 %define kf5_version %{version} BuildRequires: cmake >= 2.8.12 -BuildRequires: extra-cmake-modules >= 1.0.0 +BuildRequires: extra-cmake-modules >= 1.1.0 BuildRequires: fdupes BuildRequires: kcrash-devel >= %{kf5_version} BuildRequires: kdoctools-devel >= %{kf5_version}