forked from ariadne/pkgconf
pkg: implement resolver-side support for some pkg-config clone's --env-only option
parent
187b4e538f
commit
e59b9864ea
9
pkg.c
9
pkg.c
|
@ -87,9 +87,12 @@ pkg_find(const char *name, unsigned int flags)
|
|||
free(path);
|
||||
}
|
||||
|
||||
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, PKG_DEFAULT_PATH, name);
|
||||
if (f = fopen(locbuf, "r"))
|
||||
return parse_file(locbuf, f);
|
||||
if (!(flags & PKGF_ENV_ONLY))
|
||||
{
|
||||
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, PKG_DEFAULT_PATH, name);
|
||||
if (f = fopen(locbuf, "r"))
|
||||
return parse_file(locbuf, f);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
1
pkg.h
1
pkg.h
|
@ -102,6 +102,7 @@ struct pkg_ {
|
|||
|
||||
#define PKGF_NONE 0x0
|
||||
#define PKGF_SEARCH_PRIVATE 0x1
|
||||
#define PKGF_ENV_ONLY 0x2
|
||||
|
||||
pkg_t *pkg_find(const char *name, unsigned int flags);
|
||||
void pkg_traverse(pkg_t *root, void (*pkg_traverse_func)(pkg_t *package, void *data), void *data, int maxdepth, unsigned int flags);
|
||||
|
|
Loading…
Reference in New Issue