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);
|
free(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, PKG_DEFAULT_PATH, name);
|
if (!(flags & PKGF_ENV_ONLY))
|
||||||
if (f = fopen(locbuf, "r"))
|
{
|
||||||
return parse_file(locbuf, f);
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
1
pkg.h
1
pkg.h
|
@ -102,6 +102,7 @@ struct pkg_ {
|
||||||
|
|
||||||
#define PKGF_NONE 0x0
|
#define PKGF_NONE 0x0
|
||||||
#define PKGF_SEARCH_PRIVATE 0x1
|
#define PKGF_SEARCH_PRIVATE 0x1
|
||||||
|
#define PKGF_ENV_ONLY 0x2
|
||||||
|
|
||||||
pkg_t *pkg_find(const char *name, unsigned int flags);
|
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);
|
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