Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 841677 - =sys-apps/etckeeper-1.18.16-r1: double prefix files installed
Summary: =sys-apps/etckeeper-1.18.16-r1: double prefix files installed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Georgy Yakovlev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-29 11:54 UTC by Marek Szuba (RETIRED)
Modified: 2022-05-20 04:01 UTC (History)
1 user (show)

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


Attachments
prefix patch attempt (0001-sys-apps-etckeeper-fix-unit-installation-on-prefix.patch,1.15 KB, patch)
2022-05-01 05:00 UTC, Georgy Yakovlev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Szuba (RETIRED) archtester gentoo-dev 2022-04-29 11:54:52 UTC
There is a sed call in src_prepare() which replaces the hard-coded "/lib/systemd/system" in the upstream Makefile with the output of systemd_get_systemunitdir(). In a Prefix environment, this will already include EPREFIX. Unfortunately when src_install() attempts to install systemd units their destination path is prefixed with DESTDIR - which also includes EPREFIX. This triggers a "double prefix" QA violation in a Prefix environment, which by default prevents sys-apps/etckeeper from being installed.

Seeing as the systemd.eclass functions returning unprefixed paths are strictly internal, the easiest way of fixing this is probably to patch the upstream Makefile not to prepend $(DESTDIR) to $(systemddir).
Comment 1 Marek Szuba (RETIRED) archtester gentoo-dev 2022-04-29 11:57:42 UTC
Minor correction, EPREFIX is of course ALWAYS included and the difference the Prefix environment makes is that said variable is not an empty string there.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-29 17:13:51 UTC
Including the errors would make it easier to fix without a prefix install.
Comment 3 Marek Szuba (RETIRED) archtester gentoo-dev 2022-04-30 08:52:44 UTC
(In reply to Sam James from comment #2)
> Including the errors would make it easier to fix without a prefix install.

Surely a Gentoo developer provided with a detailed description of the problem, including references to specific bits of code ("systemd_get_systemunitdir" in the ebuild on the one hand and "$(DESTDIR)/$(systemddir)" on the other, in case it wasn't clear enough before) is able to confirm the fact EPREFIX ends up being injected twice? Not to mention that the error message would not IMHO be of much use to people without a prefix install because it is hard (I suppose some manual EPREFIX hackery might work) to reproduce without a prefix install.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-04-30 10:49:26 UTC
It's easier for some people to work with an error message than parsing text. It's cheap to provide is all.
Comment 5 Marek Szuba (RETIRED) archtester gentoo-dev 2022-04-30 17:57:27 UTC
(In reply to Marek Szuba from comment #0)

> Seeing as the systemd.eclass functions returning unprefixed paths are
> strictly internal, the easiest way of fixing this is probably to patch the
> upstream Makefile not to prepend $(DESTDIR) to $(systemddir).

...except it is not because it removes both EPREFIX and D from the install path and we do need the latter. Guess it's up to gyakovlev to decide how he wants to handle this.
Comment 6 Georgy Yakovlev archtester gentoo-dev 2022-05-01 04:55:36 UTC
it's easier to work with both detailed explanation and a log from prefix system =)
thanks for digging it.

I don't use prefix so I get the part that it's pointless to include log from normal system.


I think the way to go is

local systemdunitdir="$(systemd_get_systemunitdir)"
systemdunitdir="${systemdunitdir#${EPREFIX%/}}"


and use that in the sed call.
Comment 7 Georgy Yakovlev archtester gentoo-dev 2022-05-01 05:00:11 UTC
Created attachment 775718 [details, diff]
prefix patch attempt

mind testing?

it's completely untested by me and written blindly, main dev machine is down right now.
Comment 8 Larry the Git Cow gentoo-dev 2022-05-20 04:01:44 UTC
The bug has been closed via the following commit(s):

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

commit dad82284b99709594e39d8f912df2755be0225cb
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-05-01 04:58:41 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-05-20 04:01:26 +0000

    sys-apps/etckeeper: fix unit installation on prefix
    
    Closes: https://bugs.gentoo.org/841677
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 sys-apps/etckeeper/etckeeper-1.18.16-r1.ebuild | 4 +++-
 sys-apps/etckeeper/etckeeper-1.18.17.ebuild    | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)