diff --git a/MANIFEST.in b/MANIFEST.in index e301d8a8..ea144609 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -662,7 +662,6 @@ include tests/org.bitbucket.tickytacky.mirrormirror_4.apk include tests/org.dyndns.fules.ck_20.apk include tests/org.sajeg.fallingblocks_3.apk include tests/publish.TestCase -include tests/repo/categories.txt include tests/repo/com.example.test.helloworld_1.apk include tests/repo/com.politedroid_3.apk include tests/repo/com.politedroid_4.apk diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 1af0fc82..73f25365 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -4042,7 +4042,6 @@ def is_repo_file(filename, for_gpg_signing=False): if isinstance(filename, str): filename = filename.encode('utf-8', errors="surrogateescape") ignore_files = [ - b'categories.txt', b'entry.jar', b'index-v1.jar', b'index.css', diff --git a/fdroidserver/update.py b/fdroidserver/update.py index 86070c67..44e95c28 100644 --- a/fdroidserver/update.py +++ b/fdroidserver/update.py @@ -1846,15 +1846,6 @@ def apply_info_from_latest_apk(apps, apks): app['CurrentVersionCode'] = bestver -def make_categories_txt(repodir, categories): - """Write a category list in the repo to allow quick access.""" - catdata = '' - for cat in sorted(categories): - catdata += cat + '\n' - with open(os.path.join(repodir, 'categories.txt'), 'w') as f: - f.write(catdata) - - def archive_old_apks(apps, apks, archapks, repodir, archivedir, defaultkeepversions): def filter_apk_list_sorted(apk_list): apkList = [] @@ -2246,11 +2237,6 @@ def main(): # Get all apps... apps = metadata.read_metadata() - # Generate a list of categories... - categories = set() - for app in apps.values(): - categories.update(app.Categories) - # Read known apks data (will be updated and written back when we've finished) knownapks = common.KnownApks() @@ -2363,7 +2349,6 @@ def main(): # Make the index for the main repo... index.make(repoapps, apks, repodirs[0], False) - make_categories_txt(repodirs[0], categories) git_remote = config.get('binary_transparency_remote') if git_remote or os.path.isdir(os.path.join('binary_transparency', '.git')): diff --git a/tests/common.TestCase b/tests/common.TestCase index 8820004d..56625598 100755 --- a/tests/common.TestCase +++ b/tests/common.TestCase @@ -2509,8 +2509,7 @@ class CommonTest(unittest.TestCase): 'repo/index.png', 'repo/index.xml', ] - non_repo_files = ['repo/categories.txt'] - for f in repo_files + index_files + non_repo_files: + for f in repo_files + index_files: open(f, 'w').close() repo_dirs = [ @@ -2543,10 +2542,6 @@ class CommonTest(unittest.TestCase): self.assertTrue(os.path.exists(d), d + ' was created') self.assertFalse(is_repo_file(d), d + ' not repo file') - for f in non_repo_files: - self.assertTrue(os.path.exists(f), f + ' was created') - self.assertFalse(is_repo_file(f), f + ' not repo file') - def test_get_apksigner_smartcardoptions(self): os.chdir(self.tmpdir) with open('config.yml', 'w') as fp: diff --git a/tests/repo/categories.txt b/tests/repo/categories.txt deleted file mode 100644 index 9af231f5..00000000 --- a/tests/repo/categories.txt +++ /dev/null @@ -1,10 +0,0 @@ -1 -2.0 -Development -GuardianProject -Multimedia -Phone & SMS -Security -System -Time -tests diff --git a/tests/update.TestCase b/tests/update.TestCase index 2552ce0b..391dec93 100755 --- a/tests/update.TestCase +++ b/tests/update.TestCase @@ -22,6 +22,7 @@ import zipfile import textwrap from datetime import datetime from distutils.version import LooseVersion +from pathlib import Path from testcommon import TmpCwd, mkdtemp from unittest import mock @@ -1789,6 +1790,20 @@ class UpdateTest(unittest.TestCase): "DEBUG:root:Checking archiving for org.smssecure.smssecure - apks:0, keepversions:6, archapks:0" ]) + def test_categories_txt_is_removed_by_delete_unknown(self): + """categories.txt used to be a part of this system, now its nothing.""" + os.chdir(self.testdir) + Path('config.yml').write_text('repo_pubkey: ffffffffffffffffffffffffffffffffffffffff') + + categories_txt = Path('repo/categories.txt') + categories_txt.parent.mkdir() + categories_txt.write_text('placeholder') + + self.assertTrue(categories_txt.exists()) + with mock.patch('sys.argv', ['fdroid update', '--delete-unknown', '--nosign']): + fdroidserver.update.main() + self.assertFalse(categories_txt.exists()) + if __name__ == "__main__": os.chdir(os.path.dirname(__file__))