public inbox for buildbot@sourceware.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: buildbot@sourceware.org
Cc: arsen@gentoo.org, Sam James <sam@gentoo.org>
Subject: [PATCH] autoregen.py: adapt to Gentoo
Date: Sat,  2 Mar 2024 05:32:39 +0000	[thread overview]
Message-ID: <20240302053303.778801-1-sam@gentoo.org> (raw)

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


                 reply	other threads:[~2024-03-02  5:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240302053303.778801-1-sam@gentoo.org \
    --to=sam@gentoo.org \
    --cc=arsen@gentoo.org \
    --cc=buildbot@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).