public inbox for buildbot@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] autoregen.py: adapt to Gentoo
@ 2024-03-02  5:32 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2024-03-02  5:32 UTC (permalink / raw)
  To: buildbot; +Cc: arsen, Sam James

In Gentoo, we have autoconf-vanilla and automake-vanilla packaged for toolchain
development with no patches applied. The binaries are named differently.

Adapt the script to check a list of binaries for each tool, and check the
vanilla names first as we want to prefer those if they exist.

This makes the script work out-of-the-box on Gentoo.

Signed-off-by: Sam James <sam@gentoo.org>
---
mjw, could you double check this does the right thing for you on your systems?

It should be OK as I've checked with a few combinations.

 builder/containers/autoregen.py | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py
index bfb8f3d..d366ea9 100755
--- a/builder/containers/autoregen.py
+++ b/builder/containers/autoregen.py
@@ -1,13 +1,22 @@
 #!/usr/bin/env python3
 
 import os
+import shutil
 import subprocess
 from pathlib import Path
 
-AUTOCONF_BIN = 'autoconf-2.69'
-AUTOMAKE_BIN = 'automake-1.15.1'
-ACLOCAL_BIN = 'aclocal-1.15.1'
-AUTOHEADER_BIN = 'autoheader-2.69'
+# On Gentoo, vanilla unpatched autotools are packaged separately.
+# We place the vanilla names first as we want to prefer those if both exist.
+autoconf_names = ['autoconf-vanilla-2.69', 'autoconf-2.69']
+automake_names = ['automake-vanilla-1.15', 'automake-1.15.1']
+aclocal_names = ['aclocal-vanilla-1.15', 'aclocal-1.15.1']
+autoheader_names = ['autoheader-vanilla-2.69', 'autoheader-2.69']
+
+# Pick the first for each list that exists on this system.
+AUTOCONF_BIN = next(name for name in autoconf_names if shutil.which(name))
+AUTOMAKE_BIN = next(name for name in automake_names if shutil.which(name))
+ACLOCAL_BIN = next(name for name in aclocal_names if shutil.which(name))
+AUTOHEADER_BIN = next(name for name in autoheader_names if shutil.which(name))
 
 ENV = f'AUTOCONF={AUTOCONF_BIN} ACLOCAL={ACLOCAL_BIN} AUTOMAKE={AUTOMAKE_BIN}'
 
-- 
2.44.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-02  5:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-02  5:32 [PATCH] autoregen.py: adapt to Gentoo Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).