Gentoo Archives: gentoo-portage-dev

From: Nekun <nekokun@××××××××.cc>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] Implement new userpatch feature in existing eclass?
Date: Sun, 04 Apr 2021 17:54:16
Message-Id: 44ed96cc66b016ef275d839ce20c7b34@firemail.cc
1 Hi all.
2
3 Recently, I start working on optional atom specifiers feature in
4 userpatch facility: if package directory name starts with percent sign,
5 following word threated as a regular Portage atom, e.g
6 "/etc/portage/patches/sys-kernel/%<=gentoo-sources-5.4" ==
7 "<=sys-kernel/gentoo-sources-5.4". This might be very useful in cases
8 when patches applied to minor updates, but major update breaks it (e.g.,
9 in Linux kernel), so I want to specify smth like "=gentoo-sources-5.4*".
10 I added new command in portageq to match two atoms and call it from
11 eapply_user function in phase-function.sh, in same manner as
12 has_version/best_version are called it. But recently I found that
13 eapply_user implemented in Portage only in EAPI 6, and there is its
14 predecessor, epatch_user, implemented in epatch.eclass. So, ebuilds with
15 EAPI<6 (I found 4463 in last gentoo snapshot) will ignore new "atomic"
16 patch directories. Obviously, this is rather confusing, unacceptable
17 behaviour.
18
19 Can I patch epatch.eclass in gentoo repository to implement new
20 userpatch facility for older EAPIs? I guess that EAPI version is
21 considered as stable, unchangeable behaviour of all functions, but in
22 other side, this feature doesn't changes anything existing: old
23 userpatch semantics preserves and order of applying
24 (${P}-${PR},${P},${PN}) not changed, seeking for atoms added at tail.

Replies