]> git.ipfire.org Git - pakfire.git/commitdiff
repo: Drop automatic setting of priority
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Apr 2021 09:38:52 +0000 (09:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 20 Apr 2021 09:38:52 +0000 (09:38 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/repo.c

index 13bf96e7449a59a45c4f1fd28dec362a7945d4ba..1ac629a39f167ca8fc49690775c79922fd2ed9a7 100644 (file)
@@ -522,36 +522,8 @@ PAKFIRE_EXPORT int pakfire_repo_count(PakfireRepo repo) {
        return cnt;
 }
 
-// Returns a default priority based on the repository configuration
-static int pakfire_repo_auto_priority(PakfireRepo repo) {
-       // The @system repository has a priority of zero
-       if (pakfire_repo_is_installed_repo(repo) == 0)
-               return 0;
-
-       if (repo->appdata->baseurl) {
-               // HTTPS
-               if (pakfire_string_startswith(repo->appdata->baseurl, "https://"))
-                       return 75;
-
-               // HTTP
-               if (pakfire_string_startswith(repo->appdata->baseurl, "http://"))
-                       return 75;
-
-               // Local path
-               if (pakfire_string_startswith(repo->appdata->baseurl, "dir://"))
-                       return 50;
-       }
-
-       // Default to 100
-       return 100;
-}
-
 PAKFIRE_EXPORT void pakfire_repo_internalize(PakfireRepo repo) {
        repo_internalize(repo->repo);
-
-       // Set the correct priority in libsolv
-       if (repo->repo->priority == 0)
-               repo->repo->priority = pakfire_repo_auto_priority(repo);
 }
 
 PAKFIRE_EXPORT const char* pakfire_repo_get_name(PakfireRepo repo) {
@@ -585,10 +557,7 @@ PAKFIRE_EXPORT void pakfire_repo_set_enabled(PakfireRepo repo, int enabled) {
 }
 
 PAKFIRE_EXPORT int pakfire_repo_get_priority(PakfireRepo repo) {
-       if (repo->repo->priority > 0)
-               return repo->repo->priority;
-
-       return pakfire_repo_auto_priority(repo);
+       return repo->repo->priority;
 }
 
 PAKFIRE_EXPORT void pakfire_repo_set_priority(PakfireRepo repo, int priority) {