Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Option are always strings of a boolean is found then enforce "on"/"off"
Baptiste Daroussin committed 11 years ago
commit ae26fa66e2ee1793c07c4aaa5ee24c191117901f
parent 9dd3fd6
1 file changed +5 -2
modified libpkg/pkg_manifest.c
@@ -457,8 +457,11 @@ pkg_obj(struct pkg *pkg, const ucl_object_t *obj, int attr)
			if (cur->type != UCL_STRING && cur->type != UCL_BOOLEAN)
				pkg_emit_error("Skipping malformed option %s",
				    key);
-
			else
-
				pkg_addoption(pkg, key, ucl_object_tostring_forced(cur));
+
			else if (cur->type == UCL_STRING) {
+
				pkg_addoption(pkg, key, ucl_object_tostring(cur));
+
			} else {
+
				pkg_addoption(pkg, key, ucl_object_toboolean(cur) ? "on" : "off");
+
			}
			break;
		case PKG_OPTION_DEFAULTS:
			if (cur->type != UCL_STRING)