diff mbox series

[2/2] archive-source.sh: Clone the submodules locally

Message ID 20190124010023.24397-3-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series archive-source.sh: Clone the submodules locally and add to MAINTAINERS | expand

Commit Message

Philippe Mathieu-Daudé Jan. 24, 2019, 1 a.m. UTC
We cloned the QEMU repository from the local storage. Since the
submodules are also available there, clone them too. This is
quicker and reduce network use.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 scripts/archive-source.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh
index 62bd22578b..e80c47caa3 100755
--- a/scripts/archive-source.sh
+++ b/scripts/archive-source.sh
@@ -38,6 +38,10 @@  else
 fi
 git clone --shared . "$vroot_dir"
 test $? -ne 0 && error "failed to clone into '$vroot_dir'"
+for sm in $submodules; do
+    git clone --shared "$sm" "$vroot_dir/$sm"
+    test $? -ne 0 && error "failed to clone submodule $sm"
+done
 
 cd "$vroot_dir"
 test $? -ne 0 && error "failed to change into '$vroot_dir'"
@@ -45,11 +49,6 @@  test $? -ne 0 && error "failed to change into '$vroot_dir'"
 git checkout $HEAD
 test $? -ne 0 && error "failed to checkout $HEAD revision"
 
-for sm in $submodules; do
-    git submodule update --init $sm
-    test $? -ne 0 && error "failed to init submodule $sm"
-done
-
 if test -n "$submodules"; then
     {
         git ls-files || error "git ls-files failed"