qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: thuth@redhat.com, berrange@redhat.com
Subject: [PATCH 10/10] configure: remove --with-git-submodules=
Date: Mon,  5 Jun 2023 11:52:23 +0200	[thread overview]
Message-ID: <20230605095223.107653-11-pbonzini@redhat.com> (raw)
In-Reply-To: <20230605095223.107653-1-pbonzini@redhat.com>

Reuse --enable/--disable-download to control git submodules as well.
Adjust the error messages of git-submodule.sh to refer to the new
option.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                                     | 40 +++++--------------
 .../ci/org.centos/stream/8/x86_64/configure   |  1 -
 scripts/git-submodule.sh                      |  8 ++--
 3 files changed, 12 insertions(+), 37 deletions(-)

diff --git a/configure b/configure
index bc0660f5a32..8765b88e12f 100755
--- a/configure
+++ b/configure
@@ -246,13 +246,7 @@ for opt do
 done
 
 
-if test -e "$source_path/.git"
-then
-    git_submodules_action="update"
-else
-    git_submodules_action="ignore"
-fi
-
+git_submodules_action="update"
 git="git"
 debug_tcg="no"
 docs="auto"
@@ -738,12 +732,9 @@ for opt do
   ;;
   --disable-cfi) cfi="false"
   ;;
-  --with-git-submodules=*)
-      git_submodules_action="$optarg"
+  --disable-download) download="disabled"; git_submodules_action=validate;
   ;;
-  --disable-download) download="disabled"
-  ;;
-  --enable-download) download="enabled"
+  --enable-download) download="enabled"; git_submodules_action=update;
   ;;
   --enable-plugins) if test "$mingw32" = "yes"; then
                         error_exit "TCG plugins not currently supported on Windows platforms"
@@ -765,6 +756,11 @@ for opt do
   esac
 done
 
+if ! test -e "$source_path/.git"
+then
+    git_submodules_action="ignore"
+fi
+
 # test for any invalid configuration combinations
 if test "$plugins" = "yes" -a "$tcg" = "disabled"; then
     error_exit "Can't enable plugins on non-TCG builds"
@@ -796,21 +792,6 @@ then
     exit 1
 fi
 
-case $git_submodules_action in
-    update|validate)
-        if test ! -e "$source_path/.git" || ! has git; then
-            echo "ERROR: cannot $git_submodules_action git submodules without .git"
-            exit 1
-        fi
-    ;;
-    ignore)
-    ;;
-    *)
-        echo "ERROR: invalid --with-git-submodules= value '$git_submodules_action'"
-        exit 1
-    ;;
-esac
-
 default_target_list=""
 mak_wilds=""
 
@@ -877,9 +858,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-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)
   --static                 enable static build [$static]
   --bindir=PATH            install binaries in PATH
   --with-suffix=SUFFIX     suffix for QEMU data inside datadir/libdir/sysconfdir/docdir [$qemu_suffix]
@@ -1024,7 +1002,7 @@ fi
 # Consult white-list to determine whether to enable werror
 # by default.  Only enable by default for git builds
 if test -z "$werror" ; then
-    if test "$git_submodules_action" != "ignore" && \
+    if test -e "$source_path/.git" && \
         { test "$linux" = "yes" || test "$mingw32" = "yes"; }; then
         werror="yes"
     else
diff --git a/scripts/ci/org.centos/stream/8/x86_64/configure b/scripts/ci/org.centos/stream/8/x86_64/configure
index de76510978f..d02b09a4b9b 100755
--- a/scripts/ci/org.centos/stream/8/x86_64/configure
+++ b/scripts/ci/org.centos/stream/8/x86_64/configure
@@ -29,7 +29,6 @@
 --extra-cflags="-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection" \
 --with-suffix="qemu-kvm" \
 --firmwarepath=/usr/share/qemu-firmware \
---with-git-submodules=update \
 --target-list="x86_64-softmmu" \
 --block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \
 --audio-drv-list="" \
diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index 38b55c90e11..11fad2137cd 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -9,7 +9,7 @@ command=$1
 shift
 maybe_modules="$@"
 
-# if --with-git-submodules=ignore, do nothing
+# if not running in a git checkout, do nothing
 test "$command" = "ignore" && exit 0
 
 test -z "$GIT" && GIT=$(command -v git)
@@ -24,7 +24,7 @@ update_error() {
     echo "enable use of a transparent proxy), please disable automatic"
     echo "GIT submodule checkout with:"
     echo
-    echo " $ ./configure --with-git-submodules=validate"
+    echo " $ ./configure --disable-download"
     echo
     echo "and then manually update submodules prior to running make, with:"
     echo
@@ -39,9 +39,7 @@ validate_error() {
         echo "configured for validate only. Please run"
         echo "  scripts/git-submodule.sh update $maybe_modules"
         echo "from the source directory or call configure with"
-        echo "  --with-git-submodules=update"
-        echo "To disable GIT submodules validation, use"
-        echo "  --with-git-submodules=ignore"
+        echo "  --enable-download"
     fi
     exit 1
 }
-- 
2.40.1



  parent reply	other threads:[~2023-06-05  9:54 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  9:52 [PATCH v2 00/10] meson: replace submodules with wrap files Paolo Bonzini
2023-06-05  9:52 ` [PATCH 01/10] configure: remove --with-git= option Paolo Bonzini
2023-06-05 10:27   ` Alex Bennée
2023-06-05 11:17   ` Thomas Huth
2023-06-05  9:52 ` [PATCH 02/10] configure: rename --enable-pypi to --enable-download, control subprojects too Paolo Bonzini
2023-06-05 10:28   ` Alex Bennée
2023-06-05  9:52 ` [PATCH 03/10] git-submodule: allow partial update of .git-submodule-status Paolo Bonzini
2023-06-05 10:55   ` Alex Bennée
2023-06-05  9:52 ` [PATCH 04/10] build: log submodule update from git-submodule.sh Paolo Bonzini
2023-06-05 10:56   ` Alex Bennée
2023-06-05 11:11   ` Alex Bennée
2023-06-05  9:52 ` [PATCH 05/10] meson: subprojects: replace submodules with wrap files Paolo Bonzini
2023-06-06  9:54   ` Daniel P. Berrangé
2023-06-05  9:52 ` [PATCH 06/10] configure: move SLOF submodule handling to pc-bios/s390-ccw Paolo Bonzini
2023-06-06  9:56   ` Daniel P. Berrangé
2023-06-06 10:07   ` Thomas Huth
2023-06-05  9:52 ` [PATCH 07/10] pc-bios/s390-ccw: always build network bootloader Paolo Bonzini
2023-06-06  9:56   ` Daniel P. Berrangé
2023-06-06 10:08   ` Thomas Huth
2023-06-16 15:20   ` Nina Schoetterl-Glausch
2023-06-22  8:42     ` Thomas Huth
2023-06-22  9:47       ` Paolo Bonzini
2023-06-05  9:52 ` [PATCH 08/10] meson: subprojects: replace berkeley-{soft, test}float-3 with wraps Paolo Bonzini
2023-06-06  9:58   ` [PATCH 08/10] meson: subprojects: replace berkeley-{soft,test}float-3 " Daniel P. Berrangé
2023-06-05  9:52 ` [PATCH 09/10] build: remove git submodule handling from main makefile Paolo Bonzini
2023-06-06  9:59   ` Daniel P. Berrangé
2023-06-05  9:52 ` Paolo Bonzini [this message]
2023-06-06 10:00   ` [PATCH 10/10] configure: remove --with-git-submodules= Daniel P. Berrangé
2023-06-07  7:41 ` [PATCH v2 00/10] meson: replace submodules with wrap files Michal Prívozník
2023-06-07  7:47   ` Daniel P. Berrangé
2023-06-07  8:54     ` Michal Prívozník
2023-06-07  8:56       ` Paolo Bonzini

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=20230605095223.107653-11-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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 NNTP newsgroup(s).