From 0c390c943d2be4845b40e9f78d708296cd7a19a7 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Thu, 10 Mar 2022 09:51:36 +0100 Subject: [PATCH] [checkupdates] update submodules according to tag In case the version information is inside a submodule we need to checkout the submodule at the version of the tag we test. Found with org.courville.nova. Closes: #622 --- fdroidserver/checkupdates.py | 1 + tests/run-tests | 48 ++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/fdroidserver/checkupdates.py b/fdroidserver/checkupdates.py index eb30693e..69b2f544 100644 --- a/fdroidserver/checkupdates.py +++ b/fdroidserver/checkupdates.py @@ -141,6 +141,7 @@ def check_tags(app, pattern): for tag in tags: logging.debug("Check tag: '{0}'".format(tag)) vcs.gotorevision(tag) + try_init_submodules(app, last_build, vcs) if app.UpdateCheckData: filecode, codeex, filever, verex = app.UpdateCheckData.split('|') diff --git a/tests/run-tests b/tests/run-tests index 460179ab..59fb08e5 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -1367,6 +1367,54 @@ $fdroid checkupdates --allow-dirty grep "CurrentVersionCode: 2" metadata/fake.yml +#------------------------------------------------------------------------------# +echo_header "checkupdates check version in submodule" + +ROOT=$(create_test_dir) +cd "$ROOT" +mkdir app sub +cd sub +$git init +echo 1 > ver +$git add ver +$git commit -m 1 + +cd ../app +$git init +$git submodule add "file://$(pwd)/../sub" +$git commit -am 1 +$git tag 1 + +cd ../sub +echo 2 > ver +$git commit -am 2 + +cd ../app +$git init +$git submodule update --remote +$git commit -am 2 + +cd .. +mkdir repo +mkdir metadata +cat > metadata/fake.yml <