PAKFIRE_PKG_REQUIRES, "python-abi = %s", basename + strlen("python"));
}
+static int pakfire_build_find_symlink_destinations(
+ struct pakfire_ctx* ctx, struct pakfire_file* file, struct pakfire_find_deps_ctx* deps) {
+ const char* symlink = NULL;
+ const char* path = NULL;
+ char buffer[PATH_MAX];
+ int r;
+
+ // Fetch the path
+ path = pakfire_file_get_path(file);
+ if (!path)
+ return -EINVAL;
+
+ // Fetch the destination
+ symlink = pakfire_file_get_symlink(file);
+ if (!symlink)
+ return -EINVAL;
+
+ // Resolve the symlink
+ r = pakfire_path_merge(buffer, path, symlink);
+ if (r < 0)
+ return r;
+
+ // Ignore if the destination is also part of this package
+ if (pakfire_filelist_contains(deps->filelist, buffer))
+ return 0;
+
+ // Otherwise add it as dependency
+ return pakfire_package_add_dep(deps->pkg, PAKFIRE_PKG_REQUIRES, "%s", buffer);
+}
+
static int pakfire_build_find_provides(
struct pakfire_ctx* ctx, struct pakfire_file* file, void* data) {
struct pakfire_find_deps_ctx* deps = data;
if (r < 0)
return r;
}
+ break;
+ // Symlinks
+ case S_IFLNK:
+ r = pakfire_build_find_symlink_destinations(ctx, file, deps);
+ if (r < 0)
+ return r;
break;
}
int r;
struct pakfire_find_deps_ctx deps = {
- .build = build,
- .pkg = pkg,
+ .build = build,
+ .pkg = pkg,
+ .filelist = filelist,
};
// Fetch the provides filter