From d6fb7881d4f1744489765d1bd2257aaae0d8854b Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 1 Mar 2013 12:06:52 -0600 Subject: [PATCH] pkg: remove pkg_t.uninstalled, use a property flag instead --- main.c | 4 ++-- pkg.c | 2 +- pkg.h | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 7f50708..a569f0c 100644 --- a/main.c +++ b/main.c @@ -89,7 +89,7 @@ print_fragment(pkg_fragment_t *frag) static void print_list_entry(const pkg_t *entry) { - if (entry->uninstalled) + if (entry->flags & PKG_PROPF_UNINSTALLED) return; printf("%-30s %s - %s\n", entry->id, entry->realname, entry->description); @@ -387,7 +387,7 @@ check_uninstalled(pkg_t *pkg, void *data, unsigned int flags) int *retval = data; (void) flags; - if (pkg->uninstalled) + if (pkg->flags & PKG_PROPF_UNINSTALLED) *retval = EXIT_SUCCESS; } diff --git a/pkg.c b/pkg.c index 227959f..b8bef09 100644 --- a/pkg.c +++ b/pkg.c @@ -312,7 +312,7 @@ pkg_try_specific_path(const char *path, const char *name, unsigned int flags) if (!(flags & PKGF_NO_UNINSTALLED) && (f = fopen(uninst_locbuf, "r")) != NULL) { pkg = pkg_new_from_file(uninst_locbuf, f, flags); - pkg->uninstalled = true; + pkg->flags |= PKG_PROPF_UNINSTALLED; } else if ((f = fopen(locbuf, "r")) != NULL) pkg = pkg_new_from_file(locbuf, f, flags); diff --git a/pkg.h b/pkg.h index 098ab0a..26ab7df 100644 --- a/pkg.h +++ b/pkg.h @@ -78,6 +78,7 @@ struct pkg_tuple_ { #define PKG_PROPF_VIRTUAL 0x1 #define PKG_PROPF_CACHED 0x2 #define PKG_PROPF_SEEN 0x4 +#define PKG_PROPF_UNINSTALLED 0x8 struct pkg_ { pkg_node_t cache_iter; @@ -101,8 +102,6 @@ struct pkg_ { pkg_list_t vars; - bool uninstalled; - unsigned int flags; };