From: Michael Tremer Date: Mon, 24 May 2021 12:10:52 +0000 (+0000) Subject: parser: Set name for all packages X-Git-Tag: 0.9.28~1285^2~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18281213a14ecc092155221e71c633acce4af4e7;p=pakfire.git parser: Set name for all packages Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/parser/grammar.y b/src/libpakfire/parser/grammar.y index c6518a74a..83ca76c59 100644 --- a/src/libpakfire/parser/grammar.y +++ b/src/libpakfire/parser/grammar.y @@ -304,9 +304,28 @@ line : T_STRING T_EOL subparser : subparser_name T_EOL block T_END T_EOL { - pakfire_parser_set_namespace($3, $1); - $$ = $3; + + pakfire_parser_set_namespace($$, $1); + + char* key; + char* value; + + int r = pakfire_string_partition($1, ":", &key, &value); + if (r == 0) { + if (strcmp("package", key) == 0) { + char* name = pakfire_parser_expand($$, NULL, value); + if (name) { + pakfire_parser_set($$, NULL, "name", name); + free(name); + } + } + + if (key) + free(key); + if (value) + free(value); + } } | subparser_name T_EOL {