mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
[checkupdates] Ignore broken submodule
In case the app repository has a broken submodule, checkupdates failed and did not search for any version updates. Ignoring the error let's us at least find new version in the main repo (which is probably the right place anyhow) and thus an improvement.
This commit is contained in:
parent
ecc21489d4
commit
674786db96
@ -373,6 +373,8 @@ def try_init_submodules(app, last_build, vcs):
|
|||||||
vcs.initsubmodules()
|
vcs.initsubmodules()
|
||||||
except NoSubmodulesException:
|
except NoSubmodulesException:
|
||||||
logging.info("No submodules present for {}".format(_getappname(app)))
|
logging.info("No submodules present for {}".format(_getappname(app)))
|
||||||
|
except VCSException:
|
||||||
|
logging.info("submodule broken for {}".format(_getappname(app)))
|
||||||
|
|
||||||
|
|
||||||
# Return all directories under startdir that contain any of the manifest
|
# Return all directories under startdir that contain any of the manifest
|
||||||
|
@ -1332,6 +1332,50 @@ if have_git_2_3; then
|
|||||||
grep "CurrentVersionCode: 2" metadata/fake.yml
|
grep "CurrentVersionCode: 2" metadata/fake.yml
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------#
|
||||||
|
echo_header "checkupdates ignore broken submodule"
|
||||||
|
|
||||||
|
if have_git_2_3; then
|
||||||
|
ROOT=$(create_test_dir)
|
||||||
|
cd "$ROOT"
|
||||||
|
mkdir foo bar
|
||||||
|
cd foo
|
||||||
|
git init
|
||||||
|
echo a > a
|
||||||
|
git add a
|
||||||
|
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit -m a --author "Author <no@mail>"
|
||||||
|
|
||||||
|
cd ../bar
|
||||||
|
git init
|
||||||
|
git submodule add "file://$(pwd)/../foo" baz
|
||||||
|
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit -am a --author "Author <no@mail>"
|
||||||
|
git tag 2
|
||||||
|
|
||||||
|
cd ../foo
|
||||||
|
# delete the commit referenced in bar
|
||||||
|
GIT_COMMITTER_NAME="Test" GIT_COMMITTER_EMAIL="no@mail" git commit --amend -m aa --author "Author <no@mail>"
|
||||||
|
git reflog expire --expire=now --all
|
||||||
|
git gc --aggressive --prune=now
|
||||||
|
|
||||||
|
cd ..
|
||||||
|
mkdir repo
|
||||||
|
mkdir metadata
|
||||||
|
echo "RepoType: git" >> metadata/fake.yml
|
||||||
|
echo "Repo: file://$(pwd)/bar" >> metadata/fake.yml
|
||||||
|
echo "Builds:" >> metadata/fake.yml
|
||||||
|
echo " - versionName: 1" >> metadata/fake.yml
|
||||||
|
echo " versionCode: 1" >> metadata/fake.yml
|
||||||
|
echo " submodules: true" >> metadata/fake.yml
|
||||||
|
echo "AutoUpdateMode: Version" >> metadata/fake.yml
|
||||||
|
echo "UpdateCheckMode: Tags" >> metadata/fake.yml
|
||||||
|
echo "UpdateCheckData: '|||'" >> metadata/fake.yml
|
||||||
|
echo "CurrentVersion: 1" >> metadata/fake.yml
|
||||||
|
echo "CurrentVersionCode: 1" >> metadata/fake.yml
|
||||||
|
|
||||||
|
$fdroid checkupdates --allow-dirty
|
||||||
|
grep "CurrentVersionCode: 2" metadata/fake.yml
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------#
|
#------------------------------------------------------------------------------#
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user