new config option: per-app repos to support nightly build repos

For devs that want to build and distribute nightly builds of their apps
using the fdroid tools.  The core idea here is to make the fdroidserver
tool suite the single set of tools for all types of builds and releases.
That will hopefully drive more free software developers to make f-droid.org
an core channel for official releases.
This commit is contained in:
Hans-Christoph Steiner 2015-08-20 17:40:18 +02:00
parent e614863c69
commit b5cbb4382f
4 changed files with 68 additions and 0 deletions

View file

@ -58,6 +58,7 @@ default_config = {
'mvn3': "mvn",
'gradle': 'gradle',
'sync_from_local_copy_dir': False,
'per_app_repos': False,
'make_current_version_link': True,
'current_version_name_source': 'Name',
'update_stats': False,
@ -2135,3 +2136,26 @@ def download_file(url, local_filename=None, dldir='tmp'):
f.write(chunk)
f.flush()
return local_filename
def get_per_app_repos():
'''per-app repos are dirs named with the packageName of a single app'''
# Android packageNames are Java packages, they may contain uppercase or
# lowercase letters ('A' through 'Z'), numbers, and underscores
# ('_'). However, individual package name parts may only start with
# letters. https://developer.android.com/guide/topics/manifest/manifest-element.html#package
p = re.compile('^([a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)*)?$')
repos = []
for root, dirs, files in os.walk(os.getcwd()):
for d in dirs:
print 'checking', root, 'for', d
if d in ('archive', 'metadata', 'repo', 'srclibs', 'tmp'):
# standard parts of an fdroid repo, so never packageNames
continue
elif p.match(d) \
and os.path.exists(os.path.join(d, 'fdroid', 'repo', 'index.jar')):
repos.append(d)
break
return repos