From 4e93a25c41fa04313efa53f866e8bf22af1d92c2 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 19 Jun 2026 15:30:49 -0700 Subject: [PATCH] maint: make ./bootstrap abort if no .git/ directory is present. In response to (long thread continuing over a month boundary): https://lists.gnu.org/archive/html/automake/2025-05/msg00013.html https://lists.gnu.org/archive/html/automake/2025-06/msg00000.html * bootstrap: if no .git directory is present, abort with a long-winded error message. Nothing good comes of running ./bootstrap in a tree from a release tarball, e.g., makeinfo suddenly becomes required, per the original report. --- bootstrap | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 5fc89023f..de337fecf 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,6 @@ #! /bin/sh - # This script helps bootstrap automake, when checked out from git. +# It should not be run from a tree made from a (pre)release tarball. # # Copyright (C) 2002-2026 Free Software Foundation, Inc. # Originally written by Pavel Roskin September 2002. @@ -22,6 +22,34 @@ # 'autoreconf -i' which would require Automake to already be # installed. +if test ! -d .git; then + cat <&2 +$0: no .git directory, so exiting. +Long-winded explanation: + +The Automake bootstrap script is intended to be run only from the +top level of a git checkout of Automake, but no .git directory +is present (in `pwd`), so I'm exiting. + +In particular, it should not be run from a source tree expanded from a +release (or test release, etc.) tarball, because those trees already +contain everything needed for compilation, with minimal dependencies. +The development-specific actions of this bootstrap script will mess that +up, e.g., makeinfo will be required to build after running bootstrap. + +(By the way, this bootstrap script is still included in the release +tarballs even though it is not intended to be run in that context simply +because it is a nontrivial source file and thus potentially useful to +developers to see, regardless.) + +If you desire to run the bootstrap script in some tree that is not a git +checkout, just mkdir .git and the script will proceed. + +Goodbye from $0. +END_NOT_GIT + exit 1 +fi + # Don't ignore failures. set -e -- 2.47.3