mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	rename v1_sort_packages to sort_package_versions
This commit is contained in:
		
							parent
							
								
									8565a97465
								
							
						
					
					
						commit
						38378ddfb7
					
				
					 2 changed files with 8 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -730,7 +730,7 @@ def make_v2(apps, packages, repodir, repodict, requestsdict, signer_fingerprints
 | 
			
		|||
        output["repo"]["requests"] = requestsdict
 | 
			
		||||
 | 
			
		||||
    # establish sort order of the index
 | 
			
		||||
    v1_sort_packages(packages, signer_fingerprints)
 | 
			
		||||
    sort_package_versions(packages, signer_fingerprints)
 | 
			
		||||
 | 
			
		||||
    output_packages = collections.OrderedDict()
 | 
			
		||||
    output['packages'] = output_packages
 | 
			
		||||
| 
						 | 
				
			
			@ -875,7 +875,7 @@ def make_v1(apps, packages, repodir, repodict, requestsdict, signer_fingerprints
 | 
			
		|||
        output['repo']['mirrors'] = mirrors
 | 
			
		||||
 | 
			
		||||
    # establish sort order of the index
 | 
			
		||||
    v1_sort_packages(packages, signer_fingerprints)
 | 
			
		||||
    sort_package_versions(packages, signer_fingerprints)
 | 
			
		||||
 | 
			
		||||
    appslist = []
 | 
			
		||||
    output['apps'] = appslist
 | 
			
		||||
| 
						 | 
				
			
			@ -983,8 +983,8 @@ def _copy_to_local_copy_dir(repodir, f):
 | 
			
		|||
                              .format(path=local_copy_dir))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def v1_sort_packages(packages, signer_fingerprints):
 | 
			
		||||
    """Sort the supplied list to ensure a deterministic sort order for package entries in the index file.
 | 
			
		||||
def sort_package_versions(packages, signer_fingerprints):
 | 
			
		||||
    """Sort to ensure a deterministic order for package versions in the index file.
 | 
			
		||||
 | 
			
		||||
    This sort-order also expresses
 | 
			
		||||
    installation preference to the clients.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -240,7 +240,7 @@ class IndexTest(unittest.TestCase):
 | 
			
		|||
        with self.assertRaises(fdroidserver.exception.VerificationException):
 | 
			
		||||
            data, _ignored = index.download_repo_index_v2(url)
 | 
			
		||||
 | 
			
		||||
    def test_v1_sort_packages(self):
 | 
			
		||||
    def test_sort_package_versions(self):
 | 
			
		||||
        i = [
 | 
			
		||||
            {
 | 
			
		||||
                'packageName': 'org.smssecure.smssecure',
 | 
			
		||||
| 
						 | 
				
			
			@ -382,9 +382,7 @@ class IndexTest(unittest.TestCase):
 | 
			
		|||
            publish.sign_sig_key_fingerprint_list(jarfile)
 | 
			
		||||
            common.write_config_file('')
 | 
			
		||||
 | 
			
		||||
            index.v1_sort_packages(
 | 
			
		||||
                i, common.load_publish_signer_fingerprints()
 | 
			
		||||
            )
 | 
			
		||||
            index.sort_package_versions(i, common.load_publish_signer_fingerprints())
 | 
			
		||||
            self.maxDiff = None
 | 
			
		||||
            self.assertEqual(json.dumps(i, indent=2), json.dumps(o, indent=2))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -646,7 +644,7 @@ class IndexTest(unittest.TestCase):
 | 
			
		|||
            self.maxDiff = None
 | 
			
		||||
            self.assertEqual(css, pretty_css)
 | 
			
		||||
 | 
			
		||||
    def test_v1_sort_packages_with_invalid(self):
 | 
			
		||||
    def test_sort_package_versions_with_invalid(self):
 | 
			
		||||
        i = [
 | 
			
		||||
            {
 | 
			
		||||
                'packageName': 'org.smssecure.smssecure',
 | 
			
		||||
| 
						 | 
				
			
			@ -656,7 +654,7 @@ class IndexTest(unittest.TestCase):
 | 
			
		|||
            }
 | 
			
		||||
        ]
 | 
			
		||||
 | 
			
		||||
        index.v1_sort_packages(i, common.load_publish_signer_fingerprints())
 | 
			
		||||
        index.sort_package_versions(i, common.load_publish_signer_fingerprints())
 | 
			
		||||
 | 
			
		||||
    def test_package_metadata(self):
 | 
			
		||||
        """A smoke check and format check of index.package_metadata()"""
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue