mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-11 08:03:16 -04:00
sys-power/auto-cpufreq: changed pkg_postrm
Signed-off-by: Pascal Jäger <pascal.jaeger@leimstift.de>
This commit is contained in:
@@ -18,9 +18,11 @@ KEYWORDS="~amd64"
|
|||||||
SLOT="0"
|
SLOT="0"
|
||||||
IUSE="systemd"
|
IUSE="systemd"
|
||||||
|
|
||||||
RDEPEND="dev-python/psutil
|
RDEPEND="
|
||||||
|
dev-python/psutil
|
||||||
dev-python/click
|
dev-python/click
|
||||||
dev-python/distro"
|
dev-python/distro
|
||||||
|
"
|
||||||
|
|
||||||
DEPEND="${RDEPEND}"
|
DEPEND="${RDEPEND}"
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ python_install() {
|
|||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
touch /var/log/auto-cpufreq.log
|
touch /var/log/auto-cpufreq.log
|
||||||
|
|
||||||
|
elog ""
|
||||||
elog "Enable auto-cpufreq daemon service at boot:"
|
elog "Enable auto-cpufreq daemon service at boot:"
|
||||||
if use systemd; then
|
if use systemd; then
|
||||||
elog "systemctl enable --now auto-cpufreq"
|
elog "systemctl enable --now auto-cpufreq"
|
||||||
@@ -57,19 +60,23 @@ pkg_postinst() {
|
|||||||
fi
|
fi
|
||||||
elog ""
|
elog ""
|
||||||
elog "To view live log, run:"
|
elog "To view live log, run:"
|
||||||
elog "auto-cpufreq --log"
|
elog "auto-cpufreq --stats"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_postrm() {
|
pkg_postrm() {
|
||||||
# Remove auto-cpufreq log file
|
# Remove auto-cpufreq log file
|
||||||
rm /var/log/auto-cpufreq.log
|
if [ -f "/var/log/auto-cpufreq.log" ]; then
|
||||||
|
rm /var/log/auto-cpufreq.log || die
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove auto-cpufreq's cpufreqctl binary
|
# Remove auto-cpufreq's cpufreqctl binary
|
||||||
# it copies cpufreqctl.sh over (I do NOT like this behavior)
|
# it overwrites cpufreqctl.sh
|
||||||
rm /usr/bin/cpufreqctl
|
if [ -f "/usr/bin/cpufreqctl" ]; then
|
||||||
|
rm /usr/bin/cpufreqctl || die
|
||||||
|
fi
|
||||||
|
|
||||||
# Restore original cpufreqctl binary if backup was made
|
# Restore original cpufreqctl binary if backup was made
|
||||||
if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
|
if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
|
||||||
mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl
|
mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl || die
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user