--install: Warn if --require-changes and --install interact badly

If there were no change we didn't export and there might be nothing
to install, so print a notice that we're ignoring the install.

Closes: #85
Approved by: alexlarsson
tingping/wmclass
Alexander Larsson 2017-12-15 12:19:36 +01:00 committed by Atomic Bot
parent be191a57f1
commit 07240bf3a7
1 changed files with 8 additions and 5 deletions

View File

@ -1030,11 +1030,14 @@ main (int argc,
if (opt_install) if (opt_install)
{ {
g_assert (export_repo != NULL); /* We may end here with a NULL export repo if --require-changes was
if (!do_install (build_context, flatpak_file_get_path_cached (export_repo), passed and there were no changes, do nothing in that case */
builder_manifest_get_id (manifest), if (export_repo == NULL)
builder_manifest_get_branch (manifest), g_printerr ("NOTE: No export due to --require-changes, ignoring --install\n");
&error)) else if (!do_install (build_context, flatpak_file_get_path_cached (export_repo),
builder_manifest_get_id (manifest),
builder_manifest_get_branch (manifest),
&error))
{ {
g_printerr ("Install failed: %s\n", error->message); g_printerr ("Install failed: %s\n", error->message);
return 1; return 1;