mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	rewritemeta only applies to the original .txt metadata format
This commit is contained in:
		
							parent
							
								
									6c44bff78b
								
							
						
					
					
						commit
						19ac44c189
					
				
					 2 changed files with 24 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -450,19 +450,26 @@ always named as the application's package ID with '.txt' appended.
 | 
			
		|||
Additionally, you can use JSON, XML, or YAML for app metadata, using
 | 
			
		||||
the same fields as the original '.txt' format.
 | 
			
		||||
 | 
			
		||||
Note that although the metadata files are designed to be easily read and
 | 
			
		||||
writable by humans, they are also processed and written by various scripts.
 | 
			
		||||
They are capable of rewriting the entire file when necessary. Even so,
 | 
			
		||||
the structure and comments will be preserved correctly, although the order
 | 
			
		||||
of fields will be standardised. (In the event that the original file was
 | 
			
		||||
in a different order, comments are considered as being attached to the field
 | 
			
		||||
following them). In fact, you can standardise all the metadata in a single
 | 
			
		||||
command, without changing the functional content, by running:
 | 
			
		||||
Note that although the metadata files are designed to be easily read
 | 
			
		||||
and writable by humans, they are also processed and written by various
 | 
			
		||||
scripts.  The original '.txt' format can be automatically cleaned up
 | 
			
		||||
when necessary.  The structure and comments will be preserved
 | 
			
		||||
correctly, although the order of fields will be standardised. (In the
 | 
			
		||||
event that the original file was in a different order, comments are
 | 
			
		||||
considered as being attached to the field following them). In fact,
 | 
			
		||||
you can standardise all the '.txt' metadata in a single command,
 | 
			
		||||
without changing the functional content, by running:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
fdroid rewritemeta
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
Or just run it on a specific app:
 | 
			
		||||
 | 
			
		||||
@example
 | 
			
		||||
fdroid rewritemeta org.adaway
 | 
			
		||||
@end example
 | 
			
		||||
 | 
			
		||||
The following sections describe the fields recognised within the file.
 | 
			
		||||
 | 
			
		||||
@menu
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,6 +2,7 @@
 | 
			
		|||
# -*- coding: utf-8 -*-
 | 
			
		||||
#
 | 
			
		||||
# rewritemeta.py - part of the FDroid server tools
 | 
			
		||||
# This cleans up the original .txt metadata file format.
 | 
			
		||||
# Copyright (C) 2010-12, Ciaran Gultnieks, ciaran@ciarang.com
 | 
			
		||||
#
 | 
			
		||||
# This program is free software: you can redistribute it and/or modify
 | 
			
		||||
| 
						 | 
				
			
			@ -46,8 +47,14 @@ def main():
 | 
			
		|||
    apps = common.read_app_args(args, allapps, False)
 | 
			
		||||
 | 
			
		||||
    for appid, app in apps.iteritems():
 | 
			
		||||
        logging.info("Writing " + appid)
 | 
			
		||||
        metadata.write_metadata(os.path.join('metadata', appid) + '.txt', app)
 | 
			
		||||
        metadatapath = app['metadatapath']
 | 
			
		||||
        ext = os.path.splitext(metadatapath)[1][1:]
 | 
			
		||||
        if ext == 'txt':
 | 
			
		||||
            logging.info("Rewriting " + metadatapath)
 | 
			
		||||
            metadata.write_metadata(metadatapath, app)
 | 
			
		||||
        else:
 | 
			
		||||
            logging.info("Ignoring %s file at '%s'"
 | 
			
		||||
                         % (ext.upper(), metadatapath))
 | 
			
		||||
 | 
			
		||||
    logging.info("Finished.")
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue