Skip to content

Commit

Permalink
appmodel: respect {in,ex}clude-transforms in app-transform()
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Szakacs <[email protected]>
  • Loading branch information
alltilla committed Nov 13, 2024
1 parent 802e886 commit 56f832c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/appmodel/app-transform-generator.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ _generate_steps(AppTransformGenerator *self, GList *steps)
}
}

static gboolean
_is_transform_included(AppTransformGenerator *self, const gchar *name)
{
if (!self->included_transforms)
return TRUE;
return cfg_is_literal_in_list_of_literals(self->included_transforms, name);
}

static gboolean
_is_transform_excluded(AppTransformGenerator *self, const gchar *name)
{
if (!self->excluded_transforms)
return FALSE;
return cfg_is_literal_in_list_of_literals(self->excluded_transforms, name);
}

static void
_generate_app_transform(Transformation *transformation, gpointer user_data)
{
Expand All @@ -131,6 +147,9 @@ _generate_app_transform(Transformation *transformation, gpointer user_data)
{
Transform *transform = l->data;

if (!_is_transform_included(self, transform->name) || _is_transform_excluded(self, transform->name))
continue;

_generate_steps(self, transform->steps);
}
g_string_append(self->block, " };\n");
Expand Down

0 comments on commit 56f832c

Please sign in to comment.