mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
build: fix --no-refresh
This was broken by the in-source-tree .fdroid.yml file support. Also support this for building on the buildserver.
This commit is contained in:
parent
5cfa4d487f
commit
e775d330c2
@ -962,7 +962,7 @@ def trybuild(app, build, build_dir, output_dir, log_dir, also_check_dir,
|
|||||||
if server:
|
if server:
|
||||||
# When using server mode, still keep a local cache of the repo, by
|
# When using server mode, still keep a local cache of the repo, by
|
||||||
# grabbing the source now.
|
# grabbing the source now.
|
||||||
vcs.gotorevision(build.commit)
|
vcs.gotorevision(build.commit, refresh)
|
||||||
|
|
||||||
build_server(app, build, vcs, build_dir, output_dir, log_dir, force)
|
build_server(app, build, vcs, build_dir, output_dir, log_dir, force)
|
||||||
else:
|
else:
|
||||||
@ -1124,7 +1124,7 @@ def main():
|
|||||||
|
|
||||||
# Read all app and srclib metadata
|
# Read all app and srclib metadata
|
||||||
pkgs = common.read_pkg_args(options.appid, True)
|
pkgs = common.read_pkg_args(options.appid, True)
|
||||||
allapps = metadata.read_metadata(not options.onserver, pkgs, sort_by_time=True)
|
allapps = metadata.read_metadata(not options.onserver, pkgs, options.refresh, sort_by_time=True)
|
||||||
apps = common.read_app_args(options.appid, allapps, True)
|
apps = common.read_app_args(options.appid, allapps, True)
|
||||||
|
|
||||||
for appid, app in list(apps.items()):
|
for appid, app in list(apps.items()):
|
||||||
|
@ -710,7 +710,7 @@ def read_srclibs():
|
|||||||
srclibs[srclibname] = parse_srclib(metadatapath)
|
srclibs[srclibname] = parse_srclib(metadatapath)
|
||||||
|
|
||||||
|
|
||||||
def read_metadata(xref=True, check_vcs=[], sort_by_time=False):
|
def read_metadata(xref=True, check_vcs=[], refresh=True, sort_by_time=False):
|
||||||
"""Return a list of App instances sorted newest first
|
"""Return a list of App instances sorted newest first
|
||||||
|
|
||||||
This reads all of the metadata files in a 'data' repository, then
|
This reads all of the metadata files in a 'data' repository, then
|
||||||
@ -760,7 +760,7 @@ def read_metadata(xref=True, check_vcs=[], sort_by_time=False):
|
|||||||
if packageName in apps:
|
if packageName in apps:
|
||||||
warn_or_exception(_("Found multiple metadata files for {appid}")
|
warn_or_exception(_("Found multiple metadata files for {appid}")
|
||||||
.format(path=packageName))
|
.format(path=packageName))
|
||||||
app = parse_metadata(metadatapath, packageName in check_vcs)
|
app = parse_metadata(metadatapath, packageName in check_vcs, refresh)
|
||||||
check_metadata(app)
|
check_metadata(app)
|
||||||
apps[app.id] = app
|
apps[app.id] = app
|
||||||
|
|
||||||
@ -944,7 +944,7 @@ def _decode_bool(s):
|
|||||||
warn_or_exception(_("Invalid boolean '%s'") % s)
|
warn_or_exception(_("Invalid boolean '%s'") % s)
|
||||||
|
|
||||||
|
|
||||||
def parse_metadata(metadatapath, check_vcs=False):
|
def parse_metadata(metadatapath, check_vcs=False, refresh=True):
|
||||||
'''parse metadata file, optionally checking the git repo for metadata first'''
|
'''parse metadata file, optionally checking the git repo for metadata first'''
|
||||||
|
|
||||||
_ignored, ext = fdroidserver.common.get_extension(metadatapath)
|
_ignored, ext = fdroidserver.common.get_extension(metadatapath)
|
||||||
@ -978,7 +978,7 @@ def parse_metadata(metadatapath, check_vcs=False):
|
|||||||
if not os.path.isfile(metadata_in_repo):
|
if not os.path.isfile(metadata_in_repo):
|
||||||
vcs, build_dir = fdroidserver.common.setup_vcs(app)
|
vcs, build_dir = fdroidserver.common.setup_vcs(app)
|
||||||
if isinstance(vcs, fdroidserver.common.vcs_git):
|
if isinstance(vcs, fdroidserver.common.vcs_git):
|
||||||
vcs.gotorevision('HEAD') # HEAD since we can't know where else to go
|
vcs.gotorevision('HEAD', refresh) # HEAD since we can't know where else to go
|
||||||
if os.path.isfile(metadata_in_repo):
|
if os.path.isfile(metadata_in_repo):
|
||||||
logging.debug('Including metadata from ' + metadata_in_repo)
|
logging.debug('Including metadata from ' + metadata_in_repo)
|
||||||
# do not include fields already provided by main metadata file
|
# do not include fields already provided by main metadata file
|
||||||
|
Loading…
Reference in New Issue
Block a user