summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-07-19 23:44:57 +0000
committerbapt <bapt@FreeBSD.org>2014-07-19 23:44:57 +0000
commit6f718e3669e9ecc1b1ca407a465d6ee20571a2b8 (patch)
treeba71cc26671c93ed9809f7cadb07734c0bddb4c7 /usr.sbin/pkg
parent6095428430d025abcf6983536297f168bf62b45b (diff)
downloadFreeBSD-src-6f718e3669e9ecc1b1ca407a465d6ee20571a2b8.zip
FreeBSD-src-6f718e3669e9ecc1b1ca407a465d6ee20571a2b8.tar.gz
MFC: r263648, r264789, r266636
This brings: - schema validation - xpath-like interface for ucl objects Adapt pkg(7) to the new libucl API
Diffstat (limited to 'usr.sbin/pkg')
-rw-r--r--usr.sbin/pkg/config.c8
-rw-r--r--usr.sbin/pkg/pkg.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pkg/config.c b/usr.sbin/pkg/config.c
index e46da4a..fded95e 100644
--- a/usr.sbin/pkg/config.c
+++ b/usr.sbin/pkg/config.c
@@ -517,10 +517,10 @@ boolstr_to_bool(const char *str)
}
static void
-config_parse(ucl_object_t *obj, pkg_conf_file_t conftype)
+config_parse(const ucl_object_t *obj, pkg_conf_file_t conftype)
{
struct sbuf *buf = sbuf_new_auto();
- ucl_object_t *cur, *seq;
+ const ucl_object_t *cur, *seq;
ucl_object_iter_t it = NULL, itseq = NULL;
struct config_entry *temp_config;
struct config_value *cv;
@@ -638,7 +638,7 @@ static void
parse_repo_file(ucl_object_t *obj)
{
ucl_object_iter_t it = NULL;
- ucl_object_t *cur;
+ const ucl_object_t *cur;
const char *key;
while ((cur = ucl_iterate_object(obj, &it, true))) {
@@ -683,7 +683,7 @@ read_conf_file(const char *confpath, pkg_conf_file_t conftype)
parse_repo_file(obj);
}
- ucl_object_free(obj);
+ ucl_object_unref(obj);
ucl_parser_free(p);
return (0);
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 6208121..fa3d91e 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -273,7 +273,7 @@ cleanup:
static struct fingerprint *
parse_fingerprint(ucl_object_t *obj)
{
- ucl_object_t *cur;
+ const ucl_object_t *cur;
ucl_object_iter_t it = NULL;
const char *function, *fp, *key;
struct fingerprint *f;
@@ -353,7 +353,7 @@ load_fingerprint(const char *dir, const char *filename)
if (f != NULL)
f->name = strdup(filename);
- ucl_object_free(obj);
+ ucl_object_unref(obj);
ucl_parser_free(p);
return (f);
OpenPOWER on IntegriCloud