allow metadata to be embedded in source repos via .fdroid.yml

This allows a source repo to include a complete metadata file so that it
can be built directly in place using `fdroid build`.  If that app is then
included in fdroiddata, it will first load the source repo type and URL
from fdroiddata, then read .fdroid.yml if it exists, then include the rest
of the metadata as specified in fdroiddata, so that fdroiddata has
precedence over the metadata in the source code.

This lets `fdroid build` apps without having a whole fdroiddata setup, but
instead just directly in place in the source code.  This also lets devs
optionallu maintain the fdroid metadata as part of their app, rather than
in fdroiddata without loosing any control.  This should make it easier to
spread around the maintenance load.
This commit is contained in:
Hans-Christoph Steiner 2016-11-07 21:47:53 +01:00
parent b4a39ee272
commit a4e4310803
8 changed files with 121 additions and 16 deletions

View file

@ -1100,9 +1100,10 @@ def main():
extlib_dir = os.path.join(build_dir, 'extlib')
# Read all app and srclib metadata
allapps = metadata.read_metadata(xref=not options.onserver)
pkgs = common.read_pkg_args(options.appid, True)
allapps = metadata.read_metadata(not options.onserver, pkgs)
apps = common.read_app_args(options.appid, allapps, True)
for appid, app in list(apps.items()):
if (app.Disabled and not options.force) or not app.RepoType or not app.builds:
del apps[appid]
@ -1141,16 +1142,7 @@ def main():
# the source repo. We can reuse it on subsequent builds, if
# there are any.
if first:
if app.RepoType == 'srclib':
build_dir = os.path.join('build', 'srclib', app.Repo)
else:
build_dir = os.path.join('build', appid)
# Set up vcs interface and make sure we have the latest code...
logging.debug("Getting {0} vcs interface for {1}"
.format(app.RepoType, app.Repo))
vcs = common.getvcs(app.RepoType, app.Repo, build_dir)
vcs, build_dir = common.setup_vcs(app)
first = False
logging.debug("Checking " + build.version)