qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/5] configure: remove --with-git= option


From: Paolo Bonzini
Subject: [PATCH 1/5] configure: remove --with-git= option
Date: Sat, 27 May 2023 11:28:47 +0200

There is not really any scenario where one would use any other git
binary than "the first git in the PATH" aka $(command -v git).  In
fact for example "meson subprojects download" or scripts/checkpatch.pl
do not obey the GIT environment variable.

Remove the unnecessary knob, but test for the presence of git in
the configure and git-submodule.sh scripts.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile                 | 2 +-
 configure                | 6 ++----
 meson.build              | 1 -
 scripts/git-submodule.sh | 8 +++++++-
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 08fb6a3b058a..eaeab979966c 100644
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ Makefile: .git-submodule-status
 git-submodule-update:
 ifneq ($(GIT_SUBMODULES_ACTION),ignore)
        $(call quiet-command, \
-               (GIT="$(GIT)" "$(SRC_PATH)/scripts/git-submodule.sh" 
$(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
+               ("$(SRC_PATH)/scripts/git-submodule.sh" 
$(GIT_SUBMODULES_ACTION) $(GIT_SUBMODULES)), \
                "GIT","$(GIT_SUBMODULES)")
 endif
 
diff --git a/configure b/configure
index d674a9667310..370e038e63d7 100755
--- a/configure
+++ b/configure
@@ -791,7 +791,7 @@ fi
 
 case $git_submodules_action in
     update|validate)
-        if test ! -e "$source_path/.git"; then
+        if test ! -e "$source_path/.git" || ! has git; then
             echo "ERROR: cannot $git_submodules_action git submodules without 
.git"
             exit 1
         fi
@@ -892,7 +892,6 @@ Advanced options (experts only):
   --python=PYTHON          use specified python [$python]
   --ninja=NINJA            use specified ninja [$ninja]
   --smbd=SMBD              use specified smbd [$smbd]
-  --with-git=GIT           use specified git [$git]
   --with-git-submodules=update   update git submodules (default if .git dir 
exists)
   --with-git-submodules=validate fail if git submodules are not up to date
   --with-git-submodules=ignore   do not update or check git submodules 
(default if no .git dir)
@@ -1699,7 +1698,7 @@ fi
 #######################################
 # generate config-host.mak
 
-if ! (GIT="$git" "$source_path/scripts/git-submodule.sh" 
"$git_submodules_action" "$git_submodules"); then
+if ! ("$source_path/scripts/git-submodule.sh" "$git_submodules_action" 
"$git_submodules"); then
     exit 1
 fi
 
@@ -1709,7 +1708,6 @@ echo "# Automatically generated by configure - do not 
modify" > $config_host_mak
 echo >> $config_host_mak
 
 echo all: >> $config_host_mak
-echo "GIT=$git" >> $config_host_mak
 echo "GIT_SUBMODULES=$git_submodules" >> $config_host_mak
 echo "GIT_SUBMODULES_ACTION=$git_submodules_action" >> $config_host_mak
 
diff --git a/meson.build b/meson.build
index 2d48aa1e2ef3..b11773ab39e8 100644
--- a/meson.build
+++ b/meson.build
@@ -4027,7 +4027,6 @@ summary(summary_info, bool_yn: true, section: 
'Directories')
 
 # Host binaries
 summary_info = {}
-summary_info += {'git':               config_host['GIT']}
 summary_info += {'python':            '@0@ (version: 
@1@)'.format(python.full_path(), python.language_version())}
 summary_info += {'sphinx-build':      sphinx_build}
 if config_host.has_key('HAVE_GDB_BIN')
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index 7be41f594832..33e995bef1ff 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -12,7 +12,7 @@ maybe_modules="$@"
 # if --with-git-submodules=ignore, do nothing
 test "$command" = "ignore" && exit 0
 
-test -z "$GIT" && GIT=git
+GIT=$(command -v git)
 
 cd "$(dirname "$0")/.."
 
@@ -57,6 +57,12 @@ then
     exit 1
 fi
 
+if test -n "$maybe_modules" && test -z "$GIT"
+then
+    echo "$0: unexpectedly called with submodules but git binary not found"
+    exit 1
+fi
+
 modules=""
 for m in $maybe_modules
 do
-- 
2.40.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]