mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 15:32:30 +03:00
Merge branch 'master' of git://gitorious.org/f-droid/fdroidserver
This commit is contained in:
commit
17cb991fd5
6 changed files with 34 additions and 31 deletions
|
@ -607,26 +607,27 @@ def write_metadata(dest, app):
|
|||
|
||||
# Read all metadata. Returns a list of 'app' objects (which are dictionaries as
|
||||
# returned by the parse_metadata function.
|
||||
def read_metadata(verbose=False):
|
||||
def read_metadata(verbose=False, xref=True):
|
||||
apps = []
|
||||
for metafile in sorted(glob.glob(os.path.join('metadata', '*.txt'))):
|
||||
if verbose:
|
||||
print "Reading " + metafile
|
||||
apps.append(parse_metadata(metafile, verbose=verbose))
|
||||
|
||||
# Parse all descriptions at load time, just to ensure cross-referencing
|
||||
# errors are caught early rather than when they hit the build server.
|
||||
def linkres(link):
|
||||
if xref:
|
||||
# Parse all descriptions at load time, just to ensure cross-referencing
|
||||
# errors are caught early rather than when they hit the build server.
|
||||
def linkres(link):
|
||||
for app in apps:
|
||||
if app['id'] == link:
|
||||
return ("fdroid.app:" + link, "Dummy name - don't know yet")
|
||||
raise MetaDataException("Cannot resolve app id " + link)
|
||||
for app in apps:
|
||||
if app['id'] == link:
|
||||
return ("fdroid.app:" + link, "Dummy name - don't know yet")
|
||||
raise MetaDataException("Cannot resolve app id " + link)
|
||||
for app in apps:
|
||||
try:
|
||||
description_html(app['Description'], linkres)
|
||||
except Exception, e:
|
||||
raise MetaDataException("Problem with description of " + app['id'] +
|
||||
" - " + str(e))
|
||||
try:
|
||||
description_html(app['Description'], linkres)
|
||||
except Exception, e:
|
||||
raise MetaDataException("Problem with description of " + app['id'] +
|
||||
" - " + str(e))
|
||||
|
||||
return apps
|
||||
|
||||
|
@ -866,6 +867,7 @@ class MetaDataException(Exception):
|
|||
# TODO: These are currently just hard-coded in this method. It will be a
|
||||
# metadata-driven system eventually, but not yet.
|
||||
def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
||||
|
||||
name, ref = spec.split('@')
|
||||
|
||||
if name == 'GreenDroid':
|
||||
|
@ -1015,8 +1017,6 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
|||
vcs = getvcs('git',
|
||||
'https://code.google.com/r/andreasschildbach-bitcoinj/', sdir, sdk_path)
|
||||
vcs.gotorevision(ref)
|
||||
if subprocess.call([mvn3, 'install'], cwd=sdir) != 0:
|
||||
raise BuildException("Maven build failed for BitcoinJWallet srclib")
|
||||
return sdir
|
||||
|
||||
if name == 'Color-Picker':
|
||||
|
@ -1139,10 +1139,11 @@ def getsrclib(spec, extlib_dir, sdk_path, basepath=False):
|
|||
# 'sdk_path' - the path to the Android SDK
|
||||
# 'ndk_path' - the path to the Android NDK
|
||||
# 'javacc_path' - the path to javacc
|
||||
# 'mvn3' - the path to the maven 3 executable
|
||||
# 'verbose' - optional: verbose or not (default=False)
|
||||
# Returns the root directory, which may be the same as 'build_dir' or may
|
||||
# be a subdirectory of it.
|
||||
def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, verbose=False):
|
||||
def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, javacc_path, mvn3, verbose=False):
|
||||
|
||||
# Optionally, the actual app source can be in a subdirectory...
|
||||
if build.has_key('subdir'):
|
||||
|
@ -1169,6 +1170,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
|
|||
init = build['init']
|
||||
init = init.replace('$$SDK$$', sdk_path)
|
||||
init = init.replace('$$NDK$$', ndk_path)
|
||||
init = init.replace('$$MVN$$', mvn3)
|
||||
if verbose: print "Doing init: exec '%s' in '%s'"%(init,root_dir)
|
||||
if subprocess.call(init, cwd=root_dir, shell=True) != 0:
|
||||
raise BuildException("Error running init command")
|
||||
|
@ -1348,6 +1350,7 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j
|
|||
prebuild = prebuild.replace('$$' + name + '$$', libpath)
|
||||
prebuild = prebuild.replace('$$SDK$$', sdk_path)
|
||||
prebuild = prebuild.replace('$$NDK$$', ndk_path)
|
||||
prebuild = prebuild.replace('$$MVN3$$', mvn3)
|
||||
p = subprocess.Popen(prebuild, cwd=root_dir, shell=True,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = p.communicate()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue