Hello community,

here is the log from the commit of package kcrash for openSUSE:Factory checked 
in at 2016-10-28 12:17:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kcrash (Old)
 and      /work/SRC/openSUSE:Factory/.kcrash.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kcrash"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kcrash/kcrash.changes    2016-09-14 
23:17:57.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kcrash.new/kcrash.changes       2016-10-28 
12:17:38.000000000 +0200
@@ -1,0 +2,9 @@
+Sun Oct  2 12:51:52 UTC 2016 - [email protected]
+
+- Update to 5.27.0
+  * CMake option KCRASH_CORE_PATTERN_RAISE to forward to kernel
+  * Change default log level from Warning to Info
+  * For more details please see:
+    https://www.kde.org/announcements/kde-frameworks-5.27.0.php
+
+-------------------------------------------------------------------

Old:
----
  kcrash-5.26.0.tar.xz

New:
----
  kcrash-5.27.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kcrash.spec ++++++
--- /var/tmp/diff_new_pack.AbTgi6/_old  2016-10-28 12:17:39.000000000 +0200
+++ /var/tmp/diff_new_pack.AbTgi6/_new  2016-10-28 12:17:39.000000000 +0200
@@ -17,9 +17,9 @@
 
 
 %define lname   libKF5Crash5
-%define _tar_path 5.26
+%define _tar_path 5.27
 Name:           kcrash
-Version:        5.26.0
+Version:        5.27.0
 Release:        0
 %define kf5_version %{version}
 BuildRequires:  cmake >= 2.8.12

++++++ kcrash-5.26.0.tar.xz -> kcrash-5.27.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/CMakeLists.txt 
new/kcrash-5.27.0/CMakeLists.txt
--- old/kcrash-5.26.0/CMakeLists.txt    2016-09-06 00:31:56.000000000 +0200
+++ new/kcrash-5.27.0/CMakeLists.txt    2016-10-02 09:51:18.000000000 +0200
@@ -3,7 +3,7 @@
 project(KCrash)
 
 include(FeatureSummary)
-find_package(ECM 5.26.0  NO_MODULE)
+find_package(ECM 5.27.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -26,8 +26,8 @@
 include(ECMSetupVersion)
 include(ECMGenerateHeaders)
 
-set(KF5_VERSION "5.26.0") # handled by release scripts
-set(KF5_DEP_VERSION "5.26.0") # handled by release scripts
+set(KF5_VERSION "5.27.0") # handled by release scripts
+set(KF5_DEP_VERSION "5.27.0") # handled by release scripts
 ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX KCrash
                         VERSION_HEADER 
"${CMAKE_CURRENT_BINARY_DIR}/kcrash_version.h"
                         PACKAGE_VERSION_FILE 
"${CMAKE_CURRENT_BINARY_DIR}/KF5CrashConfigVersion.cmake"
@@ -36,6 +36,22 @@
 find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED)
 
+# On KF5.29 we want kernel pattern raising to be default, so automate the
+# switch.
+# This can be savely removed for KF5.29+
+set(KCRASH_CORE_PATTERN_RAISE_DEFAULT ON)
+if(${KF5_VERSION} VERSION_LESS "5.29.0")
+    set(KCRASH_CORE_PATTERN_RAISE_DEFAULT OFF)
+    set(FEATURE_ADDENDUM "This will be enabled by default in 5.29.")
+endif()
+
+option(KCRASH_CORE_PATTERN_RAISE
+    "Enables raising signals to kernel core patterns (iff the pattern is a 
process). You may wish to not intall drkonqi if this can cause a UI conflict."
+    ${KCRASH_CORE_PATTERN_RAISE_DEFAULT})
+add_feature_info("Core Pattern Raising"
+    KCRASH_CORE_PATTERN_RAISE
+    "Raising signals to kernel core patterns (iff the pattern is a process). 
You may wish to not install drkonqi if this can cause a UI conflict. 
${FEATURE_ADDENDUM}")
+
 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/po)
   include(ECMPoQmTools)
   ecm_install_po_files_as_qm(po)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/autotests/CMakeLists.txt 
new/kcrash-5.27.0/autotests/CMakeLists.txt
--- old/kcrash-5.26.0/autotests/CMakeLists.txt  2016-09-06 00:31:56.000000000 
+0200
+++ new/kcrash-5.27.0/autotests/CMakeLists.txt  2016-10-02 09:51:18.000000000 
+0200
@@ -15,7 +15,11 @@
     return()
 endif()
 
+# Include src so we have access to config-kcrash.h
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/../src)
+
 ecm_add_tests(
+  coreconfigtest.cpp
   kcrashtest.cpp
   LINK_LIBRARIES Qt5::Core Qt5::Test
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/autotests/core_patterns/exec 
new/kcrash-5.27.0/autotests/core_patterns/exec
--- old/kcrash-5.26.0/autotests/core_patterns/exec      1970-01-01 
01:00:00.000000000 +0100
+++ new/kcrash-5.27.0/autotests/core_patterns/exec      2016-10-02 
09:51:18.000000000 +0200
@@ -0,0 +1 @@
+|/lib/systemd/systemd-coredump %P %u %g %s %t 1213213 %e
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/autotests/core_patterns/no-exec 
new/kcrash-5.27.0/autotests/core_patterns/no-exec
--- old/kcrash-5.26.0/autotests/core_patterns/no-exec   1970-01-01 
01:00:00.000000000 +0100
+++ new/kcrash-5.27.0/autotests/core_patterns/no-exec   2016-10-02 
09:51:18.000000000 +0200
@@ -0,0 +1 @@
+/tmp/cores/core.%e.%p.%h.%t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/autotests/coreconfigtest.cpp 
new/kcrash-5.27.0/autotests/coreconfigtest.cpp
--- old/kcrash-5.26.0/autotests/coreconfigtest.cpp      1970-01-01 
01:00:00.000000000 +0100
+++ new/kcrash-5.27.0/autotests/coreconfigtest.cpp      2016-10-02 
09:51:18.000000000 +0200
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2016 Harald Sitter <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <QTest>
+
+#include "../src/coreconfig.cpp"
+
+class CoreConfigTest : public QObject
+{
+    Q_OBJECT
+private Q_SLOTS:
+    void initTestCase() {}
+
+    void testExec()
+    {
+        KCrash::CoreConfig c(QFINDTESTDATA("core_patterns/exec"));
+#ifdef KCRASH_CORE_PATTERN_RAISE
+        QCOMPARE(c.isProcess(), true);
+#else
+        QCOMPARE(c.isProcess(), false);
+#endif
+    }
+
+    void testNoFile()
+    {
+        KCrash::CoreConfig c("/meow/kitteh/meow");
+        QCOMPARE(c.isProcess(), false);
+    }
+
+    void testNoExec()
+    {
+        KCrash::CoreConfig c(QFINDTESTDATA("core_patterns/no-exec"));
+        QCOMPARE(c.isProcess(), false);
+    }
+};
+
+QTEST_MAIN(CoreConfigTest)
+
+#include "coreconfigtest.moc"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/src/CMakeLists.txt 
new/kcrash-5.27.0/src/CMakeLists.txt
--- old/kcrash-5.26.0/src/CMakeLists.txt        2016-09-06 00:31:56.000000000 
+0200
+++ new/kcrash-5.27.0/src/CMakeLists.txt        2016-10-02 09:51:18.000000000 
+0200
@@ -1,6 +1,7 @@
 
 set(kcrash_SRCS
   kcrash.cpp
+  coreconfig.cpp
   ${kcrash_QM_LOADER}
 )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/src/config-kcrash.h.cmake 
new/kcrash-5.27.0/src/config-kcrash.h.cmake
--- old/kcrash-5.26.0/src/config-kcrash.h.cmake 2016-09-06 00:31:56.000000000 
+0200
+++ new/kcrash-5.27.0/src/config-kcrash.h.cmake 2016-10-02 09:51:18.000000000 
+0200
@@ -1,4 +1,5 @@
 #cmakedefine01 HAVE_X11
+#cmakedefine KCRASH_CORE_PATTERN_RAISE
 
 #define kde_socklen_t socklen_t
 #define CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/src/coreconfig.cpp 
new/kcrash-5.27.0/src/coreconfig.cpp
--- old/kcrash-5.26.0/src/coreconfig.cpp        1970-01-01 01:00:00.000000000 
+0100
+++ new/kcrash-5.27.0/src/coreconfig.cpp        2016-10-02 09:51:18.000000000 
+0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2016 Harald Sitter <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "coreconfig_p.h"
+
+#include <QFile>
+
+#include <config-kcrash.h>
+
+namespace KCrash {
+
+CoreConfig::CoreConfig(const QString &path)
+    : m_supported(false)
+    , m_process(false)
+{
+#ifndef KCRASH_CORE_PATTERN_RAISE
+    return; // Leave everything false unless enabled.
+#endif
+     QFile file(path);
+     if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
+         return;
+     }
+     char first = 0;
+     if (!file.getChar(&first)) {
+         return;
+     }
+     m_supported = true;
+     m_process = first == '|';
+}
+
+bool CoreConfig::isProcess() const
+{
+    return m_supported && m_process;
+}
+
+} // namespace KCrash
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/src/coreconfig_p.h 
new/kcrash-5.27.0/src/coreconfig_p.h
--- old/kcrash-5.26.0/src/coreconfig_p.h        1970-01-01 01:00:00.000000000 
+0100
+++ new/kcrash-5.27.0/src/coreconfig_p.h        2016-10-02 09:51:18.000000000 
+0200
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 Harald Sitter <[email protected]>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KCRASH_CORECONFIG_H
+#define KCRASH_CORECONFIG_H
+
+#include <QString>
+
+namespace KCrash {
+
+class CoreConfig
+{
+public:
+    CoreConfig(const QString &path = 
QStringLiteral("/proc/sys/kernel/core_pattern"));
+
+    bool isProcess() const;
+
+private:
+    bool m_supported;
+    bool m_process;
+};
+
+} // namespace KCrash
+
+#endif // KCRASH_CORECONFIG_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kcrash-5.26.0/src/kcrash.cpp 
new/kcrash-5.27.0/src/kcrash.cpp
--- old/kcrash-5.26.0/src/kcrash.cpp    2016-09-06 00:31:56.000000000 +0200
+++ new/kcrash-5.27.0/src/kcrash.cpp    2016-10-02 09:51:18.000000000 +0200
@@ -57,12 +57,8 @@
 #include <QLoggingCategory>
 Q_DECLARE_LOGGING_CATEGORY(LOG_KCRASH)
 
