mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-20 13:50:12 +01:00
purge accepted_formats from config
This commit is contained in:
parent
40cbbd3173
commit
f5a5fffb10
@ -119,7 +119,6 @@ default_config = {
|
||||
'mvn3': "mvn",
|
||||
'gradle': os.path.join(FDROID_PATH, 'gradlew-fdroid'),
|
||||
'gradle_version_dir': os.path.join(os.path.join(os.getenv('HOME'), '.cache', 'fdroidserver'), 'gradle'),
|
||||
'accepted_formats': ['yml'],
|
||||
'sync_from_local_copy_dir': False,
|
||||
'allow_disabled_algorithms': False,
|
||||
'per_app_repos': False,
|
||||
|
@ -515,16 +515,12 @@ def check_for_unsupported_metadata_files(basedir=""):
|
||||
global config
|
||||
|
||||
return_value = False
|
||||
formats = config['accepted_formats']
|
||||
for f in glob.glob(basedir + 'metadata/*') + glob.glob(basedir + 'metadata/.*'):
|
||||
if os.path.isdir(f):
|
||||
exists = False
|
||||
for t in formats:
|
||||
exists = exists or os.path.exists(f + '.' + t)
|
||||
if not exists:
|
||||
if not os.path.exists(f + '.yml'):
|
||||
print(_('"%s/" has no matching metadata file!') % f)
|
||||
return_value = True
|
||||
elif os.path.splitext(f)[1][1:] in formats:
|
||||
elif os.path.splitext(f)[1][1:] == "yml":
|
||||
packageName = os.path.splitext(os.path.basename(f))[0]
|
||||
if not common.is_valid_package_name(packageName):
|
||||
print('"' + packageName + '" is an invalid package name!\n'
|
||||
@ -532,7 +528,7 @@ def check_for_unsupported_metadata_files(basedir=""):
|
||||
return_value = True
|
||||
else:
|
||||
print('"' + f.replace(basedir, '')
|
||||
+ '" is not a supported file format: (' + ','.join(formats) + ')')
|
||||
+ '" is not a supported file format (use: .yml)')
|
||||
return_value = True
|
||||
|
||||
return return_value
|
||||
|
@ -928,10 +928,6 @@ def parse_metadata(metadatapath, check_vcs=False, refresh=True):
|
||||
'''parse metadata file, optionally checking the git repo for metadata first'''
|
||||
|
||||
_ignored, ext = fdroidserver.common.get_extension(metadatapath)
|
||||
accepted = fdroidserver.common.config['accepted_formats']
|
||||
if ext not in accepted:
|
||||
warn_or_exception(_('"{path}" is not an accepted format, convert to: {formats}')
|
||||
.format(path=metadatapath, formats=', '.join(accepted)))
|
||||
|
||||
app = App()
|
||||
app.metadatapath = metadatapath
|
||||
@ -1172,10 +1168,6 @@ build_cont = re.compile(r'^[ \t]')
|
||||
|
||||
def write_metadata(metadatapath, app):
|
||||
_ignored, ext = fdroidserver.common.get_extension(metadatapath)
|
||||
accepted = fdroidserver.common.config['accepted_formats']
|
||||
if ext not in accepted:
|
||||
warn_or_exception(_('Cannot write "{path}", not an accepted format, use: {formats}')
|
||||
.format(path=metadatapath, formats=', '.join(accepted)))
|
||||
|
||||
if ext == 'yml':
|
||||
if importlib.util.find_spec('ruamel.yaml'):
|
||||
|
@ -248,7 +248,6 @@ Last updated: {date}'''.format(repo_git_base=repo_git_base,
|
||||
config += "keypass = '%s'\n" % PASSWORD
|
||||
config += "keydname = '%s'\n" % DISTINGUISHED_NAME
|
||||
config += "make_current_version_link = False\n"
|
||||
config += "accepted_formats = ['yml']\n"
|
||||
config += "update_stats = True\n"
|
||||
with open('config.py', 'w') as fp:
|
||||
fp.write(config)
|
||||
|
Loading…
Reference in New Issue
Block a user