--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)
{
g_assert (export_repo != NULL);
if (!do_install (build_context, flatpak_file_get_path_cached (export_repo),
builder_manifest_get_id (manifest),
builder_manifest_get_branch (manifest),
&error))
/* We may end here with a NULL export repo if --require-changes was
passed and there were no changes, do nothing in that case */
if (export_repo == NULL)
g_printerr ("NOTE: No export due to --require-changes, ignoring --install\n");
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);
return 1;