-#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
-// logging category for this framework, default: log stuff >= warning
-Q_LOGGING_CATEGORY(LOG_KCRASH, "org.kde.kcrash", QtWarningMsg)
-#else
-Q_LOGGING_CATEGORY(LOG_KCRASH, "org.kde.kcrash")
-#endif
+// logging category for this framework, default: log stuff >= info
+Q_LOGGING_CATEGORY(LOG_KCRASH, "org.kde.kcrash", QtInfoMsg)
 
 #if HAVE_X11
 #include <qx11info_x11.h>
@@ -79,6 +75,8 @@
 #include <ucontext.h>
 #endif
 
+#include "coreconfig_p.h"
+
 // Copy from klauncher_cmds
 typedef struct {
     long cmd;
@@ -105,6 +103,7 @@
 static char *s_kdeinit_socket_file = 0;
 static KCrash::CrashFlags s_flags = 0;
 static int s_launchDrKonqi = -1; // -1=initial value 0=disabled 1=enabled
+Q_GLOBAL_STATIC(KCrash::CoreConfig, s_coreConfig)
 
 static void kcrashInitialize()
 {
@@ -135,6 +134,8 @@
     }
 
     KCrash::setApplicationFilePath(QCoreApplication::applicationFilePath());
+
+    s_coreConfig(); // Initialize.
 }
 
 void
@@ -531,6 +532,13 @@
         fprintf(stderr, "Unable to start Dr. Konqi\n");
     }
 
+    if (s_coreConfig->isProcess()) {
+        fprintf(stderr, "Re-raising signal for core dump handling.\n");
+        KCrash::setCrashHandler(0);
+        raise(sig);
+        // not getting here
+    }
+
     _exit(255);
 }
 
@@ -650,7 +658,10 @@
                 sleep(1);
             }
         }
-        _exit(253);
+        if (!s_coreConfig->isProcess()) {
+            // Only exit if we don't forward to core dumps
+            _exit(253);
+        }
     }
 
     return (pid > 0); //return true on success


Reply via email to