checkupdates: don't fail when we can't init submodules

Later revisions might have removed the submodules so we want to keep
going when there are no submodules present.
We still abort when there is an error initializing submodules.

Fixes fdroid/fdroidserver#231
This commit is contained in:
Marcus Hoffmann 2017-12-04 15:10:21 +01:00
parent 2dcb19d392
commit db0a97e8e7
3 changed files with 23 additions and 7 deletions

View file

@ -53,7 +53,8 @@ from distutils.util import strtobool
import fdroidserver.metadata
from fdroidserver import _
from fdroidserver.exception import FDroidException, VCSException, BuildException, VerificationException
from fdroidserver.exception import FDroidException, VCSException, NoSubmodulesException,\
BuildException, VerificationException
from .asynchronousfilereader import AsynchronousFileReader
@ -883,7 +884,7 @@ class vcs_git(vcs):
self.checkrepo()
submfile = os.path.join(self.local, '.gitmodules')
if not os.path.isfile(submfile):
raise VCSException(_("No git submodules available"))
raise NoSubmodulesException(_("No git submodules available"))
# fix submodules not accessible without an account and public key auth
with open(submfile, 'r') as f: