Skip to content

Commit

Permalink
ebuild: fix maintainer mode checks to work with modern autotools
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Sam James <[email protected]>
  • Loading branch information
eli-schwartz authored and thesamesam committed Jun 17, 2024
1 parent 19e750b commit 11c51d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/portage/package/ebuild/doebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit 11c51d7

Please sign in to comment.