]> git.ipfire.org Git - pakfire.git/commitdiff
dependencies: Log any invalid dependencies
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Dec 2022 11:40:43 +0000 (11:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 2 Dec 2022 11:40:43 +0000 (11:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/dependencies.c

index e59f743d0143fc02f328f5cf069a15d84175c7ea..4fa7b0f65be4b3e5d313c4df10434bf1a4b69eb8 100644 (file)
@@ -288,19 +288,21 @@ static Id pakfire_parse_rich_dep(struct pakfire* pakfire, const char** dep, int
        return pool_rel2id(pool, id, evr, flags, 1);
 }
 
-Id pakfire_str2dep(struct pakfire* pakfire, const char* s) {
+Id pakfire_str2dep(struct pakfire* pakfire, const char* dep) {
        Id id = ID_NULL;
 
        // Invalid input
-       if (!s) {
+       if (!dep) {
                errno = EINVAL;
                return id;
        }
 
        // Ignore empty strings
-       if (!*s)
+       if (!*dep)
                return id;
 
+       const char* s = dep;
+
        // Consume any leading space
        if (isspace(*s))
                s++;
@@ -316,8 +318,10 @@ Id pakfire_str2dep(struct pakfire* pakfire, const char* s) {
                id = pakfire_parse_dep(pakfire, &s);
 
        // Return nothing if we could not parse the entire string
-       if (id && *s)
+       if (id && *s) {
+               DEBUG(pakfire, "Invalid dependency: %s\n", dep);
                id = ID_NULL;
+       }
 
        return id;
 }