return pakfire_string_startswith(repo->appdata->baseurl, "file://");
}
+/*
+ LIBSOLV knows a subpriority which is a good way to indicate that
+ packages from a local repository should be preferred without
+ preferring an older version of a package over a new one.
+
+ We set this automatically to reduce bandwidth usage.
+ */
+static void pakfire_repo_update_subpriority(struct pakfire_repo* repo) {
+ // Prefer local repositories
+ if (pakfire_repo_is_local(repo))
+ repo->repo->subpriority = 1;
+
+ // Otherwise reset
+ else
+ repo->repo->subpriority = 0;
+}
+
int pakfire_repo_name_equals(struct pakfire_repo* repo, const char* name) {
const char* n = pakfire_repo_get_name(repo);
if (!n)
goto ERROR;
}
+ // Update the subpriority
+ pakfire_repo_update_subpriority(rep);
+
// Setup/clear repository data
r = pakfire_repo_clear(rep);
if (r)
if (!repo->appdata->baseurl)
return 1;
+ // Update sub-priority
+ pakfire_repo_update_subpriority(repo);
+
return 0;
}