builder: Don't download modules that won't be built

Currently flatpak-builder downloads the sources for all modules, even if
the --stop-at option prevents them from being built. This commit changes
the behavior so that we don't bother to download the ignored modules.
This commit is contained in:
Matthew Leeds
2016-11-02 00:25:47 -05:00
committed by Alexander Larsson
parent bd3eae146a
commit 7b8becd1b2
2 changed files with 13 additions and 5 deletions

View File

@@ -1324,12 +1324,20 @@ builder_manifest_download (BuilderManifest *self,
BuilderContext *context,
GError **error)
{
const char *stop_at = builder_context_get_stop_at (context);
GList *l;
g_print ("Downloading sources\n");
for (l = self->expanded_modules; l != NULL; l = l->next)
{
BuilderModule *m = l->data;
const char *name = builder_module_get_name (m);
if (stop_at != NULL && strcmp (name, stop_at) == 0)
{
g_print ("Stopping at module %s\n", stop_at);
return TRUE;
}
if (!builder_module_download_sources (m, update_vcs, context, error))
return FALSE;

View File

@@ -714,11 +714,11 @@
<term><option>--stop-at=MODULENAME</option></term>
<listitem><para>
Stop building at the specified module, ignoring all the following ones.
This is useful for debugging and development. For instance, you can
build all the dependencies, but stop at the main application so that
you can then do a build from a pre-existing checkout.
Implies --build-only.
Stop at the specified module, ignoring it and all the following ones
in both the "download" and "build" phases. This is useful for debugging
and development. For instance, you can build all the dependencies, but
stop at the main application so that you can then do a build from a
pre-existing checkout. Implies --build-only.
</para></listitem>
</varlistentry>