From 3e0d389dffc621741e4185fc7e0cfbd14e425276 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Wed, 11 Jul 2012 18:59:27 +0200 Subject: [PATCH] Change klaptopdamon setupHandler to use dpkg on Debian and Ubuntu (cherry picked from commit 941a9e3b8de513e4d2dbdfaec253b449f0d3d607) --- .../01-klaptopdaemon-setuphandler.diff | 35 +++++++++++++++++++ .../01-klaptopdaemon-setuphandler.diff | 35 +++++++++++++++++++ debian/squeeze/kdeutils/debian/patches/series | 2 ++ .../01-klaptopdaemon-setuphandler.diff | 35 +++++++++++++++++++ .../maverick/kdeutils/debian/patches/series | 2 ++ 5 files changed, 109 insertions(+) create mode 100644 debian/lenny/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff create mode 100644 debian/squeeze/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff create mode 100644 ubuntu/maverick/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff diff --git a/debian/lenny/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff b/debian/lenny/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff new file mode 100644 index 000000000..485164ebe --- /dev/null +++ b/debian/lenny/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff @@ -0,0 +1,35 @@ +diff --git a/klaptopdaemon/acpi.cpp b/klaptopdaemon/acpi.cpp +index 4dfb247..cd8f4b0 100644 +--- a/klaptopdaemon/acpi.cpp ++++ b/klaptopdaemon/acpi.cpp +@@ -178,7 +178,7 @@ void AcpiConfig::setupHelper() + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << "chown root "+helper+"; chmod +s "+helper; ++ proc << "dpkg-statoverride --update --add root root 6755 "+helper; + proc.start(KProcess::Block); // run it sync so has_acpi below sees the results + } + } else { +diff --git a/klaptopdaemon/apm.cpp b/klaptopdaemon/apm.cpp +index 9de0c85..e348943 100644 +--- a/klaptopdaemon/apm.cpp ++++ b/klaptopdaemon/apm.cpp +@@ -166,7 +166,7 @@ void ApmConfig::setupHelper() + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << TQString("chown root ")+apm_name+TQString("; chmod +s ")+apm_name; ++ proc << TQString("dpkg-statoverride --update --add root root 6755 ")+apm_name; + proc.start(KProcess::Block); // run it sync so has_apm below sees the results + } + } else { +@@ -200,7 +200,7 @@ void ApmConfig::setupHelper2() // we use the acpi helper to do software suspend + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << "chown root "+helper+"; chmod +s "+helper; ++ proc << "dpkg-statoverride --update --add root root 6755 "+helper; + proc.start(KProcess::Block); // run it sync so has_acpi below sees the results + } + } else { diff --git a/debian/squeeze/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff b/debian/squeeze/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff new file mode 100644 index 000000000..485164ebe --- /dev/null +++ b/debian/squeeze/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff @@ -0,0 +1,35 @@ +diff --git a/klaptopdaemon/acpi.cpp b/klaptopdaemon/acpi.cpp +index 4dfb247..cd8f4b0 100644 +--- a/klaptopdaemon/acpi.cpp ++++ b/klaptopdaemon/acpi.cpp +@@ -178,7 +178,7 @@ void AcpiConfig::setupHelper() + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << "chown root "+helper+"; chmod +s "+helper; ++ proc << "dpkg-statoverride --update --add root root 6755 "+helper; + proc.start(KProcess::Block); // run it sync so has_acpi below sees the results + } + } else { +diff --git a/klaptopdaemon/apm.cpp b/klaptopdaemon/apm.cpp +index 9de0c85..e348943 100644 +--- a/klaptopdaemon/apm.cpp ++++ b/klaptopdaemon/apm.cpp +@@ -166,7 +166,7 @@ void ApmConfig::setupHelper() + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << TQString("chown root ")+apm_name+TQString("; chmod +s ")+apm_name; ++ proc << TQString("dpkg-statoverride --update --add root root 6755 ")+apm_name; + proc.start(KProcess::Block); // run it sync so has_apm below sees the results + } + } else { +@@ -200,7 +200,7 @@ void ApmConfig::setupHelper2() // we use the acpi helper to do software suspend + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << "chown root "+helper+"; chmod +s "+helper; ++ proc << "dpkg-statoverride --update --add root root 6755 "+helper; + proc.start(KProcess::Block); // run it sync so has_acpi below sees the results + } + } else { diff --git a/debian/squeeze/kdeutils/debian/patches/series b/debian/squeeze/kdeutils/debian/patches/series index 6b3ddc8ec..f4421a4c2 100644 --- a/debian/squeeze/kdeutils/debian/patches/series +++ b/debian/squeeze/kdeutils/debian/patches/series @@ -1,3 +1,5 @@ common/04_am_maintainer_mode.diff common/06_disable_no_undefined.diff common/kubuntu_01_kdepot.diff + +01-klaptopdaemon-setuphandler.diff diff --git a/ubuntu/maverick/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff b/ubuntu/maverick/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff new file mode 100644 index 000000000..485164ebe --- /dev/null +++ b/ubuntu/maverick/kdeutils/debian/patches/01-klaptopdaemon-setuphandler.diff @@ -0,0 +1,35 @@ +diff --git a/klaptopdaemon/acpi.cpp b/klaptopdaemon/acpi.cpp +index 4dfb247..cd8f4b0 100644 +--- a/klaptopdaemon/acpi.cpp ++++ b/klaptopdaemon/acpi.cpp +@@ -178,7 +178,7 @@ void AcpiConfig::setupHelper() + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << "chown root "+helper+"; chmod +s "+helper; ++ proc << "dpkg-statoverride --update --add root root 6755 "+helper; + proc.start(KProcess::Block); // run it sync so has_acpi below sees the results + } + } else { +diff --git a/klaptopdaemon/apm.cpp b/klaptopdaemon/apm.cpp +index 9de0c85..e348943 100644 +--- a/klaptopdaemon/apm.cpp ++++ b/klaptopdaemon/apm.cpp +@@ -166,7 +166,7 @@ void ApmConfig::setupHelper() + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << TQString("chown root ")+apm_name+TQString("; chmod +s ")+apm_name; ++ proc << TQString("dpkg-statoverride --update --add root root 6755 ")+apm_name; + proc.start(KProcess::Block); // run it sync so has_apm below sees the results + } + } else { +@@ -200,7 +200,7 @@ void ApmConfig::setupHelper2() // we use the acpi helper to do software suspend + proc << kdesu; + proc << "-u"; + proc << "root"; +- proc << "chown root "+helper+"; chmod +s "+helper; ++ proc << "dpkg-statoverride --update --add root root 6755 "+helper; + proc.start(KProcess::Block); // run it sync so has_acpi below sees the results + } + } else { diff --git a/ubuntu/maverick/kdeutils/debian/patches/series b/ubuntu/maverick/kdeutils/debian/patches/series index 6b3ddc8ec..f4421a4c2 100644 --- a/ubuntu/maverick/kdeutils/debian/patches/series +++ b/ubuntu/maverick/kdeutils/debian/patches/series @@ -1,3 +1,5 @@ common/04_am_maintainer_mode.diff common/06_disable_no_undefined.diff common/kubuntu_01_kdepot.diff + +01-klaptopdaemon-setuphandler.diff