mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	Add default locale for generated categories
The client expects at least a name to be set.
Regression of 2c566cf6.
			
			
This commit is contained in:
		
							parent
							
								
									b5724f507b
								
							
						
					
					
						commit
						521ff4fe17
					
				
					 4 changed files with 20 additions and 8 deletions
				
			
		| 
						 | 
					@ -746,7 +746,7 @@ def make_v2(apps, packages, repodir, repodict, requestsdict, fdroid_signing_key_
 | 
				
			||||||
    # include definitions for "auto-defined" categories, e.g. just used in app metadata
 | 
					    # include definitions for "auto-defined" categories, e.g. just used in app metadata
 | 
				
			||||||
    for category in sorted(categories_used_by_apps):
 | 
					    for category in sorted(categories_used_by_apps):
 | 
				
			||||||
        if category not in output['repo'][CATEGORIES_CONFIG_NAME]:
 | 
					        if category not in output['repo'][CATEGORIES_CONFIG_NAME]:
 | 
				
			||||||
            output['repo'][CATEGORIES_CONFIG_NAME][category] = dict()
 | 
					            output['repo'][CATEGORIES_CONFIG_NAME][category] = {"name": {DEFAULT_LOCALE: category}}
 | 
				
			||||||
    # do not include defined categories if no apps use them
 | 
					    # do not include defined categories if no apps use them
 | 
				
			||||||
    for category in list(output['repo'].get(CATEGORIES_CONFIG_NAME, list())):
 | 
					    for category in list(output['repo'].get(CATEGORIES_CONFIG_NAME, list())):
 | 
				
			||||||
        if category not in categories_used_by_apps:
 | 
					        if category not in categories_used_by_apps:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
  "version": 20002,
 | 
					  "version": 20002,
 | 
				
			||||||
  "index": {
 | 
					  "index": {
 | 
				
			||||||
    "name": "/index-v2.json",
 | 
					    "name": "/index-v2.json",
 | 
				
			||||||
    "sha256": "5e3c0eaafd99d3518da2bb2bc7565b2ebcb17775a2f4ccc33b7336901ec71a6f",
 | 
					    "sha256": "72146bc3bbbfd49c4e23435ca8ba13d58673a83fa4634f7ce2ea465616860293",
 | 
				
			||||||
    "size": 53283,
 | 
					    "size": 53283,
 | 
				
			||||||
    "numPackages": 10
 | 
					    "numPackages": 10
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -534,9 +534,21 @@
 | 
				
			||||||
          "en-US": "System"
 | 
					          "en-US": "System"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "1": {},
 | 
					      "1": {
 | 
				
			||||||
      "2.0": {},
 | 
					        "name": {
 | 
				
			||||||
      "tests": {}
 | 
					          "en-US": "1"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      "2.0": {
 | 
				
			||||||
 | 
					        "name": {
 | 
				
			||||||
 | 
					          "en-US": "2.0"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      "tests": {
 | 
				
			||||||
 | 
					        "name": {
 | 
				
			||||||
 | 
					          "en-US": "tests"
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "requests": {
 | 
					    "requests": {
 | 
				
			||||||
      "install": [
 | 
					      "install": [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1842,7 +1842,7 @@ class UpdateTest(unittest.TestCase):
 | 
				
			||||||
        with open('repo/index-v2.json') as fp:
 | 
					        with open('repo/index-v2.json') as fp:
 | 
				
			||||||
            index = json.load(fp)
 | 
					            index = json.load(fp)
 | 
				
			||||||
        self.assertEqual(
 | 
					        self.assertEqual(
 | 
				
			||||||
            {'Time': dict()},
 | 
					            {'Time': {'name': {'en-US': 'Time'}}},
 | 
				
			||||||
            index['repo'][CATEGORIES_CONFIG_NAME],
 | 
					            index['repo'][CATEGORIES_CONFIG_NAME],
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1867,7 +1867,7 @@ class UpdateTest(unittest.TestCase):
 | 
				
			||||||
        with open('repo/index-v2.json') as fp:
 | 
					        with open('repo/index-v2.json') as fp:
 | 
				
			||||||
            index = json.load(fp)
 | 
					            index = json.load(fp)
 | 
				
			||||||
        self.assertEqual(
 | 
					        self.assertEqual(
 | 
				
			||||||
            {'bar': dict(), 'foo': dict()},
 | 
					            {'bar': {'name': {'en-US': 'bar'}}, 'foo': {'name': {'en-US': 'foo'}}},
 | 
				
			||||||
            index['repo'][CATEGORIES_CONFIG_NAME],
 | 
					            index['repo'][CATEGORIES_CONFIG_NAME],
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1894,7 +1894,7 @@ class UpdateTest(unittest.TestCase):
 | 
				
			||||||
        with open('repo/index-v2.json') as fp:
 | 
					        with open('repo/index-v2.json') as fp:
 | 
				
			||||||
            index = json.load(fp)
 | 
					            index = json.load(fp)
 | 
				
			||||||
        self.assertEqual(
 | 
					        self.assertEqual(
 | 
				
			||||||
            {'System': {'name': {'en-US': 'System Apps'}}, 'Time': dict()},
 | 
					            {'System': {'name': {'en-US': 'System Apps'}}, 'Time': {'name': {'en-US': 'Time'}}},
 | 
				
			||||||
            index['repo'][CATEGORIES_CONFIG_NAME],
 | 
					            index['repo'][CATEGORIES_CONFIG_NAME],
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue