🐛 index fix: skip altstore when no IPAs present

This commit is contained in:
Michael Pöhn 2024-04-24 12:45:29 +02:00
parent 07929ffe66
commit bd6afa4365
No known key found for this signature in database
GPG key ID: 725F386C05529A5A
2 changed files with 6 additions and 0 deletions

View file

@ -1766,6 +1766,10 @@ def make_altstore(apps, apks, config, repodir, pretty=False):
https://faq.altstore.io/distribute-your-apps/make-a-source https://faq.altstore.io/distribute-your-apps/make-a-source
https://faq.altstore.io/distribute-your-apps/updating-apps https://faq.altstore.io/distribute-your-apps/updating-apps
""" """
if not any(Path('repo').glob('*.ipa')):
# no IPA files present in repo, nothing to do here, exiting early
return
indent = 2 if pretty else None indent = 2 if pretty else None
# for now alt-store support is english only # for now alt-store support is english only
for lang in ['en']: for lang in ['en']:

View file

@ -869,6 +869,8 @@ class AltstoreIndexTest(unittest.TestCase):
with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir): with tempfile.TemporaryDirectory() as tmpdir, TmpCwd(tmpdir):
repodir = Path(tmpdir) / 'repo' repodir = Path(tmpdir) / 'repo'
repodir.mkdir() repodir.mkdir()
with open(repodir / "fake.ipa", "w") as f:
f.write("")
fdroidserver.index.make_altstore( fdroidserver.index.make_altstore(
apps, apps,