Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655234 - sys-apps/mlocate-0.26-r2: add an optional dependency on sys-power/powermgmt-base
Summary: sys-apps/mlocate-0.26-r2: add an optional dependency on sys-power/powermgmt-base
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
Depends on:
Reported: 2018-05-07 23:57 UTC by selurvedu
Modified: 2018-05-09 06:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description selurvedu 2018-05-07 23:57:25 UTC
$ cat /etc/cron.daily/mlocate
#! /bin/sh
set -e

# check if we run on battery and if so then don't run
if which on_ac_power >/dev/null 2>&1; then
	on_ac_power >/dev/null 2>&1 || ON_BATTERY=$?
	if [ "${ON_BATTERY}" -eq 1 ]; then
			exit 0


My system did not have the on_ac_power script installed, so the above cron script was unable to detect whether the laptop is running on battery (`which` never succeeded, so no checks were performed).

I think that the sys-apps/mlocate ebuild should either write a post-install message about an optional dependency to let the user decide whether he needs that kind of check, or there should be a corresponding USE flag.