mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 06:52:39 +03:00
deinit git submodule
This commit is contained in:
parent
f14efd849c
commit
f99f430e9e
3 changed files with 21 additions and 0 deletions
|
@ -1174,6 +1174,10 @@ class vcs:
|
||||||
def initsubmodules(self):
|
def initsubmodules(self):
|
||||||
raise VCSException('Submodules not supported for this vcs type')
|
raise VCSException('Submodules not supported for this vcs type')
|
||||||
|
|
||||||
|
# Deinitialise and update submodules
|
||||||
|
def deinitsubmodules(self):
|
||||||
|
pass
|
||||||
|
|
||||||
# Get a list of all known tags
|
# Get a list of all known tags
|
||||||
def gettags(self):
|
def gettags(self):
|
||||||
if not self._gettags:
|
if not self._gettags:
|
||||||
|
@ -1338,6 +1342,12 @@ class vcs_git(vcs):
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
raise VCSException(_("Git submodule update failed"), p.output)
|
raise VCSException(_("Git submodule update failed"), p.output)
|
||||||
|
|
||||||
|
def deinitsubmodules(self):
|
||||||
|
self.checkrepo()
|
||||||
|
p = FDroidPopen(['git', 'submodule', 'deinit', '--all'], cwd=self.local, output=False)
|
||||||
|
if p.returncode != 0:
|
||||||
|
raise VCSException(_("Git submodule deinit failed"), p.output)
|
||||||
|
|
||||||
def _gettags(self):
|
def _gettags(self):
|
||||||
self.checkrepo()
|
self.checkrepo()
|
||||||
p = FDroidPopen(['git', 'tag'], cwd=self.local, output=False)
|
p = FDroidPopen(['git', 'tag'], cwd=self.local, output=False)
|
||||||
|
@ -2188,6 +2198,8 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
||||||
if build.submodules:
|
if build.submodules:
|
||||||
logging.info(_("Initialising submodules"))
|
logging.info(_("Initialising submodules"))
|
||||||
vcs.initsubmodules()
|
vcs.initsubmodules()
|
||||||
|
else:
|
||||||
|
vcs.deinitsubmodules()
|
||||||
|
|
||||||
# Check that a subdir (if we're using one) exists. This has to happen
|
# Check that a subdir (if we're using one) exists. This has to happen
|
||||||
# after the checkout, since it might not exist elsewhere
|
# after the checkout, since it might not exist elsewhere
|
||||||
|
|
|
@ -586,6 +586,9 @@ class BuildTest(unittest.TestCase):
|
||||||
def getsrclib(self):
|
def getsrclib(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def deinitsubmodules(self):
|
||||||
|
pass
|
||||||
|
|
||||||
# Test we trigger a scanner error without extlibs
|
# Test we trigger a scanner error without extlibs
|
||||||
build.extlibs = []
|
build.extlibs = []
|
||||||
os.makedirs('build/libs')
|
os.makedirs('build/libs')
|
||||||
|
|
|
@ -315,6 +315,9 @@ class CommonTest(unittest.TestCase):
|
||||||
def getsrclib(self):
|
def getsrclib(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def deinitsubmodules(self):
|
||||||
|
pass
|
||||||
|
|
||||||
fdroidserver.common.prepare_source(FakeVcs(), app, build,
|
fdroidserver.common.prepare_source(FakeVcs(), app, build,
|
||||||
fdroidclient_testdir, fdroidclient_testdir, fdroidclient_testdir)
|
fdroidclient_testdir, fdroidclient_testdir, fdroidclient_testdir)
|
||||||
|
|
||||||
|
@ -385,6 +388,9 @@ class CommonTest(unittest.TestCase):
|
||||||
def getsrclib(self):
|
def getsrclib(self):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def deinitsubmodules(self):
|
||||||
|
pass
|
||||||
|
|
||||||
fdroidserver.common.prepare_source(FakeVcs(), app, build,
|
fdroidserver.common.prepare_source(FakeVcs(), app, build,
|
||||||
app_build_dir, srclib_testdir, app_build_dir,
|
app_build_dir, srclib_testdir, app_build_dir,
|
||||||
onserver=True, refresh=False) # do not clone in this test
|
onserver=True, refresh=False) # do not clone in this test
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue