pkg: add PKGF_NO_UNINSTALLED resolver flag

pull/15/head
William Pitcock 2012-05-06 19:49:15 -05:00
parent ed126f5b5b
commit 24265bb18e
2 changed files with 3 additions and 2 deletions

4
pkg.c
View File

@ -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);
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->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);
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->uninstalled = true;

1
pkg.h
View File

@ -120,6 +120,7 @@ struct pkg_ {
#define PKGF_NONE 0x0
#define PKGF_SEARCH_PRIVATE 0x1
#define PKGF_ENV_ONLY 0x2
#define PKGF_NO_UNINSTALLED 0x4
#define PKG_ERRF_OK 0x0
#define PKG_ERRF_PACKAGE_NOT_FOUND 0x1