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 v2 2/2] autoregen.py: style tweaks
Date: Sat,  2 Mar 2024 06:02:20 +0000	[thread overview]
Message-ID: <20240302060309.1002512-2-sam@gentoo.org> (raw)
In-Reply-To: <20240302060309.1002512-1-sam@gentoo.org>

Maybe a bit easier to read now.

Signed-off-by: Sam James <sam@gentoo.org>
---
 builder/containers/autoregen.py | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/builder/containers/autoregen.py b/builder/containers/autoregen.py
index f33fb78..3d307ad 100755
--- a/builder/containers/autoregen.py
+++ b/builder/containers/autoregen.py
@@ -27,6 +27,13 @@ ENV += f' AUTOCONF={AUTOCONF_BIN} '
 ENV += f' ACLOCAL={ACLOCAL_BIN} '
 ENV += f' AUTOMAKE={AUTOMAKE_BIN}'
 
+# Directories we should skip entirely because they're vendored or have different
+# autotools versions.
+skip_dirs = [
+    # readline and minizip are maintained with different autotools versions
+    'readline',
+    'minizip'
+]
 
 config_folders = []
 
@@ -37,11 +44,12 @@ for root, _, files in os.walk('.'):
 
 for folder in sorted(config_folders):
     print(folder, flush=True)
-    # readline and minizip are maintained with different autotools versions
-    if (str(folder).endswith('readline')
-        or str(folder).endswith('minizip')):
-        continue;
+
+    if folder.stem in skip_dirs:
+        continue
+
     os.chdir(folder)
+
     configure_lines = open('configure.ac').read().splitlines()
     if any(True for line in configure_lines if line.startswith('AC_CONFIG_MACRO_DIRS')):
         # aclocal does not support the -f short option for force
@@ -49,19 +57,24 @@ for folder in sorted(config_folders):
         include_arg2 = ''
         if (folder / '..' / 'config').is_dir():
             include_arg = '-I../config'
+
         # this is really a hack just for binutils-gdb/gprofng/libcollector
         # make sure that the order of includes is done as --enable-maintainer-mode
         if (folder / '..' / '..' / 'config').is_dir():
             include_arg = '-I../..'
             include_arg2 = '-I../../config'
+
         subprocess.check_output(f'{ENV} {ACLOCAL_BIN} --force {include_arg} {include_arg2}', shell=True, encoding='utf8')
+
     if ((folder / 'config.in').is_file()
         or any(True for line in configure_lines if line.startswith('AC_CONFIG_HEADERS'))):
         subprocess.check_output(f'{ENV} {AUTOHEADER_BIN} -f', shell=True, encoding='utf8')
+
     # apparently automake is somehow unstable -> skip it for gotools
     if (any(True for line in configure_lines if line.startswith('AM_INIT_AUTOMAKE'))
             and not str(folder).endswith('gotools')):
         subprocess.check_output(f'{ENV} {AUTOMAKE_BIN} -f',
                                 shell=True, encoding='utf8')
+
     subprocess.check_output(f'{ENV} {AUTOCONF_BIN} -f', shell=True, encoding='utf8')
 
-- 
2.44.0


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02  6:02 [PATCH v2 1/2] autoregen.py: adapt to Gentoo Sam James
2024-03-02  6:02 ` Sam James [this message]
2024-03-03 17:53 ` Mark Wielaard

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=20240302060309.1002512-2-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).