commit:     11c51d7c78f48d4c9842e0d475c26b7068f18c3e
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon Jun 17 00:12:29 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 00:20:41 2024 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=11c51d7c

ebuild: fix maintainer mode checks to work with modern autotools

Modern autotools does not use the --run argument to "missing", so the
check essentially never ever ever ever fired anywhere.

The GNU "missing" script is actually allowed to be run by any software
at all, so checking for "missing --run" was always wrong. Indeed, there
are some packages which use it for their own purposes and added
suppressions for this FP.

The correct solution really is to check for *maintainer mode* by
checking whether *maintainer* programs are run (via "missing"). This
also means we get to check for specific programs which autotools.eclass
would be capable of handling, and don't need to arbitrarily exclude
stuff like help2man (???) which makes things somewhat simpler.

It should be noted that I have observed 3 scenarios for the missing
script to be run via:

- the missing script is surrounded by single quotes, followed by the
  unquoted command
- the missing script is unquoted, and is followed by the unquoted
  command
- legacy: the missing script is unquoted and is followed by --run

We have to handle all three cases via a regex group.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/package/ebuild/doebuild.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/portage/package/ebuild/doebuild.py 
b/lib/portage/package/ebuild/doebuild.py
index 6641cd8341..21ff5a77fd 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -2382,10 +2382,10 @@ def _check_build_log(mysettings, out=None):
     #
     # Configuration:
     #  Automake:                   ${SHELL} 
/var/tmp/portage/dev-libs/yaz-3.0.47/work/yaz-3.0.47/config/missing --run 
automake-1.10
-    am_maintainer_mode_re = re.compile(r"/missing --run ")
-    am_maintainer_mode_exclude_re = re.compile(
-        r"(/missing --run 
(autoheader|autotest|help2man|makeinfo)|^\s*Automake:\s)"
+    am_maintainer_mode_re = re.compile(
+        r"/missing( --run|'|) (automake|autoconf|autoheader|aclocal)"
     )
+    am_maintainer_mode_exclude_re = re.compile(r"^\s*Automake:\s")
 
     make_jobserver_re = re.compile(r"g?make\[\d+\]: warning: jobserver 
unavailable:")
     make_jobserver = []

Reply via email to