GNOME Bugzilla – Bug 772898
runtime: Add a postinstall_async vfunc and call it from the build system
Last modified: 2016-10-14 00:05:21 UTC
This function will be useful when certain tasks only need to happen for installs and not builds.
Created attachment 337672 [details] [review] runtime: Add a postinstall_async vfunc to IdeRuntime Runtimes may need to do something when an install finishes (for example the flatpak runtime will run "flatpak install..."), so this commit adds a virtual function for that.
Created attachment 337673 [details] [review] autotools: Call the runtime's postinstall hook when necessary 1. Add an install property to IdeAutotoolsBuildTask. 2. Properly initialize that property in IdeAutotoolsBuilder. 3. Call either ide_runtime_postbuild_async or ide_runtime_postinstall_async from the build task depending on the situation.
Review of attachment 337673 [details] [review]: Just a quick thing, then go ahead and push. ::: plugins/autotools/ide-autotools-build-task.c @@ +158,3 @@ +static void +ide_autotools_build_task_set_install (IdeAutotoolsBuildTask *self, + gboolean install) fix whitespace @@ -744,2 +781,4 @@ - if (!ide_runtime_postbuild_finish (runtime, result, &error)) + self = g_task_get_source_object (task); + g_assert (IDE_IS_AUTOTOOLS_BUILD_TASK (self)); + I think this can be simplified a bit like: gboolean ret; if (self->install) ret = ide_runtime_postintsall_finish (...) else ret = ide_runtime_postbuild_finish (...); if (!ret) g_task_return_error (task, g_steal_pointer (&error)); else g_task_return_boolean (task, TRUE);
Pushed as 703f8ff89135c91952947d652a46340469cd5f67 and 60fa28d9c2d74e41c9c67b4f21fc9f6b72fa2914