mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 15:30:28 +03:00
Deprecate "Update Project" in favour of update=auto
This commit is contained in:
parent
ff8fa2305e
commit
2f1094b5cc
1 changed files with 3 additions and 18 deletions
|
|
@ -756,7 +756,7 @@ class VCSException(Exception):
|
||||||
# Returns the path to it. Normally this is the path to be used when referencing
|
# Returns the path to it. Normally this is the path to be used when referencing
|
||||||
# it, which may be a subdirectory of the actual project. If you want the base
|
# it, which may be a subdirectory of the actual project. If you want the base
|
||||||
# directory of the project, pass 'basepath=True'.
|
# directory of the project, pass 'basepath=True'.
|
||||||
def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None, target=None,
|
def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None,
|
||||||
basepath=False, raw=False, prepare=True, preponly=False, autoupdate=True):
|
basepath=False, raw=False, prepare=True, preponly=False, autoupdate=True):
|
||||||
|
|
||||||
number = None
|
number = None
|
||||||
|
|
@ -826,21 +826,7 @@ def getsrclib(spec, srclib_dir, srclibpaths=[], subdir=None, target=None,
|
||||||
raise BuildException("Error running prepare command for srclib %s"
|
raise BuildException("Error running prepare command for srclib %s"
|
||||||
% name, p.stdout)
|
% name, p.stdout)
|
||||||
|
|
||||||
if srclib["Update Project"] == "Yes" and not (autoupdate and number):
|
remove_signing_keys(libdir)
|
||||||
logging.info("Updating srclib %s at path %s" % (name, libdir))
|
|
||||||
cmd = [os.path.join(config['sdk_path'], 'tools', 'android'),
|
|
||||||
'update', 'project', '-p', libdir]
|
|
||||||
if target:
|
|
||||||
cmd += ['-t', target]
|
|
||||||
p = FDroidPopen(cmd)
|
|
||||||
# Check to see whether an error was returned without a proper exit
|
|
||||||
# code (this is the case for the 'no target set or target invalid'
|
|
||||||
# error)
|
|
||||||
if p.returncode != 0 or p.stdout.startswith("Error: "):
|
|
||||||
raise BuildException("Failed to update srclib project {0}"
|
|
||||||
.format(name), p.stdout)
|
|
||||||
|
|
||||||
remove_signing_keys(libdir)
|
|
||||||
|
|
||||||
if basepath:
|
if basepath:
|
||||||
libdir = sdir
|
libdir = sdir
|
||||||
|
|
@ -908,11 +894,10 @@ def prepare_source(vcs, app, build, build_dir, srclib_dir, extlib_dir, onserver=
|
||||||
srclibpaths = []
|
srclibpaths = []
|
||||||
updatemode = build.get('update', 'auto')
|
updatemode = build.get('update', 'auto')
|
||||||
if 'srclibs' in build:
|
if 'srclibs' in build:
|
||||||
target=build['target'] if 'target' in build else None
|
|
||||||
logging.info("Collecting source libraries")
|
logging.info("Collecting source libraries")
|
||||||
for lib in build['srclibs'].split(';'):
|
for lib in build['srclibs'].split(';'):
|
||||||
srclibpaths.append(getsrclib(lib, srclib_dir, srclibpaths,
|
srclibpaths.append(getsrclib(lib, srclib_dir, srclibpaths,
|
||||||
target=target, preponly=onserver, autoupdate=(updatemode=='auto')))
|
preponly=onserver, autoupdate=(updatemode=='auto')))
|
||||||
|
|
||||||
for name, number, libpath in srclibpaths:
|
for name, number, libpath in srclibpaths:
|
||||||
place_srclib(root_dir, int(number) if number else None, libpath)
|
place_srclib(root_dir, int(number) if number else None, libpath)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue