From 7b8becd1b2d3fc63ff7445b9127f68ed487a216e Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Wed, 2 Nov 2016 00:25:47 -0500 Subject: [PATCH] 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. --- builder/builder-manifest.c | 8 ++++++++ doc/flatpak-builder.xml | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/builder/builder-manifest.c b/builder/builder-manifest.c index 859209cc..d81a702a 100644 --- a/builder/builder-manifest.c +++ b/builder/builder-manifest.c @@ -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; diff --git a/doc/flatpak-builder.xml b/doc/flatpak-builder.xml index b62d5c11..9c4ad5aa 100644 --- a/doc/flatpak-builder.xml +++ b/doc/flatpak-builder.xml @@ -714,11 +714,11 @@ - 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.