Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 832350 - sys-power/apcupsd-3.14.14-r3 (and older) replaces upstream's generated apcupsd.conf with a very old static file
Summary: sys-power/apcupsd-3.14.14-r3 (and older) replaces upstream's generated apcups...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: John Einar Reitan
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-01-30 00:05 UTC by Michael Yagliyan
Modified: 2025-01-23 23:52 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Yagliyan 2022-01-30 00:05:20 UTC
I kept wondering why the version number in /etc/apcupsd/apcupsd.conf was much older than my package version, and did not seem to be affected by any changes in my USE flags (as the upstream package's apcupsd.conf.in file would seem to indicate it would), then I realized the Gentoo ebuild is replacing the file generated by the upstream package's configure step with this static copy:
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-power/apcupsd/files/apcupsd.conf

You can see this in the ebuild's src_install(), the following line:
doins "${FILESDIR}"/apcupsd.conf

The static file's Git log shows it was committed first in 2015 and never updated since:
https://gitweb.gentoo.org/repo/gentoo.git/log/sys-power/apcupsd/files/apcupsd.conf
The log messages do not indicate why it was created, and there have been several new apcupsd versions since.

Please remove this static config file and the corresponding line from the ebuild.

It may also be a good time to review whether the patches are still relevant -- they all seem to be for much older apcupsd versions and maybe they're no longer necessary (or worse, are breaking thing).
Comment 1 Michael Yagliyan 2022-01-30 03:38:06 UTC
The only setting in Gentoo's override config that seems to me like obviously a good idea is the override for the NISIP option.  Upstream's default is 0.0.0.0, but Gentoo's override of only binding to 127.0.0.1 is safer.  This could perhaps be accomplished with some kind of post-installation patch rather than a complete config replacement.
Comment 2 Conrad Kostecki gentoo-dev 2025-01-19 01:09:33 UTC
Ack. This can be easy solved by using a configure parameter. No need to copy that config.
Comment 3 Michael Yagliyan 2025-01-19 01:56:46 UTC
(In reply to Conrad Kostecki from comment #2)
> Ack. This can be easy solved by using a configure parameter. No need to copy
> that config.

Please forgive my confusion -- are you suggesting this is easily solvable for an end user, or that this is easily solvable for the ebuild maintainer(s)?
Comment 4 Conrad Kostecki gentoo-dev 2025-01-19 02:00:48 UTC
(In reply to Michael Yagliyan from comment #3)
> (In reply to Conrad Kostecki from comment #2)
> > Ack. This can be easy solved by using a configure parameter. No need to copy
> > that config.
> 
> Please forgive my confusion -- are you suggesting this is easily solvable
> for an end user, or that this is easily solvable for the ebuild
> maintainer(s)?

For the maintainer. I will finish my PR and then it will be the case, that new versions (-r4) will install generated apcupsd.conf with NISIP set to 127.0.0.1.
Comment 5 Larry the Git Cow gentoo-dev 2025-01-23 23:52:11 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85f08b2beefc799a843a3c84f309cf44a3316a93

commit 85f08b2beefc799a843a3c84f309cf44a3316a93
Author:     Conrad Kostecki <conikost@gentoo.org>
AuthorDate: 2025-01-23 23:49:58 +0000
Commit:     Conrad Kostecki <conikost@gentoo.org>
CommitDate: 2025-01-23 23:51:12 +0000

    sys-power/apcupsd: update EAPI 7 -> 8
    
    Also changed:
    * Sorted use flags
    * Use generated apcupsd.conf
    * Set NISIP via configure
    * Remove runlevel check from apcupsd.powerfail
    * Patch for LTO
    * Dropped PAGER workaround
    
    Closes: https://bugs.gentoo.org/418177
    Closes: https://bugs.gentoo.org/832350
    Closes: https://bugs.gentoo.org/941584
    Closes: https://github.com/gentoo/gentoo/pull/40199
    
    Signed-off-by: Conrad Kostecki <conikost@gentoo.org>

 sys-power/apcupsd/apcupsd-3.14.14-r4.ebuild       | 160 ++++++++++++++++++++++
 sys-power/apcupsd/files/apcupsd-3.14.14-lto.patch |  29 ++++
 sys-power/apcupsd/files/apcupsd.powerfail.init-r1 |  17 +++
 3 files changed, 206 insertions(+)