import: use valid placeholder values for versionCode/versionName

fdroid/fdroidserver!559
closes fdroid/fdroidserver#548
This commit is contained in:
Hans-Christoph Steiner 2018-10-10 15:04:45 +02:00
parent aea2589c67
commit bfdf581201
2 changed files with 9 additions and 11 deletions

View file

@ -227,11 +227,11 @@ def main():
if local_metadata_files != []:
raise FDroidException(_("This repo already has local metadata: %s") % local_metadata_files[0])
build = metadata.Build()
if options.url is None and os.path.isdir('.git'):
app.AutoName = os.path.basename(os.getcwd())
app.RepoType = 'git'
build = metadata.Build()
root_dir = get_subdir(os.getcwd())
if os.path.exists('build.gradle'):
build.gradle = ['yes']
@ -250,7 +250,6 @@ def main():
write_local_file = True
elif options.url:
root_dir, build_dir = get_metadata_from_url(app, options.url)
build = metadata.Build()
build.commit = '?'
build.disable = 'Generated by import.py - check/set version fields and commit id'
write_local_file = False
@ -286,8 +285,8 @@ def main():
raise FDroidException("Package " + package + " already exists")
# Create a build line...
build.versionName = versionName or '?'
build.versionCode = versionCode or '?'
build.versionName = versionName or 'Unknown'
build.versionCode = versionCode or '0' # TODO heinous but this is still a str
if options.subdir:
build.subdir = options.subdir
if options.license: