cli: Make FLATPAK_ERROR_ABORTED return a failed exit code.

We now return a NULL error meaning nothing is printed as before
but a FALSE result which means the exist code marks the failure.

Closes: #2858
Approved by: alexlarsson
This commit is contained in:
Alexander Larsson
2019-04-25 11:07:20 +02:00
committed by Atomic Bot
parent 7eb6467e4d
commit e3db7a4461
4 changed files with 7 additions and 24 deletions

View File

@@ -169,10 +169,7 @@ install_bundle (FlatpakDir *dir,
if (!flatpak_transaction_run (transaction, cancellable, error))
{
if (g_error_matches (*error, FLATPAK_ERROR, FLATPAK_ERROR_ABORTED))
{
g_clear_error (error);
return TRUE;
}
g_clear_error (error); /* Don't report on stderr */
return FALSE;
}
@@ -246,10 +243,7 @@ install_from (FlatpakDir *dir,
if (!flatpak_transaction_run (transaction, cancellable, error))
{
if (g_error_matches (*error, FLATPAK_ERROR, FLATPAK_ERROR_ABORTED))
{
g_clear_error (error);
return TRUE;
}
g_clear_error (error); /* Don't report on stderr */
return FALSE;
}
@@ -521,10 +515,7 @@ flatpak_builtin_install (int argc, char **argv, GCancellable *cancellable, GErro
if (!flatpak_transaction_run (transaction, cancellable, error))
{
if (g_error_matches (*error, FLATPAK_ERROR, FLATPAK_ERROR_ABORTED))
{
g_clear_error (error);
return TRUE;
}
g_clear_error (error); /* Don't report on stderr */
return FALSE;
}

View File

@@ -114,10 +114,8 @@ flatpak_builtin_remote_delete (int argc, char **argv, GCancellable *cancellable,
if (!flatpak_transaction_run (transaction, cancellable, error))
{
if (g_error_matches (*error, FLATPAK_ERROR, FLATPAK_ERROR_ABORTED))
{
g_clear_error (error);
return TRUE;
}
g_clear_error (error); /* Don't report on stderr */
return FALSE;
}
}

View File

@@ -373,10 +373,7 @@ flatpak_builtin_uninstall (int argc, char **argv, GCancellable *cancellable, GEr
if (!flatpak_transaction_run (transaction, cancellable, error))
{
if (g_error_matches (*error, FLATPAK_ERROR, FLATPAK_ERROR_ABORTED))
{
g_clear_error (error);
return TRUE;
}
g_clear_error (error); /* Don't report on stderr */
return FALSE;
}

View File

@@ -277,10 +277,7 @@ flatpak_builtin_update (int argc,
if (!flatpak_transaction_run (transaction, cancellable, error))
{
if (g_error_matches (*error, FLATPAK_ERROR, FLATPAK_ERROR_ABORTED))
{
g_clear_error (error);
return TRUE;
}
g_clear_error (error); /* Don't report on stderr */
return FALSE;
}