From c4124a604d66f03434f3d60a60f13d4e56075a3cb717d6d35fa5cef528a11747 Mon Sep 17 00:00:00 2001 From: Hrvoje Senjan Date: Fri, 26 Sep 2014 14:22:08 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/libksysguard5?expand=0&rev=16 --- libksysguard-5.0.1.tar.xz | 3 - libksysguard-5.0.95.tar.xz | 3 + libksysguard5-rpmlintrc | 2 + libksysguard5.changes | 10 ++ libksysguard5.spec | 12 +- libksysguard_kauth.diff | 339 ------------------------------------- 6 files changed, 23 insertions(+), 346 deletions(-) delete mode 100644 libksysguard-5.0.1.tar.xz create mode 100644 libksysguard-5.0.95.tar.xz create mode 100644 libksysguard5-rpmlintrc delete mode 100644 libksysguard_kauth.diff diff --git a/libksysguard-5.0.1.tar.xz b/libksysguard-5.0.1.tar.xz deleted file mode 100644 index af27566..0000000 --- a/libksysguard-5.0.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9310053daebf26faa22d47bbe7b0736dfff206ac20220c4d34037607627db4f -size 550820 diff --git a/libksysguard-5.0.95.tar.xz b/libksysguard-5.0.95.tar.xz new file mode 100644 index 0000000..0518890 --- /dev/null +++ b/libksysguard-5.0.95.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b166743171cd32224265ba513dcb55be3fa8e363fbf421d6c93ee54f4ec52394 +size 544132 diff --git a/libksysguard5-rpmlintrc b/libksysguard5-rpmlintrc new file mode 100644 index 0000000..cc4ae51 --- /dev/null +++ b/libksysguard5-rpmlintrc @@ -0,0 +1,2 @@ +# we don't use find_lang macro as it doesn't searches in subdirectories +addFilter("file-not-in-%lang .*") \ No newline at end of file diff --git a/libksysguard5.changes b/libksysguard5.changes index 3e03d61..193835e 100644 --- a/libksysguard5.changes +++ b/libksysguard5.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Sep 26 14:18:50 UTC 2014 - hrvoje.senjan@gmail.com + +- Update to 5.0.95: + * Return of the KAuth helper +- Drop libksysguard_kauth.diff, merged upstream +- Install translations +- Add rpmlintrc file for file-not-in-%lang warnings: we don't use + find_lang macro as it doesn't searches in subdirectories + ------------------------------------------------------------------- Mon Aug 11 20:58:27 UTC 2014 - hrvoje.senjan@gmail.com diff --git a/libksysguard5.spec b/libksysguard5.spec index f220fcb..82b1987 100644 --- a/libksysguard5.spec +++ b/libksysguard5.spec @@ -17,16 +17,15 @@ Name: libksysguard5 -Version: 5.0.1 +Version: 5.0.95 Release: 0 Summary: Task management and system monitoring library License: GPL-2.0+ Group: Development/Libraries/C and C++ Url: http://www.kde.org -Source: http://download.kde.org/stable/plasma/%{version}/libksysguard-%{version}.tar.xz +Source: libksysguard-%{version}.tar.xz Source1: baselibs.conf -# PATCH-FIX-UPSTREAM libksysguard_kauth.diff -- re-enables KAuth usage within (lib)ksysguard (e.g. process killing, niceness, etc) -Patch0: libksysguard_kauth.diff +Source99: %{name}-rpmlintrc BuildRequires: extra-cmake-modules >= 0.0.9 BuildRequires: gcc-c++ BuildRequires: kconfig-devel @@ -72,6 +71,7 @@ Conflicts: kdebase4-workspace Task management and system monitoring library. This package contains helper files for actions that require elevated privileges. +%lang_package %prep %setup -q -n libksysguard-%{version} %patch0 -p1 @@ -116,4 +116,8 @@ for actions that require elevated privileges. %{_kf5_libdir}/libprocesscore.so %{_kf5_libdir}/libprocessui.so +%files lang +%defattr(-,root,root) +%{_kf5_localedir}/ + %changelog diff --git a/libksysguard_kauth.diff b/libksysguard_kauth.diff deleted file mode 100644 index 0253613..0000000 --- a/libksysguard_kauth.diff +++ /dev/null @@ -1,339 +0,0 @@ -diff --git a/processcore/CMakeLists.txt b/processcore/CMakeLists.txt -index 9fef4ec..939d055 100644 ---- a/processcore/CMakeLists.txt -+++ b/processcore/CMakeLists.txt -@@ -41,18 +41,18 @@ install( FILES processes.h process.h DESTINATION ${INCLUDE_INSTALL_DIR}/ksysguar - #------ KAuth stuff - - # Auth example helper --# set(ksysguardprocesslist_helper_srcs --# helper.cpp --# process.cpp --# processes_local_p.cpp --# processes_base_p.cpp) --# --# add_executable(ksysguardprocesslist_helper ${ksysguardprocesslist_helper_srcs}) --# target_link_libraries(ksysguardprocesslist_helper ) --# install(TARGETS ksysguardprocesslist_helper DESTINATION ${LIBEXEC_INSTALL_DIR}) --# --# kauth_install_helper_files(ksysguardprocesslist_helper org.kde.ksysguard.processlisthelper root) --# kauth_install_actions(org.kde.ksysguard.processlisthelper actions.actions) --# --# set_target_properties(ksysguardprocesslist_helper PROPERTIES COMPILE_FLAGS "-Wall -ggdb") -+set(ksysguardprocesslist_helper_srcs -+ helper.cpp -+ process.cpp -+ processes_local_p.cpp -+ processes_base_p.cpp) -+ -+add_executable(ksysguardprocesslist_helper ${ksysguardprocesslist_helper_srcs}) -+target_link_libraries(ksysguardprocesslist_helper Qt5::Core KF5::Auth KF5::I18n) -+install(TARGETS ksysguardprocesslist_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR}) -+ -+kauth_install_helper_files(ksysguardprocesslist_helper org.kde.ksysguard.processlisthelper root) -+kauth_install_actions(org.kde.ksysguard.processlisthelper actions.actions) -+ -+set_target_properties(ksysguardprocesslist_helper PROPERTIES COMPILE_FLAGS "-Wall -ggdb") - -diff --git a/processcore/helper.cpp b/processcore/helper.cpp -index 6c1f570..c34ab1e 100644 ---- a/processcore/helper.cpp -+++ b/processcore/helper.cpp -@@ -23,24 +23,26 @@ - #include "helper.h" - #include "processes_local_p.h" - -+using namespace KAuth; -+ - KSysGuardProcessListHelper::KSysGuardProcessListHelper() - { - qRegisterMetaType >(); - } - - /* The functions here run as ROOT. So be careful. DO NOT TRUST THE INPUTS TO BE SANE. */ --#define GET_PID(i) parameters.value(QString("pid%1").arg(i), -1).toULongLong(); if(pid < 0) return KAuth::ActionReply::HelperErrorReply; --KAuth::ActionReply KSysGuardProcessListHelper::sendsignal(QVariantMap parameters) { -- KAuth::ActionReply errorReply(KAuth::ActionReply::HelperError); -+#define GET_PID(i) parameters.value(QString("pid%1").arg(i), -1).toULongLong(); if(pid < 0) return ActionReply(ActionReply::HelperErrorType); -+ActionReply KSysGuardProcessListHelper::sendsignal(QVariantMap parameters) { -+ ActionReply reply(ActionReply::HelperErrorType); - if(!parameters.contains("signal")) { -- errorReply.setErrorDescription("Internal error - no signal parameter was passed to the helper"); -- errorReply.setErrorCode(1); -- return errorReply; -+ reply.setErrorDescription("Internal error - no signal parameter was passed to the helper"); -+ reply.setErrorCode(static_cast(1)); -+ return reply; - } - if(!parameters.contains("pidcount")) { -- errorReply.setErrorDescription("Internal error - no pidcount parameter was passed to the helper"); -- errorReply.setErrorCode(2); -- return errorReply; -+ reply.setErrorDescription("Internal error - no pidcount parameter was passed to the helper"); -+ reply.setErrorCode(static_cast(2)); -+ return reply; - } - - KSysGuard::ProcessesLocal processes; -@@ -56,17 +58,17 @@ KAuth::ActionReply KSysGuardProcessListHelper::sendsignal(QVariantMap parameters - success = successForThisPid && success; - } - if(success) { -- return KAuth::ActionReply::SuccessReply; -+ return ActionReply::SuccessReply(); - } else { -- errorReply.setErrorDescription(QString("Could not send signal to: ") + errorList.join(", ")); -- errorReply.setErrorCode(0); -- return errorReply; -+ reply.setErrorDescription(QString("Could not send signal to: ") + errorList.join(", ")); -+ reply.setErrorCode(static_cast(0)); -+ return reply; - } - } - --KAuth::ActionReply KSysGuardProcessListHelper::renice(QVariantMap parameters) { -+ActionReply KSysGuardProcessListHelper::renice(QVariantMap parameters) { - if(!parameters.contains("nicevalue") || !parameters.contains("pidcount")) -- return KAuth::ActionReply::HelperErrorReply; -+ return ActionReply(ActionReply::HelperErrorType); - - KSysGuard::ProcessesLocal processes; - int niceValue = qvariant_cast(parameters.value("nicevalue")); -@@ -77,14 +79,14 @@ KAuth::ActionReply KSysGuardProcessListHelper::renice(QVariantMap parameters) { - success = processes.setNiceness(pid, niceValue) && success; - } - if(success) -- return KAuth::ActionReply::SuccessReply; -+ return ActionReply::SuccessReply(); - else -- return KAuth::ActionReply::HelperErrorReply; -+ return ActionReply(ActionReply::HelperErrorType); - } - --KAuth::ActionReply KSysGuardProcessListHelper::changeioscheduler(QVariantMap parameters) { -+ActionReply KSysGuardProcessListHelper::changeioscheduler(QVariantMap parameters) { - if(!parameters.contains("ioScheduler") || !parameters.contains("ioSchedulerPriority") || !parameters.contains("pidcount")) -- return KAuth::ActionReply::HelperErrorReply; -+ return ActionReply(ActionReply::HelperErrorType); - - KSysGuard::ProcessesLocal processes; - int ioScheduler = qvariant_cast(parameters.value("ioScheduler")); -@@ -96,14 +98,14 @@ KAuth::ActionReply KSysGuardProcessListHelper::changeioscheduler(QVariantMap par - success = processes.setIoNiceness(pid, ioScheduler, ioSchedulerPriority) && success; - } - if(success) -- return KAuth::ActionReply::SuccessReply; -+ return ActionReply::SuccessReply(); - else -- return KAuth::ActionReply::HelperErrorReply; -+ return ActionReply(ActionReply::HelperErrorType); - - } --KAuth::ActionReply KSysGuardProcessListHelper::changecpuscheduler(QVariantMap parameters) { -+ActionReply KSysGuardProcessListHelper::changecpuscheduler(QVariantMap parameters) { - if(!parameters.contains("cpuScheduler") || !parameters.contains("cpuSchedulerPriority") || !parameters.contains("pidcount")) -- return KAuth::ActionReply::HelperErrorReply; -+ return ActionReply(ActionReply::HelperErrorType); - - KSysGuard::ProcessesLocal processes; - int cpuScheduler = qvariant_cast(parameters.value("cpuScheduler")); -@@ -116,9 +118,9 @@ KAuth::ActionReply KSysGuardProcessListHelper::changecpuscheduler(QVariantMap pa - success = processes.setScheduler(pid, cpuScheduler, cpuSchedulerPriority) && success; - } - if(success) -- return KAuth::ActionReply::SuccessReply; -+ return ActionReply::SuccessReply(); - else -- return KAuth::ActionReply::HelperErrorReply; -+ return ActionReply(ActionReply::HelperErrorType); - - } - KAUTH_HELPER_MAIN("org.kde.ksysguard.processlisthelper", KSysGuardProcessListHelper) -diff --git a/processcore/processes_linux_p.cpp b/processcore/processes_linux_p.cpp -index 65b8dfd..0cff0e8 100644 ---- a/processcore/processes_linux_p.cpp -+++ b/processcore/processes_linux_p.cpp -@@ -22,7 +22,7 @@ - #include "processes_local_p.h" - #include "process.h" - --#include -+#include - - #include - #include -diff --git a/processui/ksysguardprocesslist.cpp b/processui/ksysguardprocesslist.cpp -index 1651a0a..ba9d8c9 100644 ---- a/processui/ksysguardprocesslist.cpp -+++ b/processui/ksysguardprocesslist.cpp -@@ -48,6 +48,9 @@ - #include //For SIGTERM - - #include -+#include -+#include -+#include - #include - #include - #include -@@ -188,7 +191,7 @@ struct KSysGuardProcessListPrivate { - int totalRowCount(const QModelIndex &parent) const; - - /** Helper function to setup 'action' with the given pids */ -- void setupKAuthAction(KAuth::Action *action, const QList & pids) const; -+ void setupKAuthAction(KAuth::Action &action, const QList & pids) const; - - /** fire a timer event if we are set to use our internal timer*/ - void fireTimerEvent(); -@@ -392,15 +395,15 @@ int KSysGuardProcessListPrivate::totalRowCount(const QModelIndex &parent ) const - return total; - } - --void KSysGuardProcessListPrivate::setupKAuthAction(KAuth::Action *action, const QList & pids) const -+void KSysGuardProcessListPrivate::setupKAuthAction(KAuth::Action &action, const QList & pids) const - { -- action->setHelperId("org.kde.ksysguard.processlisthelper"); -+ action.setHelperId("org.kde.ksysguard.processlisthelper"); - - int processCount = pids.count(); - for(int i = 0; i < processCount; i++) { -- action->addArgument(QString("pid%1").arg(i), pids[i]); -+ action.addArgument(QString("pid%1").arg(i), pids[i]); - } -- action->addArgument("pidcount", processCount); -+ action.addArgument("pidcount", processCount); - } - void KSysGuardProcessList::selectionChanged() - { -@@ -1023,23 +1026,19 @@ bool KSysGuardProcessList::reniceProcesses(const QList &pids, int nic - - - #warning KAuth needs porting, but docu is not adjusted, no idea how to do it --#if 0 -- KAuth::Action *action = new KAuth::Action("org.kde.ksysguard.processlisthelper.renice"); -- action->setParentWidget(window()); -+ KAuth::Action action("org.kde.ksysguard.processlisthelper.renice"); -+ action.setParentWidget(window()); - d->setupKAuthAction( action, unreniced_pids); -- action->addArgument("nicevalue", niceValue); -- KAuth::ActionReply reply = action->execute(); -+ action.addArgument("nicevalue", niceValue); -+ KAuth::ExecuteJob *job = action.execute(); - -- if (reply == KAuth::ActionReply::SuccessReply) { -+ if (job->exec()) { - updateList(); -- delete action; -- } else if (reply != KAuth::ActionReply::UserCancelled && reply != KAuth::ActionReply::AuthorizationDenied) { -+ } else if (!job->exec()) { - KMessageBox::sorry(this, i18n("You do not have the permission to renice the process and there " -- "was a problem trying to run as root. Error %1 %2", reply.errorCode(), reply.errorDescription())); -- delete action; -+ "was a problem trying to run as root. Error %1 %2", job->error(), job->errorString())); - return false; - } --#endif - return true; - } - -@@ -1189,26 +1188,22 @@ bool KSysGuardProcessList::changeIoScheduler(const QList< long long> &pids, KSys - if(!d->mModel.isLocalhost()) return false; //We can't use kauth to affect non-localhost processes - - #warning KAuth needs porting, but docu is not adjusted, no idea how to do it --#if 0 -- KAuth::Action *action = new KAuth::Action("org.kde.ksysguard.processlisthelper.changeioscheduler"); -- action->setParentWidget(window()); -+ KAuth::Action action("org.kde.ksysguard.processlisthelper.changeioscheduler"); -+ action.setParentWidget(window()); - - d->setupKAuthAction( action, unchanged_pids); -- action->addArgument("ioScheduler", (int)newIoSched); -- action->addArgument("ioSchedulerPriority", newIoSchedPriority); -+ action.addArgument("ioScheduler", (int)newIoSched); -+ action.addArgument("ioSchedulerPriority", newIoSchedPriority); - -- KAuth::ActionReply reply = action->execute(); -+ KAuth::ExecuteJob *job = action.execute(); - -- if (reply == KAuth::ActionReply::SuccessReply) { -+ if (job->exec()) { - updateList(); -- delete action; -- } else if (reply != KAuth::ActionReply::UserCancelled && reply != KAuth::ActionReply::AuthorizationDenied) { -+ } else if (!job->exec()) { - KMessageBox::sorry(this, i18n("You do not have the permission to change the I/O priority of the process and there " -- "was a problem trying to run as root. Error %1 %2", reply.errorCode(), reply.errorDescription())); -- delete action; -+ "was a problem trying to run as root. Error %1 %2", job->error(), job->errorString())); - return false; - } --#endif - return true; - } - -@@ -1226,24 +1221,20 @@ bool KSysGuardProcessList::changeCpuScheduler(const QList< long long> &pids, KSy - if(!d->mModel.isLocalhost()) return false; //We can't use KAuth to affect non-localhost processes - - #warning KAuth needs porting, but docu is not adjusted, no idea how to do it --#if 0 -- KAuth::Action *action = new KAuth::Action("org.kde.ksysguard.processlisthelper.changecpuscheduler"); -- action->setParentWidget(window()); -+ KAuth::Action action("org.kde.ksysguard.processlisthelper.changecpuscheduler"); -+ action.setParentWidget(window()); - d->setupKAuthAction( action, unchanged_pids); -- action->addArgument("cpuScheduler", (int)newCpuSched); -- action->addArgument("cpuSchedulerPriority", newCpuSchedPriority); -- KAuth::ActionReply reply = action->execute(); -+ action.addArgument("cpuScheduler", (int)newCpuSched); -+ action.addArgument("cpuSchedulerPriority", newCpuSchedPriority); -+ KAuth::ExecuteJob *job = action.execute(); - -- if (reply == KAuth::ActionReply::SuccessReply) { -+ if (job->exec()) { - updateList(); -- delete action; -- } else if (reply != KAuth::ActionReply::UserCancelled && reply != KAuth::ActionReply::AuthorizationDenied) { -+ } else if (!job->exec()) { - KMessageBox::sorry(this, i18n("You do not have the permission to change the CPU Scheduler for the process and there " -- "was a problem trying to run as root. Error %1 %2", reply.errorCode(), reply.errorDescription())); -- delete action; -+ "was a problem trying to run as root. Error %1 %2", job->error(), job->errorString())); - return false; - } --#endif - return true; - } - -@@ -1262,26 +1253,20 @@ bool KSysGuardProcessList::killProcesses(const QList< long long> &pids, int sig) - if(!d->mModel.isLocalhost()) return false; //We can't elevate privileges to kill non-localhost processes - - #warning KAuth needs porting, but docu is not adjusted, no idea how to do it --#if 0 - KAuth::Action action("org.kde.ksysguard.processlisthelper.sendsignal"); - action.setParentWidget(window()); -- d->setupKAuthAction( &action, unkilled_pids); -+ //action.setHelperId("org.kde.ksysguard.processlisthelper"); -+ d->setupKAuthAction( action, unkilled_pids); - action.addArgument("signal", sig); -- KAuth::ActionReply reply = action.execute(); -+ KAuth::ExecuteJob *job = action.execute(); - -- if (reply == KAuth::ActionReply::SuccessReply) { -+ if (job->exec()) { - updateList(); -- } else if (reply.type() == KAuth::ActionReply::HelperError) { -- if (reply.errorCode() > 0) -- KMessageBox::sorry(this, i18n("You do not have the permission to kill the process and there " -- "was a problem trying to run as root. %1", reply.errorDescription())); -- return false; -- } else if (reply != KAuth::ActionReply::UserCancelled && reply != KAuth::ActionReply::AuthorizationDenied) { -+ } else if (!job->exec()) { - KMessageBox::sorry(this, i18n("You do not have the permission to kill the process and there " -- "was a problem trying to run as root. Error %1 %2", reply.errorCode(), reply.errorDescription())); -+ "was a problem trying to run as root. Error %1 %2", job->error(), job->errorString())); - return false; - } --#endif - return true; - } -