1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-03 17:50:11 +02:00

Automatic transfer of specified built apps to repository during update

This commit is contained in:
Ciaran Gultnieks 2011-01-05 22:20:57 +00:00
parent cde355146c
commit ea7fe6b3e0
4 changed files with 23 additions and 4 deletions

6
README
View File

@ -117,6 +117,12 @@ Another example, using extra parameters:
Build Version:1.09.03,10903,45,subdir=Timeriffic,oldsdkloc=yes
==Use Built==
Set this to "Yes" to use built versions of the application for the repository.
Currently, this just triggers update.py to copy the relevant apks and tarballs
from the 'built' directory before updating the repo index.
==AntiFeatures==
This is optional - if present, it contains a comma-separated list of any of

View File

@ -174,7 +174,7 @@ for app in apps:
#Delete unwanted file...
if thisbuild.has_key('rm'):
os.remove(os.path.join(root_dir, thisbuild['rm']))
os.remove(os.path.join(build_dir, thisbuild['rm']))
#Build the source tarball right before we build the relase...
tarname = app['id'] + '_' + thisbuild['vercode'] + '_src'

View File

@ -41,6 +41,7 @@ def read_metadata():
thisinfo['repotype'] = ''
thisinfo['repo'] = ''
thisinfo['builds'] = []
thisinfo['usebuilt'] = False
f = open(metafile, 'r')
mode = 0
for line in f.readlines():
@ -102,6 +103,9 @@ def read_metadata():
pp = p.split('=')
thisbuild[pp[0]] = pp[1]
thisinfo['builds'].append(thisbuild)
elif field == "Use Built":
if value == "Yes":
thisinfo['usebuilt'] = True
else:
print "Unrecognised field " + field
sys.exit(1)

View File

@ -63,6 +63,18 @@ if (repo_url is None or repo_name is None or
print "See config.sample.py for details"
sys.exit(1)
# Get all apps...
apps = read_metadata()
# Copy apks and source tarballs for stuff we've built from source that
# is flagged to be included in the repo...
for app in apps:
if app['usebuilt']:
print "Copying built files for " + app['id']
src = os.path.join('built', app['id'] + "_*")
for file in glob.glob(src):
shutil.copy(file, 'repo/')
# Gather information about all the apk files in the repo directory...
apks = []
for apkfile in glob.glob(os.path.join('repo','*.apk')):
@ -146,9 +158,6 @@ for apkfile in glob.glob(os.path.join('repo','*.apk')):
apks.append(thisinfo)
# Get all apps...
apps = read_metadata()
# Some information from the apks needs to be applied up to the application
# level. When doing this, we use the info from the most recent version's apk.
for app in apps: