nightly: fail if *-nightly git repo is not publicly available

This commit is contained in:
Hans-Christoph Steiner 2022-11-14 23:13:13 +01:00
parent 15bd7057f0
commit c2567d71d1
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
3 changed files with 38 additions and 9 deletions

View file

@ -35,7 +35,7 @@ from argparse import ArgumentParser
from . import _
from . import common
from .exception import VCSException
# hard coded defaults for Android ~/.android/debug.keystore files
# https://developers.google.com/android/guides/client-auth
@ -205,6 +205,7 @@ def main():
)
# TODO add --with-btlog
options = parser.parse_args()
common.options = options
# force a tighter umask since this writes private key material
umask = os.umask(0o077)
@ -284,10 +285,11 @@ def main():
git_mirror_statsdir = os.path.join(git_mirror_path, 'fdroid', 'stats')
if not os.path.isdir(git_mirror_repodir):
logging.debug(_('cloning {url}').format(url=clone_url))
try:
git.Repo.clone_from(clone_url, git_mirror_path)
except Exception:
pass
vcs = common.getvcs('git', clone_url, git_mirror_path)
p = vcs.git(['clone', '--', vcs.remote, str(vcs.local)])
if p.returncode != 0:
print('WARNING: only public git repos are supported!')
raise VCSException('git clone %s failed:' % clone_url, p.output)
if not os.path.isdir(git_mirror_repodir):
os.makedirs(git_mirror_repodir, mode=0o755)