// If this is a file, we check if it is on the filelist
if (pakfire_filelist_contains(p->filelist, dep))
goto SKIP;
-
- // Otherwise check if this dependency is provided by this package
- else if (pakfire_package_matches_dep(p->pkg, PAKFIRE_PKG_PROVIDES, dep))
- goto SKIP;
}
// Add dependency
return 0;
}
+ // Skip any dependencies that are provided by this package
+ if (pakfire_package_matches_dep(pkg, PAKFIRE_PKG_PROVIDES, buffer)) {
+ DEBUG(pkg->ctx, "Ignoring '%s' because it is provided by the package itself\n", buffer);
+ return 0;
+ }
+
+ break;
+
default:
break;
}
return 0;
}
-int pakfire_package_matches_dep(struct pakfire_package* pkg,
- const enum pakfire_package_key key, const char* dep) {
+static int pakfire_package_matches_depid(struct pakfire_package* pkg,
+ const enum pakfire_package_key key, const Id dep) {
int r;
Id id = ID_NULL;
if (r)
return r;
- // Get the dependency
- Id depid = pakfire_str2dep(pkg->pakfire, dep);
- if (!depid)
- return -1;
-
// Fetch the solvable
Solvable* s = get_solvable(pkg);
// Check whether this solvable matches the requested dependency
- return solvable_matchesdep(s, id, depid, marker);
+ return solvable_matchesdep(s, id, dep, marker);
+}
+
+int pakfire_package_matches_dep(struct pakfire_package* pkg,
+ const enum pakfire_package_key key, const char* dep) {
+ // Get the dependency
+ Id id = pakfire_str2dep(pkg->pakfire, dep);
+ if (!id)
+ return -EINVAL;
+
+ return pakfire_package_matches_depid(pkg, key, id);
}
struct pakfire_repo* pakfire_package_get_repo(struct pakfire_package* pkg) {