commit: c16943af6813fb7de5a282c2d94ecc118c3bea26
Author: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Tue Aug 13 15:29:35 2024 +0000
Commit: Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
CommitDate: Tue Aug 13 15:34:15 2024 +0000
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c16943af
sys-power/auto-cpufreq: delete all rogue files created by package
The rogue creation of files in /usr/bin should be reported upstream..
This commit also ensures operation of ${EROOT} instead of /.
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
sys-power/auto-cpufreq/auto-cpufreq-2.1.0-r1.ebuild | 18 +++++++++---------
sys-power/auto-cpufreq/auto-cpufreq-2.2.0.ebuild | 21 +++++++++++----------
sys-power/auto-cpufreq/auto-cpufreq-2.3.0.ebuild | 21 +++++++++++----------
3 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/sys-power/auto-cpufreq/auto-cpufreq-2.1.0-r1.ebuild
b/sys-power/auto-cpufreq/auto-cpufreq-2.1.0-r1.ebuild
index dddb0042b..4ee9f6f69 100644
--- a/sys-power/auto-cpufreq/auto-cpufreq-2.1.0-r1.ebuild
+++ b/sys-power/auto-cpufreq/auto-cpufreq-2.1.0-r1.ebuild
@@ -66,18 +66,18 @@ pkg_postinst() {
pkg_postrm() {
# Remove auto-cpufreq log file
- if [ -f "/var/log/auto-cpufreq.log" ]; then
- rm /var/log/auto-cpufreq.log || die
+ if [ -f "${EROOT}/var/log/auto-cpufreq.log" ]; then
+ rm "${EROOT}"/var/log/auto-cpufreq.log || die
fi
- # Remove auto-cpufreq's cpufreqctl binary
- # it overwrites cpufreqctl.sh
- if [ -f "/usr/bin/cpufreqctl" ]; then
- rm /usr/bin/cpufreqctl || die
+ # Restore original cpufreqctl binary if backup was made
+ if [ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
+ mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
fi
- # Restore original cpufreqctl binary if backup was made
- if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
- mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl ||
die
+ # Remove auto-cpufreq's cpufreqctl binary
+ # it overwrites cpufreqctl.sh
+ if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
+ rm "${EROOT}"/usr/bin/cpufreqctl || die
fi
}
diff --git a/sys-power/auto-cpufreq/auto-cpufreq-2.2.0.ebuild
b/sys-power/auto-cpufreq/auto-cpufreq-2.2.0.ebuild
index 7a1ac03d1..da618f3c9 100644
--- a/sys-power/auto-cpufreq/auto-cpufreq-2.2.0.ebuild
+++ b/sys-power/auto-cpufreq/auto-cpufreq-2.2.0.ebuild
@@ -121,21 +121,22 @@ pkg_postrm() {
xdg_desktop_database_update
# Remove the override.pickle file and directory
- if [[ -d "/var/lib/auto-cpufreq" ]]; then
- rm -rf /var/lib/auto-cpufreq
+ if [[ -d "${EROOT}/var/lib/auto-cpufreq" ]]; then
+ rm -rf "${EROOT}"/var/lib/auto-cpufreq || die
fi
# Remove auto-cpufreq log file
- if [ -f "/var/log/auto-cpufreq.log" ]; then
- rm /var/log/auto-cpufreq.log || die
+ if [ -f "${EROOT}/var/log/auto-cpufreq.log" ]; then
+ rm "${EROOT}"/var/log/auto-cpufreq.log || die
+ fi
+
+ # Restore original cpufreqctl binary if backup was made
+ if [ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
+ mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
fi
# Remove auto-cpufreq's cpufreqctl binary
# it overwrites cpufreqctl.sh
- if [ -f "/usr/bin/cpufreqctl" ]; then
- rm /usr/bin/cpufreqctl || die
- fi
- # Restore original cpufreqctl binary if backup was made
- if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
- mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl ||
die
+ if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
+ rm "${EROOT}"/usr/bin/cpufreqctl || die
fi
}
diff --git a/sys-power/auto-cpufreq/auto-cpufreq-2.3.0.ebuild
b/sys-power/auto-cpufreq/auto-cpufreq-2.3.0.ebuild
index 7a1ac03d1..da618f3c9 100644
--- a/sys-power/auto-cpufreq/auto-cpufreq-2.3.0.ebuild
+++ b/sys-power/auto-cpufreq/auto-cpufreq-2.3.0.ebuild
@@ -121,21 +121,22 @@ pkg_postrm() {
xdg_desktop_database_update
# Remove the override.pickle file and directory
- if [[ -d "/var/lib/auto-cpufreq" ]]; then
- rm -rf /var/lib/auto-cpufreq
+ if [[ -d "${EROOT}/var/lib/auto-cpufreq" ]]; then
+ rm -rf "${EROOT}"/var/lib/auto-cpufreq || die
fi
# Remove auto-cpufreq log file
- if [ -f "/var/log/auto-cpufreq.log" ]; then
- rm /var/log/auto-cpufreq.log || die
+ if [ -f "${EROOT}/var/log/auto-cpufreq.log" ]; then
+ rm "${EROOT}"/var/log/auto-cpufreq.log || die
+ fi
+
+ # Restore original cpufreqctl binary if backup was made
+ if [ -f "${EROOT}/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
+ mv "${EROOT}"/usr/bin/cpufreqctl.auto-cpufreq{.bak,} || die
fi
# Remove auto-cpufreq's cpufreqctl binary
# it overwrites cpufreqctl.sh
- if [ -f "/usr/bin/cpufreqctl" ]; then
- rm /usr/bin/cpufreqctl || die
- fi
- # Restore original cpufreqctl binary if backup was made
- if [ -f "/usr/bin/cpufreqctl.auto-cpufreq.bak" ]; then
- mv /usr/bin/cpufreqctl.auto-cpufreq.bak /usr/bin/cpufreqctl ||
die
+ if [ -f "${EROOT}/usr/bin/cpufreqctl" ]; then
+ rm "${EROOT}"/usr/bin/cpufreqctl || die
fi
}