diff mbox series

[v2] git: Make submodule check only needed modules

Message ID 20200130162810.14503-1-quintela@redhat.com
State New
Headers show
Series [v2] git: Make submodule check only needed modules | expand

Commit Message

Juan Quintela Jan. 30, 2020, 4:28 p.m. UTC
If one is compiling more than one tree from the same source, it is
possible that they need different submodules.  Change the check to see
that all modules that we are interested in are updated, discarding the
ones that we don't care about.

Signed-off-by: Juan Quintela <quintela@redhat.com>

---

v1->v2:
patchw insists in not using tabs
---
 scripts/git-submodule.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Comments

Daniel P. Berrangé Jan. 30, 2020, 4:31 p.m. UTC | #1
On Thu, Jan 30, 2020 at 05:28:10PM +0100, Juan Quintela wrote:
> If one is compiling more than one tree from the same source, it is
> possible that they need different submodules.  Change the check to see
> that all modules that we are interested in are updated, discarding the
> ones that we don't care about.
> 
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> 
> ---
> 
> v1->v2:
> patchw insists in not using tabs
> ---
>  scripts/git-submodule.sh | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
> index 98ca0f2737..65ed877aef 100755
> --- a/scripts/git-submodule.sh
> +++ b/scripts/git-submodule.sh
> @@ -59,10 +59,14 @@ status)
>      fi
>  
>      test -f "$substat" || exit 1
> -    CURSTATUS=$($GIT submodule status $modules)
> -    OLDSTATUS=$(cat $substat)
> -    test "$CURSTATUS" = "$OLDSTATUS"
> -    exit $?
> +    for module in $modules; do
> +        CURSTATUS=$($GIT submodule status $module)
> +        OLDSTATUS=$(cat $substat | grep $module)
> +        if test "$CURSTATUS" != "$OLDSTATUS"; then
> +            exit 1
> +        fi
> +    done
> +    exit 0
>      ;;
>  update)
>      if test -z "$maybe_modules"

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
Juan Quintela Jan. 30, 2020, 4:44 p.m. UTC | #2
Daniel P. Berrangé <berrange@redhat.com> wrote:
> On Thu, Jan 30, 2020 at 05:28:10PM +0100, Juan Quintela wrote:
>> If one is compiling more than one tree from the same source, it is
>> possible that they need different submodules.  Change the check to see
>> that all modules that we are interested in are updated, discarding the
>> ones that we don't care about.
>> 
>> Signed-off-by: Juan Quintela <quintela@redhat.com>
>> 
>
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Should I send the pull request?

Later, Juan.
Daniel P. Berrangé Jan. 30, 2020, 4:46 p.m. UTC | #3
On Thu, Jan 30, 2020 at 05:44:59PM +0100, Juan Quintela wrote:
> Daniel P. Berrangé <berrange@redhat.com> wrote:
> > On Thu, Jan 30, 2020 at 05:28:10PM +0100, Juan Quintela wrote:
> >> If one is compiling more than one tree from the same source, it is
> >> possible that they need different submodules.  Change the check to see
> >> that all modules that we are interested in are updated, discarding the
> >> ones that we don't care about.
> >> 
> >> Signed-off-by: Juan Quintela <quintela@redhat.com>
> >> 
> >
> > Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
> 
> Should I send the pull request?

Sure, I'm was leaving this for the "Misc queue" maintainer but if yuou
want it sooner....

Regards,
Daniel
no-reply@patchew.org Jan. 30, 2020, 5:02 p.m. UTC | #4
Patchew URL: https://patchew.org/QEMU/20200130162810.14503-1-quintela@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or directory
qemu-system-x86_64: falling back to tcg
**
ERROR:/tmp/qemu-test/src/tests/qtest/migration-helpers.c:119:check_migration_status: assertion failed (current_status != "completed"): ("completed" != "completed")
ERROR - Bail out! ERROR:/tmp/qemu-test/src/tests/qtest/migration-helpers.c:119:check_migration_status: assertion failed (current_status != "completed"): ("completed" != "completed")
make: *** [check-qtest-x86_64] Error 1
make: *** Waiting for unfinished jobs....
  TEST    iotest-qcow2: 186
  TEST    iotest-qcow2: 187
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=26f2c070ef85439fab45133d8a0eb9d5', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-rppq5_sd/src/docker-src.2020-01-30-11.51.38.22326:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=26f2c070ef85439fab45133d8a0eb9d5
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-rppq5_sd/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    10m24.127s
user    0m8.553s


The full log is available at
http://patchew.org/logs/20200130162810.14503-1-quintela@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
diff mbox series

Patch

diff --git a/scripts/git-submodule.sh b/scripts/git-submodule.sh
index 98ca0f2737..65ed877aef 100755
--- a/scripts/git-submodule.sh
+++ b/scripts/git-submodule.sh
@@ -59,10 +59,14 @@  status)
     fi
 
     test -f "$substat" || exit 1
-    CURSTATUS=$($GIT submodule status $modules)
-    OLDSTATUS=$(cat $substat)
-    test "$CURSTATUS" = "$OLDSTATUS"
-    exit $?
+    for module in $modules; do
+        CURSTATUS=$($GIT submodule status $module)
+        OLDSTATUS=$(cat $substat | grep $module)
+        if test "$CURSTATUS" != "$OLDSTATUS"; then
+            exit 1
+        fi
+    done
+    exit 0
     ;;
 update)
     if test -z "$maybe_modules"