From owner-svn-ports-head@FreeBSD.ORG Sun Jul 27 15:33:14 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24E3C70; Sun, 27 Jul 2014 15:33:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0666F262F; Sun, 27 Jul 2014 15:33:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6RFXDOH068157; Sun, 27 Jul 2014 15:33:13 GMT (envelope-from az@svn.freebsd.org) Received: (from az@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6RFXDUK068155; Sun, 27 Jul 2014 15:33:13 GMT (envelope-from az@svn.freebsd.org) Message-Id: <201407271533.s6RFXDUK068155@svn.freebsd.org> From: Andrej Zverev Date: Sun, 27 Jul 2014 15:33:13 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r363076 - in head/ports-mgmt/pkg: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Jul 2014 15:33:14 -0000 Author: az Date: Sun Jul 27 15:33:13 2014 New Revision: 363076 URL: http://svnweb.freebsd.org/changeset/ports/363076 QAT: https://qat.redports.org/buildarchive/r363076/ Log: Fix reading pkg.conf (this will prevent pkg from segfault) Approved by: bapt@ (portmrg@) Added: head/ports-mgmt/pkg/files/patch-3f56689 (contents, props changed) Modified: head/ports-mgmt/pkg/Makefile Modified: head/ports-mgmt/pkg/Makefile ============================================================================== --- head/ports-mgmt/pkg/Makefile Sun Jul 27 15:27:04 2014 (r363075) +++ head/ports-mgmt/pkg/Makefile Sun Jul 27 15:33:13 2014 (r363076) @@ -1,6 +1,7 @@ # $FreeBSD$ PORTNAME= pkg +PORTREVISION= 1 DISTVERSION= 1.3.1 CATEGORIES= ports-mgmt MASTER_SITES= \ Added: head/ports-mgmt/pkg/files/patch-3f56689 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg/files/patch-3f56689 Sun Jul 27 15:33:13 2014 (r363076) @@ -0,0 +1,68 @@ +From 3f56689bff57e3db52ec8fd5c5f730a2aec64d3d Mon Sep 17 00:00:00 2001 +From: Baptiste Daroussin +Date: Sun, 27 Jul 2014 16:12:07 +0200 +Subject: [PATCH] Fix reading pkg.conf + +--- + libpkg/pkg_config.c | 38 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 37 insertions(+), 1 deletion(-) + +diff --git a/libpkg/pkg_config.c b/libpkg/pkg_config.c +index 3ba3d0e..692c4dc 100644 +--- libpkg/pkg_config.c ++++ libpkg/pkg_config.c +@@ -673,6 +673,42 @@ pkg_compiled_for_same_os_major(void) + #endif + } + ++static ucl_object_t * ++ucl_dup(const ucl_object_t *from) ++{ ++ ucl_object_t *ret; ++ const ucl_object_t *cur; ++ ucl_object_iter_t it; ++ const char *key; ++ ++ switch (from->type) { ++ case UCL_BOOLEAN: ++ ret = ucl_object_frombool(ucl_object_toboolean(from)); ++ break; ++ case UCL_INT: ++ ret = ucl_object_fromint(ucl_object_toint(from)); ++ break; ++ case UCL_STRING: ++ ret = ucl_object_fromstring(ucl_object_tostring(from)); ++ break; ++ case UCL_ARRAY: ++ ret = ucl_object_typed_new(from->type); ++ it = NULL; ++ while ((cur = ucl_iterate_object(from, &it, true))) ++ ucl_array_append(ret, ucl_object_ref(cur)); ++ break; ++ case UCL_OBJECT: ++ ret = ucl_object_typed_new(from->type); ++ it = NULL; ++ while ((cur = ucl_iterate_object(from, &it, true))) { ++ key = ucl_object_key(cur); ++ ucl_object_insert_key(ret, ucl_object_ref(cur), key, strlen(key), true); ++ } ++ break; ++ } ++ ++ return (ret); ++} + + int + pkg_init(const char *path, const char *reposdir) +@@ -802,7 +838,7 @@ pkg_init(const char *path, const char *reposdir) + + if (ncfg == NULL) + ncfg = ucl_object_typed_new(UCL_OBJECT); +- ucl_object_insert_key(ncfg, ucl_object_copy(cur), sbuf_data(ukey), sbuf_len(ukey), true); ++ ucl_object_insert_key(ncfg, ucl_dup(cur), sbuf_data(ukey), sbuf_len(ukey), true); + } + + if (ncfg != NULL) { +-- +1.9.3 +