2011-02-05 16:36:03 +05:30
|
|
|
/*-
|
2012-01-19 16:56:40 +05:30
|
|
|
* Copyright (c) 2008-2012 Juan Romero Pardines.
|
2011-02-05 16:36:03 +05:30
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "xbps_api_impl.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file lib/plist_find.c
|
|
|
|
* @brief PropertyList generic routines
|
|
|
|
* @defgroup plist PropertyList generic functions
|
|
|
|
*
|
|
|
|
* These functions manipulate plist files and objects shared by almost
|
|
|
|
* all library functions.
|
|
|
|
*/
|
|
|
|
static prop_dictionary_t
|
2011-07-15 21:52:58 +05:30
|
|
|
find_pkg_in_array(prop_array_t array,
|
|
|
|
const char *str,
|
|
|
|
bool bypattern,
|
2012-05-31 19:59:56 +05:30
|
|
|
bool virtual,
|
|
|
|
const char *targetarch)
|
2011-02-05 16:36:03 +05:30
|
|
|
{
|
|
|
|
prop_object_iterator_t iter;
|
|
|
|
prop_object_t obj = NULL;
|
2012-05-31 19:59:56 +05:30
|
|
|
const char *pkgver, *dpkgn, *arch;
|
|
|
|
bool chkarch;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
2011-10-19 20:23:38 +05:30
|
|
|
assert(prop_object_type(array) == PROP_TYPE_ARRAY);
|
2011-02-05 16:36:03 +05:30
|
|
|
assert(str != NULL);
|
|
|
|
|
|
|
|
iter = prop_array_iterator(array);
|
|
|
|
if (iter == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
while ((obj = prop_object_iterator_next(iter))) {
|
2012-05-31 19:59:56 +05:30
|
|
|
chkarch = prop_dictionary_get_cstring_nocopy(obj,
|
|
|
|
"architecture", &arch);
|
2012-06-05 02:52:33 +05:30
|
|
|
if (chkarch && !xbps_pkg_arch_match(arch, targetarch))
|
|
|
|
continue;
|
|
|
|
|
2012-04-12 15:27:21 +05:30
|
|
|
if (virtual) {
|
|
|
|
/*
|
|
|
|
* Check if package pattern matches
|
|
|
|
* any virtual package version in dictionary.
|
|
|
|
*/
|
|
|
|
if (xbps_match_virtual_pkg_in_dict(obj, str, bypattern))
|
|
|
|
break;
|
|
|
|
} else if (bypattern) {
|
2011-02-05 16:36:03 +05:30
|
|
|
/*
|
|
|
|
* Check if package pattern matches the
|
|
|
|
* pkgver string object in dictionary.
|
|
|
|
*/
|
|
|
|
if (!prop_dictionary_get_cstring_nocopy(obj,
|
|
|
|
"pkgver", &pkgver))
|
|
|
|
continue;
|
2011-06-04 17:07:53 +05:30
|
|
|
if (xbps_pkgpattern_match(pkgver, str))
|
2011-02-05 16:36:03 +05:30
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
if (!prop_dictionary_get_cstring_nocopy(obj,
|
|
|
|
"pkgname", &dpkgn))
|
|
|
|
continue;
|
|
|
|
if (strcmp(dpkgn, str) == 0)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
prop_object_iterator_release(iter);
|
|
|
|
if (obj == NULL) {
|
|
|
|
errno = ENOENT;
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-07-15 21:52:58 +05:30
|
|
|
|
2011-02-05 16:36:03 +05:30
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2011-02-24 20:18:50 +05:30
|
|
|
prop_dictionary_t
|
2012-05-31 19:59:56 +05:30
|
|
|
xbps_find_pkg_in_array_by_name(prop_array_t array, const char *name,
|
|
|
|
const char *targetarch)
|
2011-02-05 16:36:03 +05:30
|
|
|
{
|
2012-05-31 19:59:56 +05:30
|
|
|
return find_pkg_in_array(array, name, false, false, targetarch);
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
|
2011-02-24 20:18:50 +05:30
|
|
|
prop_dictionary_t
|
2012-05-31 19:59:56 +05:30
|
|
|
xbps_find_pkg_in_array_by_pattern(prop_array_t array, const char *pattern,
|
|
|
|
const char *targetarch)
|
2011-02-05 16:36:03 +05:30
|
|
|
{
|
2012-05-31 19:59:56 +05:30
|
|
|
return find_pkg_in_array(array, pattern, true, false, targetarch);
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
|
2012-01-17 15:20:35 +05:30
|
|
|
prop_dictionary_t
|
2012-05-31 19:59:56 +05:30
|
|
|
xbps_find_pkg_in_array_by_pkgver(prop_array_t array, const char *pkgver,
|
|
|
|
const char *targetarch)
|
2012-01-17 15:20:35 +05:30
|
|
|
{
|
|
|
|
prop_object_iterator_t iter;
|
|
|
|
prop_object_t obj = NULL;
|
2012-05-31 19:59:56 +05:30
|
|
|
const char *rpkgver, *arch;
|
|
|
|
bool chkarch, found = false;
|
2012-01-17 15:20:35 +05:30
|
|
|
|
|
|
|
assert(prop_object_type(array) == PROP_TYPE_ARRAY);
|
|
|
|
assert(pkgver != NULL);
|
|
|
|
|
|
|
|
iter = prop_array_iterator(array);
|
|
|
|
if (iter == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
while ((obj = prop_object_iterator_next(iter))) {
|
2012-05-31 19:59:56 +05:30
|
|
|
chkarch = prop_dictionary_get_cstring_nocopy(obj,
|
|
|
|
"architecture", &arch);
|
2012-01-17 15:20:35 +05:30
|
|
|
if (!prop_dictionary_get_cstring_nocopy(obj,
|
|
|
|
"pkgver", &rpkgver))
|
|
|
|
continue;
|
2012-05-31 19:59:56 +05:30
|
|
|
if (chkarch && !xbps_pkg_arch_match(arch, targetarch))
|
|
|
|
continue;
|
2012-01-17 15:20:35 +05:30
|
|
|
if (strcmp(pkgver, rpkgver) == 0) {
|
|
|
|
found = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
prop_object_iterator_release(iter);
|
|
|
|
if (found)
|
|
|
|
return obj;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-07-15 22:15:38 +05:30
|
|
|
prop_dictionary_t
|
|
|
|
xbps_find_virtualpkg_in_array_by_name(prop_array_t array, const char *name)
|
|
|
|
{
|
2012-05-31 19:59:56 +05:30
|
|
|
return find_pkg_in_array(array, name, false, true, NULL);
|
2011-07-15 22:15:38 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
prop_dictionary_t
|
|
|
|
xbps_find_virtualpkg_in_array_by_pattern(prop_array_t array, const char *pattern)
|
|
|
|
{
|
2012-05-31 19:59:56 +05:30
|
|
|
return find_pkg_in_array(array, pattern, true, true, NULL);
|
2011-07-15 22:15:38 +05:30
|
|
|
}
|
|
|
|
|
2011-02-05 16:36:03 +05:30
|
|
|
static const char *
|
2012-06-14 11:52:11 +05:30
|
|
|
find_virtualpkg_user_in_conf(struct xbps_handle *xhp,
|
|
|
|
const char *vpkg,
|
|
|
|
bool bypattern)
|
2011-02-05 16:36:03 +05:30
|
|
|
{
|
2011-06-04 17:07:53 +05:30
|
|
|
const char *vpkgver, *pkg = NULL;
|
2012-06-05 14:28:39 +05:30
|
|
|
char *vpkgname = NULL, *tmp;
|
2011-12-15 15:49:20 +05:30
|
|
|
size_t i, j, cnt;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
2011-12-15 15:49:20 +05:30
|
|
|
if (xhp->cfg == NULL)
|
2011-06-04 19:21:32 +05:30
|
|
|
return NULL;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
2011-12-15 15:49:20 +05:30
|
|
|
if ((cnt = cfg_size(xhp->cfg, "virtual-package")) == 0) {
|
|
|
|
/* no virtual packages configured */
|
2011-02-05 16:36:03 +05:30
|
|
|
return NULL;
|
2011-12-15 15:49:20 +05:30
|
|
|
}
|
2011-06-04 17:07:53 +05:30
|
|
|
|
2011-12-15 15:49:20 +05:30
|
|
|
for (i = 0; i < cnt; i++) {
|
|
|
|
cfg_t *sec = cfg_getnsec(xhp->cfg, "virtual-package", i);
|
|
|
|
for (j = 0; j < cfg_size(sec, "targets"); j++) {
|
2012-06-05 14:28:39 +05:30
|
|
|
tmp = NULL;
|
2011-12-15 15:49:20 +05:30
|
|
|
vpkgver = cfg_getnstr(sec, "targets", j);
|
2012-06-05 14:28:39 +05:30
|
|
|
if (strchr(vpkgver, '_') == NULL) {
|
|
|
|
tmp = xbps_xasprintf("%s_1", vpkgver);
|
|
|
|
assert(tmp != NULL);
|
|
|
|
vpkgname = xbps_pkg_name(tmp);
|
|
|
|
free(tmp);
|
|
|
|
} else {
|
|
|
|
vpkgname = xbps_pkg_name(vpkgver);
|
|
|
|
}
|
2011-06-04 17:07:53 +05:30
|
|
|
if (vpkgname == NULL)
|
|
|
|
break;
|
2011-12-15 15:49:20 +05:30
|
|
|
if (bypattern) {
|
|
|
|
if (!xbps_pkgpattern_match(vpkgver, vpkg)) {
|
|
|
|
free(vpkgname);
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (strcmp(vpkg, vpkgname)) {
|
|
|
|
free(vpkgname);
|
|
|
|
continue;
|
|
|
|
}
|
2011-06-04 17:07:53 +05:30
|
|
|
}
|
2011-12-15 15:49:20 +05:30
|
|
|
/* virtual package matched in conffile */
|
|
|
|
pkg = cfg_title(sec);
|
2012-06-14 11:52:11 +05:30
|
|
|
xbps_dbg_printf(xhp,
|
|
|
|
"matched vpkg in conf `%s' for %s\n",
|
2011-12-15 15:49:20 +05:30
|
|
|
pkg, vpkg);
|
2011-10-15 23:29:54 +05:30
|
|
|
free(vpkgname);
|
2011-12-15 15:49:20 +05:30
|
|
|
break;
|
2011-06-04 17:07:53 +05:30
|
|
|
}
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
return pkg;
|
|
|
|
}
|
|
|
|
|
|
|
|
static prop_dictionary_t
|
2012-06-14 11:52:11 +05:30
|
|
|
find_virtualpkg_user_in_array(struct xbps_handle *xhp,
|
|
|
|
prop_array_t array,
|
2011-02-05 16:36:03 +05:30
|
|
|
const char *str,
|
|
|
|
bool bypattern)
|
|
|
|
{
|
2011-12-15 15:49:20 +05:30
|
|
|
const char *vpkgname;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
2011-10-19 20:23:38 +05:30
|
|
|
assert(prop_object_type(array) == PROP_TYPE_ARRAY);
|
2011-02-05 16:36:03 +05:30
|
|
|
assert(str != NULL);
|
|
|
|
|
2012-06-14 11:52:11 +05:30
|
|
|
vpkgname = find_virtualpkg_user_in_conf(xhp, str, bypattern);
|
2011-12-15 15:49:20 +05:30
|
|
|
if (vpkgname == NULL)
|
2011-02-05 16:36:03 +05:30
|
|
|
return NULL;
|
|
|
|
|
2012-05-31 19:59:56 +05:30
|
|
|
return find_pkg_in_array(array, vpkgname, false, false, NULL);
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
|
2012-03-13 16:07:50 +05:30
|
|
|
prop_dictionary_t HIDDEN
|
2012-06-14 11:52:11 +05:30
|
|
|
xbps_find_virtualpkg_conf_in_array_by_name(struct xbps_handle *xhp,
|
|
|
|
prop_array_t array,
|
|
|
|
const char *name)
|
2012-01-19 16:56:40 +05:30
|
|
|
{
|
2012-06-14 11:52:11 +05:30
|
|
|
return find_virtualpkg_user_in_array(xhp, array, name, false);
|
2012-01-19 16:56:40 +05:30
|
|
|
}
|
|
|
|
|
2012-03-13 16:07:50 +05:30
|
|
|
prop_dictionary_t HIDDEN
|
2012-06-14 11:52:11 +05:30
|
|
|
xbps_find_virtualpkg_conf_in_array_by_pattern(struct xbps_handle *xhp,
|
|
|
|
prop_array_t array,
|
|
|
|
const char *p)
|
2012-01-19 16:56:40 +05:30
|
|
|
{
|
2012-06-14 11:52:11 +05:30
|
|
|
return find_virtualpkg_user_in_array(xhp, array, p, true);
|
2012-01-19 16:56:40 +05:30
|
|
|
}
|
|
|
|
|
2011-02-05 16:36:03 +05:30
|
|
|
static prop_dictionary_t
|
|
|
|
find_pkg_in_dict(prop_dictionary_t d,
|
|
|
|
const char *key,
|
|
|
|
const char *str,
|
|
|
|
bool bypattern,
|
2011-10-15 23:29:54 +05:30
|
|
|
bool virtual)
|
2011-02-05 16:36:03 +05:30
|
|
|
{
|
|
|
|
prop_array_t array;
|
|
|
|
|
2011-10-19 20:23:38 +05:30
|
|
|
assert(prop_object_type(d) == PROP_TYPE_DICTIONARY);
|
2011-02-05 16:36:03 +05:30
|
|
|
assert(str != NULL);
|
|
|
|
assert(key != NULL);
|
|
|
|
|
|
|
|
array = prop_dictionary_get(d, key);
|
|
|
|
if (prop_object_type(array) != PROP_TYPE_ARRAY)
|
|
|
|
return NULL;
|
|
|
|
|
2012-05-31 19:59:56 +05:30
|
|
|
return find_pkg_in_array(array, str, bypattern, virtual, NULL);
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
|
2011-02-24 20:18:50 +05:30
|
|
|
prop_dictionary_t
|
2011-02-05 16:36:03 +05:30
|
|
|
xbps_find_pkg_in_dict_by_name(prop_dictionary_t d,
|
|
|
|
const char *key,
|
|
|
|
const char *pkgname)
|
|
|
|
{
|
2011-10-15 23:29:54 +05:30
|
|
|
return find_pkg_in_dict(d, key, pkgname, false, false);
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
|
2011-02-24 20:18:50 +05:30
|
|
|
prop_dictionary_t
|
2011-02-05 16:36:03 +05:30
|
|
|
xbps_find_pkg_in_dict_by_pattern(prop_dictionary_t d,
|
|
|
|
const char *key,
|
|
|
|
const char *pattern)
|
|
|
|
{
|
2011-10-15 23:29:54 +05:30
|
|
|
return find_pkg_in_dict(d, key, pattern, true, false);
|
2011-07-15 21:52:58 +05:30
|
|
|
}
|
|
|
|
|
2012-01-17 20:47:03 +05:30
|
|
|
prop_dictionary_t
|
|
|
|
xbps_find_pkg_in_dict_by_pkgver(prop_dictionary_t d,
|
|
|
|
const char *key,
|
|
|
|
const char *pkgver)
|
|
|
|
{
|
|
|
|
prop_array_t array;
|
|
|
|
|
|
|
|
assert(d != NULL);
|
|
|
|
assert(key != NULL);
|
|
|
|
assert(pkgver != NULL);
|
|
|
|
|
|
|
|
array = prop_dictionary_get(d, key);
|
|
|
|
if (array == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
2012-05-31 19:59:56 +05:30
|
|
|
return xbps_find_pkg_in_array_by_pkgver(array, pkgver, NULL);
|
2012-01-17 20:47:03 +05:30
|
|
|
}
|
|
|
|
|
2012-03-12 21:06:46 +05:30
|
|
|
prop_dictionary_t
|
2011-07-15 21:52:58 +05:30
|
|
|
xbps_find_virtualpkg_in_dict_by_name(prop_dictionary_t d,
|
|
|
|
const char *key,
|
|
|
|
const char *name)
|
|
|
|
{
|
2011-10-15 23:29:54 +05:30
|
|
|
return find_pkg_in_dict(d, key, name, false, true);
|
2011-07-15 21:52:58 +05:30
|
|
|
}
|
|
|
|
|
2012-03-12 21:06:46 +05:30
|
|
|
prop_dictionary_t
|
2011-07-15 21:52:58 +05:30
|
|
|
xbps_find_virtualpkg_in_dict_by_pattern(prop_dictionary_t d,
|
|
|
|
const char *key,
|
|
|
|
const char *pattern)
|
|
|
|
{
|
2011-10-15 23:29:54 +05:30
|
|
|
return find_pkg_in_dict(d, key, pattern, true, true);
|
2011-02-05 16:36:03 +05:30
|
|
|
}
|
|
|
|
|
2011-07-15 21:52:58 +05:30
|
|
|
static prop_dictionary_t
|
2012-06-14 11:52:11 +05:30
|
|
|
find_pkgd_installed(struct xbps_handle *xhp,
|
|
|
|
const char *str,
|
|
|
|
bool bypattern,
|
|
|
|
bool virtual)
|
2011-02-05 16:36:03 +05:30
|
|
|
{
|
2011-06-04 17:07:53 +05:30
|
|
|
prop_dictionary_t pkgd, rpkgd = NULL;
|
2011-02-05 16:36:03 +05:30
|
|
|
pkg_state_t state = 0;
|
2011-12-22 17:26:56 +05:30
|
|
|
int rv;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
|
|
|
assert(str != NULL);
|
|
|
|
|
2012-01-20 15:40:52 +05:30
|
|
|
if ((rv = xbps_pkgdb_init(xhp)) != 0) {
|
2011-12-22 17:26:56 +05:30
|
|
|
if (rv != ENOENT) {
|
2012-06-14 11:52:11 +05:30
|
|
|
xbps_dbg_printf(xhp, "%s: couldn't initialize "
|
2012-01-20 15:40:52 +05:30
|
|
|
"pkgdb: %s\n", strerror(rv));
|
2011-12-22 17:26:56 +05:30
|
|
|
return NULL;
|
|
|
|
} else if (rv == ENOENT)
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-02-05 16:36:03 +05:30
|
|
|
|
2011-10-16 20:51:43 +05:30
|
|
|
/* try normal pkg */
|
|
|
|
if (virtual == false) {
|
2012-05-31 19:59:56 +05:30
|
|
|
pkgd =
|
|
|
|
find_pkg_in_array(xhp->pkgdb, str, bypattern, false, NULL);
|
2011-10-16 20:51:43 +05:30
|
|
|
} else {
|
|
|
|
/* virtual pkg set by user in conf */
|
2012-06-14 11:52:11 +05:30
|
|
|
pkgd = find_virtualpkg_user_in_array(xhp, xhp->pkgdb,
|
2012-01-20 15:40:52 +05:30
|
|
|
str, bypattern);
|
2011-10-16 20:51:43 +05:30
|
|
|
if (pkgd == NULL) {
|
2012-01-20 15:40:52 +05:30
|
|
|
/* any virtual pkg in array matching pattern */
|
|
|
|
pkgd = find_pkg_in_array(xhp->pkgdb,
|
2012-05-31 19:59:56 +05:30
|
|
|
str, bypattern, true, NULL);
|
2011-10-16 20:51:43 +05:30
|
|
|
}
|
2011-10-15 23:29:54 +05:30
|
|
|
}
|
2011-10-16 20:51:43 +05:30
|
|
|
/* pkg not found */
|
2011-02-05 16:36:03 +05:30
|
|
|
if (pkgd == NULL)
|
2011-10-15 23:29:54 +05:30
|
|
|
return NULL;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
2011-06-01 13:07:32 +05:30
|
|
|
if (xbps_pkg_state_dictionary(pkgd, &state) != 0)
|
2011-06-04 17:07:53 +05:30
|
|
|
return rpkgd;
|
2011-02-05 16:36:03 +05:30
|
|
|
|
|
|
|
switch (state) {
|
|
|
|
case XBPS_PKG_STATE_INSTALLED:
|
|
|
|
case XBPS_PKG_STATE_UNPACKED:
|
|
|
|
rpkgd = prop_dictionary_copy(pkgd);
|
|
|
|
break;
|
|
|
|
default:
|
2011-11-30 15:41:15 +05:30
|
|
|
/* not fully installed */
|
|
|
|
errno = ENOENT;
|
2011-02-05 16:36:03 +05:30
|
|
|
break;
|
|
|
|
}
|
2011-06-04 17:07:53 +05:30
|
|
|
|
2011-02-05 16:36:03 +05:30
|
|
|
return rpkgd;
|
|
|
|
}
|
|
|
|
|
2011-07-15 21:52:58 +05:30
|
|
|
prop_dictionary_t
|
2012-06-14 11:52:11 +05:30
|
|
|
xbps_find_pkg_dict_installed(struct xbps_handle *xhp,
|
|
|
|
const char *str,
|
|
|
|
bool bypattern)
|
2011-07-15 21:52:58 +05:30
|
|
|
{
|
2012-06-14 11:52:11 +05:30
|
|
|
return find_pkgd_installed(xhp, str, bypattern, false);
|
2011-07-15 21:52:58 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
prop_dictionary_t
|
2012-06-14 11:52:11 +05:30
|
|
|
xbps_find_virtualpkg_dict_installed(struct xbps_handle *xhp,
|
|
|
|
const char *str,
|
|
|
|
bool bypattern)
|
2011-07-15 21:52:58 +05:30
|
|
|
{
|
2012-06-14 11:52:11 +05:30
|
|
|
return find_pkgd_installed(xhp, str, bypattern, true);
|
2011-07-15 21:52:58 +05:30
|
|
|
}
|