]> git.ipfire.org Git - pakfire.git/commitdiff
Add some more error messages in dist/parser
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Oct 2022 19:13:30 +0000 (19:13 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 26 Oct 2022 19:13:30 +0000 (19:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/dist.c
src/libpakfire/parser.c

index 4bb4729efcd2891f169d41c79a6b724067561920..569526dc388536a4cbbb6f4d9938865ad89d9e3e 100644 (file)
@@ -374,14 +374,18 @@ PAKFIRE_EXPORT int pakfire_dist(struct pakfire* pakfire, const char* path,
        if (r) {
                if (error)
                        pakfire_parser_error_unref(error);
+               else
+                       ERROR(pakfire, "Could not read makefile: %m\n");
 
                return r;
        }
 
        // The architecture is always "src"
        r = pakfire_parser_set(makefile, NULL, "arch", "src", 0);
-       if (r)
+       if (r) {
+               ERROR(pakfire, "Could not set architecture to 'src': %m\n");
                goto ERROR;
+       }
 
        // Get the package object
        r = pakfire_parser_create_package(makefile, &pkg, NULL, NULL, "src");
index e2577bb1d9fb8cf7996b0e241f4fc29130e7880e..44f0555909254fbb93dd12f7ab6699b6c0450d8f 100644 (file)
@@ -915,7 +915,7 @@ int pakfire_parser_create_package(struct pakfire_parser* parser,
        // Create a new package object
        r = pakfire_package_create(pkg, parser->pakfire, repo, name, evr, arch);
        if (r) {
-               ERROR(parser->pakfire, "Could not create package\n");
+               ERROR(parser->pakfire, "Could not create package: %m\n");
                goto CLEANUP;
        }
 
@@ -989,6 +989,9 @@ int pakfire_parser_create_package(struct pakfire_parser* parser,
        r = 0;
 
 CLEANUP:
+       if (r)
+               ERROR(parser->pakfire, "Could not create package: %m\n");
+
        if (name)
                free(name);
        if (evr)