portage(5) should document the /etc/portage/patches / eapply_user infrastructure but it currently does not.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=eb650736537728f40cee65c8a3d523d7dcfde804 commit eb650736537728f40cee65c8a3d523d7dcfde804 Author: Nekun <nekokun@firemail.cc> AuthorDate: 2021-04-11 01:23:27 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-04-25 03:38:34 +0000 ebuild.5: Add eapply documentation Bug: https://bugs.gentoo.org/698244 Signed-off-by: Nekun <nekokun@firemail.cc> Signed-off-by: Zac Medico <zmedico@gentoo.org> man/ebuild.5 | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) https://gitweb.gentoo.org/proj/portage.git/commit/?id=f737795e9da830d543a424ab7e74b2151e58fca8 commit f737795e9da830d543a424ab7e74b2151e58fca8 Author: Nekun <nekokun@firemail.cc> AuthorDate: 2021-04-11 01:23:26 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-04-25 03:38:31 +0000 man/portage.5: Add userpatch documentation Bug: https://bugs.gentoo.org/698244 Signed-off-by: Nekun <nekokun@firemail.cc> Signed-off-by: Zac Medico <zmedico@gentoo.org> man/portage.5 | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-)
Thanks for the submissions here. I do note that the wording in the second patch - @@ -1375,6 +1378,34 @@ Also see \fB/var/lib/portage/world_sets\fR and the \fBemerge\fR(1) .. is very poor English, and barely makes sense. I think what you meant to write was something more like: "Patches from more-specific directories override patches from less-specific, i.e. if patches with the same name coexist in multiple directories, only patch from first matching directory will be applied." .. but even this is bad (and I'm a native English-speaker)!
(In reply to Michael 'veremitz' Everitt from comment #2) > Thanks for the submissions here. > > I do note that the wording in the second patch - > @@ -1375,6 +1378,34 @@ Also see \fB/var/lib/portage/world_sets\fR and the > \fBemerge\fR(1) > > .. is very poor English, and barely makes sense. > I think what you meant to write was something more like: > > "Patches from more-specific directories override patches from less-specific, > i.e. if patches with the same name coexist in multiple directories, only > patch from first matching directory will be applied." > > .. but even this is bad (and I'm a native English-speaker)! Yeah, "patch from first matching directory" is correct, and the language in the patch is unclear. We need to document the behavior implemented here: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7d2c4fb609454b76d30c42fc7a0bb720decc39a3 commit 7d2c4fb609454b76d30c42fc7a0bb720decc39a3 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2017-08-06 00:40:19 -0700 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2017-08-11 09:05:27 -0700 eapply_user: combine sort for all dirs (bug 608880) Combine the patch basenames from all matched directories into a list, and apply them in POSIX sorted order. This allows patches in more-specific directories to override patches of the same basename found in less-specific directories. An empty patch (or /dev/null symlink) negates a patch with the same basename found in a less-specific directory. This behavior is much more flexible and intuitive than the previous one, while remaining backward-compatible to some extent. NOTE: The implementation uses an associative array, which requires bash version 4 or later. X-Gentoo-bug: 608880 X-Gentoo-bug-url: https://bugs.gentoo.org/608880 Reviewed-by: Manuel Rüger <mrueg@gentoo.org> bin/phase-helpers.sh | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-)
(In reply to Michael 'veremitz' Everitt from comment #2) > "Patches from more-specific directories override patches from less-specific, > i.e. if patches with the same name coexist in multiple directories, only > patch from first matching directory will be applied." > > .. but even this is bad (and I'm a native English-speaker)! Alternative, more compact: “If patches with the same filename exist in multiple matching directories, only the patch from the most specific matching directory is applied.” I think that sort order (most specific to least specific or least specific to most specific) may be considered an implementation detail that need not appear in the documentation. Also, the first sentence is redundant and does not include the key point, namely that the most specific matching directory is the relevant one. (I assume that the concepts of matching directories and their specificity have already been explained.)
Thanks all for review my changes. Ability to read mans not always means ability to write mans, yeah. Tried to reword it more precisely and compact, as suggested. Also, added description for empty-patch logic and fixed target directory for eapply. See my patch in the maillist: https://archives.gentoo.org/gentoo-portage-dev/message/c32ddf4cfe3c351b97c0c889d2ef66f1
(In reply to Nekun from comment #5) > Thanks all for review my changes. Ability to read mans not always means > ability to write mans, yeah. > > Tried to reword it more precisely and compact, as suggested. Also, added > description for empty-patch logic and fixed target directory for eapply. > > See my patch in the maillist: > https://archives.gentoo.org/gentoo-portage-dev/message/ > c32ddf4cfe3c351b97c0c889d2ef66f1 Very good - thanks! :)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cba21902d9a8d1ac07d2ff5b0d932e71fc1fac67 commit cba21902d9a8d1ac07d2ff5b0d932e71fc1fac67 Author: Zac Medico <zmedico@gentoo.org> AuthorDate: 2021-05-24 07:47:11 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-05-24 09:05:08 +0000 sys-apps/portage: Bump to version 3.0.19 #520378: allow emerge --fetchonly to log to emerge-fetch.log #698244: portage(5) document user patch / eapply_user #781854: Suggest PORTAGE_LOG_FILTER_FILE_CMD cat fallback #782724: sort emerge --unmerge order for determinism #783957: lazily evaluate cnf_* variables in tests #784566: make emerge insensitive to relative order of optional and positional arguments #787545: emerge CTRL C may be ignored when running pkg_pretend #787563: ebuild-ipc could handle KeyboardInterrupt #788967: emerge --jobs= triggers TypeError Bug: https://bugs.gentoo.org/785484 Bug: https://bugs.gentoo.org/788967 Bug: https://bugs.gentoo.org/787563 Bug: https://bugs.gentoo.org/787545 Bug: https://bugs.gentoo.org/784566 Bug: https://bugs.gentoo.org/783957 Bug: https://bugs.gentoo.org/782724 Bug: https://bugs.gentoo.org/781854 Bug: https://bugs.gentoo.org/698244 Bug: https://bugs.gentoo.org/520378 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Zac Medico <zmedico@gentoo.org> sys-apps/portage/Manifest | 1 + sys-apps/portage/portage-3.0.19.ebuild | 266 +++++++++++++++++++++++++++++++++ 2 files changed, 267 insertions(+)