forked from ariadne/pkgconf
pkg: add PKGF_NO_UNINSTALLED resolver flag
parent
ed126f5b5b
commit
24265bb18e
4
pkg.c
4
pkg.c
|
@ -99,7 +99,7 @@ pkg_find(const char *name, unsigned int flags)
|
||||||
snprintf(uninst_locbuf, sizeof uninst_locbuf, "%s/%s-uninstalled" PKG_CONFIG_EXT, path[iter], name);
|
snprintf(uninst_locbuf, sizeof uninst_locbuf, "%s/%s-uninstalled" PKG_CONFIG_EXT, path[iter], name);
|
||||||
free(path[iter]);
|
free(path[iter]);
|
||||||
|
|
||||||
if ((f = fopen(uninst_locbuf, "r")) != NULL)
|
if (!(flags & PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL)
|
||||||
{
|
{
|
||||||
pkg_t *pkg = parse_file(locbuf, f);
|
pkg_t *pkg = parse_file(locbuf, f);
|
||||||
pkg->uninstalled = true;
|
pkg->uninstalled = true;
|
||||||
|
@ -131,7 +131,7 @@ pkg_find(const char *name, unsigned int flags)
|
||||||
snprintf(uninst_locbuf, sizeof uninst_locbuf, "%s/%s-uninstalled" PKG_CONFIG_EXT, path[iter], name);
|
snprintf(uninst_locbuf, sizeof uninst_locbuf, "%s/%s-uninstalled" PKG_CONFIG_EXT, path[iter], name);
|
||||||
free(path[iter]);
|
free(path[iter]);
|
||||||
|
|
||||||
if ((f = fopen(uninst_locbuf, "r")) != NULL)
|
if (!(flags & PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL)
|
||||||
{
|
{
|
||||||
pkg_t *pkg = parse_file(locbuf, f);
|
pkg_t *pkg = parse_file(locbuf, f);
|
||||||
pkg->uninstalled = true;
|
pkg->uninstalled = true;
|
||||||
|
|
1
pkg.h
1
pkg.h
|
@ -120,6 +120,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
|
#define PKGF_ENV_ONLY 0x2
|
||||||
|
#define PKGF_NO_UNINSTALLED 0x4
|
||||||
|
|
||||||
#define PKG_ERRF_OK 0x0
|
#define PKG_ERRF_OK 0x0
|
||||||
#define PKG_ERRF_PACKAGE_NOT_FOUND 0x1
|
#define PKG_ERRF_PACKAGE_NOT_FOUND 0x1
|
||||||
|
|
Loading…
Reference in New Issue