From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id CE1B43858D39 for ; Sat, 2 Mar 2024 05:33:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE1B43858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CE1B43858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709357608; cv=none; b=qZgcJB+qTIdKKmMW1wr3gDvDnhay8y6JIcF1PcPaRqWtXfg1xaYdq+1n8Q/m/wFvqc+EFZafrpjyWeRtK4bg717oHlp0XP0sHf1wN8qN/UnPQmJu2XIjywmhPrcvD3l6OKrohWB0SvMImmIbJMI/2l7YBkeQW7GU4hdfTcUGy5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709357608; c=relaxed/simple; bh=mO0a2RNvlXDLPxSUpQ0bdzs8OeSmAZszNo45riNiTzc=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=BC9Up64r5jyaqnQF95Z6tvYdL1lVhO133S+zt/nIbuV+TWQ9OLE4l1ICv0TnjDZL4egiAbpUhDOgoajTs/a+bjafSLsTt/EuCVyAFFxk5VR45Zn628Tb8vz3kQjwNkFfVm83bqngvx82UiHNDswlA101DGzcZM8Shby1GnT37ro= ARC-Authentication-Results: i=1; server2.sourceware.org From: Sam James To: buildbot@sourceware.org Cc: arsen@gentoo.org, Sam James Subject: [PATCH] autoregen.py: adapt to Gentoo Date: Sat, 2 Mar 2024 05:32:39 +0000 Message-ID: <20240302053303.778801-1-sam@gentoo.org> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 --- 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