#define PAKFIRE_REPO_SYSTEM "@system"
int pakfire_repo_name_equals(struct pakfire_repo* repo, const char* name);
+int pakfire_repo_is_internal(struct pakfire_repo* repo);
+int pakfire_repo_is_local(struct pakfire_repo* repo);
int pakfire_repo_import(struct pakfire* pakfire, struct pakfire_config* config);
const char* pakfire_repo_get_path(struct pakfire_repo* repo);
struct pakfire_mirrorlist* mirrorlist;
};
-static int pakfire_repo_is_internal(struct pakfire_repo* repo) {
+int pakfire_repo_is_internal(struct pakfire_repo* repo) {
const char* name = pakfire_repo_get_name(repo);
if (!name)
return 0;
return (*name == '@');
}
+int pakfire_repo_is_local(struct pakfire_repo* repo) {
+ if (!repo->appdata->baseurl)
+ return 0;
+
+ return pakfire_string_startswith(repo->appdata->baseurl, "file://");
+}
+
int pakfire_repo_name_equals(struct pakfire_repo* repo, const char* name) {
const char* n = pakfire_repo_get_name(repo);
if (!n)
return 0;
}
-static int pakfire_repo_is_local(struct pakfire_repo* repo) {
- if (!repo->appdata->baseurl)
- return 0;
-
- return pakfire_string_startswith(repo->appdata->baseurl, "file://");
-}
-
const char* pakfire_repo_get_path(struct pakfire_repo* repo) {
if (!pakfire_repo_is_local(repo))
return NULL;
int r;
// Do nothing for the installed repository
- if (pakfire_repo_is_installed_repo(repo) == 0)
+ if (pakfire_repo_is_installed_repo(repo))
return 0;
struct pakfire_config* config = NULL;
PAKFIRE_EXPORT int pakfire_repo_is_installed_repo(struct pakfire_repo* repo) {
struct pakfire_repo* installed_repo = pakfire_get_installed_repo(repo->pakfire);
if (!installed_repo)
- return 1;
+ return 0;
int r = pakfire_repo_identical(repo, installed_repo);
pakfire_repo_unref(installed_repo);
- return r;
+ return (r == 0);
}
PAKFIRE_EXPORT int pakfire_repo_read_solv(struct pakfire_repo* repo, FILE *f, int flags) {