mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	update: include stages timing info in update.json
!1627 missed this, so stages only get included in running.json. That means the stages info is only visible while update is running, making it hard to use.
This commit is contained in:
		
							parent
							
								
									3b360f6b80
								
							
						
					
					
						commit
						2a33857fd0
					
				
					 2 changed files with 5 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -133,7 +133,7 @@ def disabled_algorithms_allowed():
 | 
			
		|||
            or common.default_config['allow_disabled_algorithms'])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def status_update_json(apps, apks):
 | 
			
		||||
def status_update_json(output, apps, apks):
 | 
			
		||||
    """Output a JSON file with metadata about this `fdroid update` run.
 | 
			
		||||
 | 
			
		||||
    Parameters
 | 
			
		||||
| 
						 | 
				
			
			@ -145,7 +145,6 @@ def status_update_json(apps, apks):
 | 
			
		|||
 | 
			
		||||
    """
 | 
			
		||||
    logging.debug(_('Outputting JSON'))
 | 
			
		||||
    output = common.setup_status_output(start_timestamp)
 | 
			
		||||
    output['antiFeatures'] = dict()
 | 
			
		||||
    output['disabled'] = []
 | 
			
		||||
    output['archivePolicy0'] = []
 | 
			
		||||
| 
						 | 
				
			
			@ -2801,7 +2800,7 @@ def main():
 | 
			
		|||
        output_status_stage(status_output, 'make_binary_transparency_log')
 | 
			
		||||
        btlog.make_binary_transparency_log(repodirs)
 | 
			
		||||
 | 
			
		||||
    status_update_json(apps, apks + archapks)
 | 
			
		||||
    status_update_json(status_output, apps, apks + archapks)
 | 
			
		||||
 | 
			
		||||
    logging.info(_("Finished"))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1639,7 +1639,7 @@ class UpdateTest(unittest.TestCase):
 | 
			
		|||
        with mkdtemp() as tmpdir:
 | 
			
		||||
            os.chdir(tmpdir)
 | 
			
		||||
            with mock.patch('sys.argv', ['fdroid update', '']):
 | 
			
		||||
                fdroidserver.update.status_update_json([], [])
 | 
			
		||||
                fdroidserver.update.status_update_json({}, [], [])
 | 
			
		||||
                with open('repo/status/update.json') as fp:
 | 
			
		||||
                    data = json.load(fp)
 | 
			
		||||
                self.assertTrue('apksigner' in data)
 | 
			
		||||
| 
						 | 
				
			
			@ -1647,14 +1647,14 @@ class UpdateTest(unittest.TestCase):
 | 
			
		|||
                fdroidserver.update.config = {
 | 
			
		||||
                    'apksigner': 'apksigner',
 | 
			
		||||
                }
 | 
			
		||||
                fdroidserver.update.status_update_json([], [])
 | 
			
		||||
                fdroidserver.update.status_update_json({}, [], [])
 | 
			
		||||
                with open('repo/status/update.json') as fp:
 | 
			
		||||
                    data = json.load(fp)
 | 
			
		||||
                self.assertEqual(shutil.which(fdroidserver.update.config['apksigner']), data['apksigner'])
 | 
			
		||||
 | 
			
		||||
                fdroidserver.update.config = {}
 | 
			
		||||
                fdroidserver.common.fill_config_defaults(fdroidserver.update.config)
 | 
			
		||||
                fdroidserver.update.status_update_json([], [])
 | 
			
		||||
                fdroidserver.update.status_update_json({}, [], [])
 | 
			
		||||
                with open('repo/status/update.json') as fp:
 | 
			
		||||
                    data = json.load(fp)
 | 
			
		||||
                self.assertEqual(fdroidserver.update.config.get('apksigner'), data['apksigner'])
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue