common: Fix misordering of branch and arch arguments

flatpak_dir_collect_deployed_refs() has the order of its "branch" and "arch"
arguments wrong, as does its only caller flatpak_list_deployed_refs().
When flatpak_list_deployed_refs() is called by add_extension() the arch
is put in the branch argument and vice versa. But then in the
implementation the arch is used as if it's the branch and vice versa, so
there's no functional bug here. Fix the order for readability.

Similarly, flatpak_list_unmaintained_refs() has the order wrong, but the
confusion is only within that function, since the order is correct in
its caller add_extension() and in the function it uses,
flatpak_dir_collect_unmaintained_refs(). So there's no functional bug
there either, but fix the order.

Closes: #3067
Approved by: alexlarsson
This commit is contained in:
Matthew Leeds
2019-08-22 19:08:26 -07:00
committed by Atomic Bot
parent 20c9d8477d
commit 3706695fb3
4 changed files with 11 additions and 11 deletions

View File

@@ -747,8 +747,8 @@ gboolean flatpak_dir_cleanup_undeployed_refs (FlatpakDir *self,
gboolean flatpak_dir_collect_deployed_refs (FlatpakDir *self,
const char *type,
const char *name_prefix,
const char *branch,
const char *arch,
const char *branch,
GHashTable *hash,
GCancellable *cancellable,
GError **error);

View File

@@ -9534,8 +9534,8 @@ gboolean
flatpak_dir_collect_deployed_refs (FlatpakDir *self,
const char *type,
const char *name_prefix,
const char *branch,
const char *arch,
const char *branch,
GHashTable *hash,
GCancellable *cancellable,
GError **error)
@@ -9565,8 +9565,8 @@ flatpak_dir_collect_deployed_refs (FlatpakDir *self,
name[0] != '.' && (name_prefix == NULL || g_str_has_prefix (name, name_prefix)))
{
g_autoptr(GFile) child1 = g_file_get_child (dir, name);
g_autoptr(GFile) child2 = g_file_get_child (child1, branch);
g_autoptr(GFile) child3 = g_file_get_child (child2, arch);
g_autoptr(GFile) child2 = g_file_get_child (child1, arch);
g_autoptr(GFile) child3 = g_file_get_child (child2, branch);
g_autoptr(GFile) active = g_file_get_child (child3, "active");
if (g_file_query_exists (active, cancellable))

View File

@@ -256,8 +256,8 @@ FlatpakDeploy * flatpak_find_deploy_for_ref (const char *ref,
GError **error);
char ** flatpak_list_deployed_refs (const char *type,
const char *name_prefix,
const char *branch,
const char *arch,
const char *branch,
GCancellable *cancellable,
GError **error);
char ** flatpak_list_unmaintained_refs (const char *name_prefix,

View File

@@ -1576,8 +1576,8 @@ flatpak_build_app_ref (const char *app,
char **
flatpak_list_deployed_refs (const char *type,
const char *name_prefix,
const char *branch,
const char *arch,
const char *branch,
GCancellable *cancellable,
GError **error)
{
@@ -1598,7 +1598,7 @@ flatpak_list_deployed_refs (const char *type,
goto out;
if (!flatpak_dir_collect_deployed_refs (user_dir, type, name_prefix,
branch, arch, hash, cancellable,
arch, branch, hash, cancellable,
error))
goto out;
@@ -1606,7 +1606,7 @@ flatpak_list_deployed_refs (const char *type,
{
FlatpakDir *system_dir = g_ptr_array_index (system_dirs, i);
if (!flatpak_dir_collect_deployed_refs (system_dir, type, name_prefix,
branch, arch, hash, cancellable,
arch, branch, hash, cancellable,
error))
goto out;
}
@@ -1628,8 +1628,8 @@ out:
char **
flatpak_list_unmaintained_refs (const char *name_prefix,
const char *branch,
const char *arch,
const char *branch,
GCancellable *cancellable,
GError **error)
{
@@ -1647,7 +1647,7 @@ flatpak_list_unmaintained_refs (const char *name_prefix,
user_dir = flatpak_dir_get_user ();
if (!flatpak_dir_collect_unmaintained_refs (user_dir, name_prefix,
branch, arch, hash, cancellable,
arch, branch, hash, cancellable,
error))
return NULL;
@@ -1660,7 +1660,7 @@ flatpak_list_unmaintained_refs (const char *name_prefix,
FlatpakDir *system_dir = g_ptr_array_index (system_dirs, i);
if (!flatpak_dir_collect_unmaintained_refs (system_dir, name_prefix,
branch, arch, hash, cancellable,
arch, branch, hash, cancellable,
error))
return NULL;
}