]> git.ipfire.org Git - pakfire.git/commitdiff
parser: Set package name when using shortcut declaration
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 May 2021 15:09:24 +0000 (15:09 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 23 May 2021 15:09:24 +0000 (15:09 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser/grammar.y

index cc5d5915d202dc52fd328d34fac8dbe621725711..c6518a74a3a235cff328231fcb9f2d5cd0377146 100644 (file)
@@ -322,7 +322,17 @@ subparser                                  : subparser_name T_EOL block T_END T_EOL
                                                                if (r)
                                                                        ABORT;
 
-                                                               pakfire_parser_set($$, NULL, key, value);
+                                                               // Handle packages
+                                                               if (strcmp("package", key) == 0) {
+                                                                       pakfire_parser_set_namespace($$, $1);
+
+                                                                       // Set the name (because we cannot have empty parsers)
+                                                                       pakfire_parser_set($$, NULL, "name", value);
+
+                                                               // Handle all other cases
+                                                               } else {
+                                                                       pakfire_parser_set($$, NULL, key, value);
+                                                               }
 
                                                                if (key)
                                                                        free(key);