Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
}
const char* pakfire_repo_get_path(struct pakfire_repo* repo) {
+ const char* baseurl = NULL;
+
if (!pakfire_repo_is_local(repo))
return NULL;
- return repo->appdata->baseurl + strlen("file://");
+ // Get the base URL
+ baseurl = pakfire_repo_get_expanded_baseurl(repo);
+ if (!baseurl)
+ return NULL;
+
+ // The URL must start with file://
+ if (!pakfire_string_startswith(baseurl, "file://")) {
+ errno = -EINVAL;
+ return NULL;
+ }
+
+ return baseurl + strlen("file://");
}
PAKFIRE_EXPORT struct pakfire_key* pakfire_repo_get_key(struct pakfire_repo* repo) {