Properly abort when git submodule processing fails

Authored by hashar on Mar 19 2019, 10:15 AM.


Properly abort when git submodule processing fails

The logic to process MediaWiki extensions and skins submodules comes
from the old JJB macro ext-skins-submodules-update. It was written in
shell using find to run the command. Roughly:

find extensions -name .gitmodules -execdir <git submodule commands> \;

When a git submodule command failed, find would keep processing anyway
and exit 0 regardless. The reason is in find documentation:

-execdir command {} ; returns true only if command returns 0.

The 'true' returns value is for the find predicate and does not affect
find exit status.

Port the logic to plain python using os.walk(). Which also mean that
Quibble no more depends on the 'find' utility which would help on

Add a test to ensure a failing call causes an exception which is bubbled
up to ext_skin_submodule_update() (and thus abort QuibbleCmd).

Bug: T198980
Change-Id: I3ca48f10a66a8959c1a8b9f8f7d585823f40312a