Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add repos priority configuration.
Vsevolod Stakhov committed 11 years ago
commit f0b581b1f151f84a4439eab5d75ecd7ffd1fde0d
parent d9bdc32
2 files changed +10 -0
modified libpkg/pkg_config.c
@@ -532,6 +532,14 @@ add_repo(const ucl_object_t *obj, struct pkg_repo *r, const char *rname, pkg_ini
			use_ipvx = ucl_object_toint(cur);
			if (use_ipvx != 4 && use_ipvx != 6)
				use_ipvx = 0;
+
		} else if (strcasecmp(key, "priority") == 0) {
+
			if (cur->type != UCL_INT) {
+
				pkg_emit_error("Expecting a integer for the "
+
					"'%s' key of the '%s' repo",
+
					key, rname);
+
				return;
+
			}
+
			r->priority = ucl_object_toint(cur);
		}
	}

modified libpkg/private/pkg.h
@@ -385,6 +385,8 @@ struct pkg_repo {
	bool enable;
	UT_hash_handle hh;

+
	unsigned int priority;
+

	pkg_repo_flags flags;

	/* Opaque repository data */