Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix wrong pkg_list_empty() usage.
jlaffaye committed 14 years ago
commit 3f617fec8c8b8c562f4d16fd8651acb164f603cd
parent ff6cc9b
10 files changed +25 -25
modified libpkg/pkg.c
@@ -719,7 +719,7 @@ pkg_addoption(struct pkg *pkg, const char *key, const char *value)
}

int
-
pkg_list_empty(struct pkg *pkg, pkg_list list) {
+
pkg_list_isempty(struct pkg *pkg, pkg_list list) {
	switch (list) {
		case PKG_DEPS:
			return (STAILQ_EMPTY(&pkg->deps));
modified libpkg/pkg.h
@@ -248,7 +248,7 @@ int64_t pkg_new_flatsize(struct pkg *);
 */
int64_t pkg_new_pkgsize(struct pkg *);

-
int pkg_list_empty(struct pkg *, pkg_list);
+
int pkg_list_isempty(struct pkg *, pkg_list);
/**
 * Iterates over the dependencies of the package.
 * @param dep Must be set to NULL for the first call.
@@ -669,7 +669,7 @@ int pkg_jobs_add(struct pkg_jobs *jobs, struct pkg *pkg);
/**
 * Returns true if there are no jobs.
 */
-
bool pkg_jobs_empty(struct pkg_jobs *jobs);
+
int pkg_jobs_isempty(struct pkg_jobs *jobs);

/**
 * Iterates over the packages in the jobs queue.
modified libpkg/pkg_delete.c
@@ -31,7 +31,7 @@ pkg_delete2(struct pkg *pkg, struct pkgdb *db, int force, int upgrade)
	 * Do not trust the existing entries as it may have changed if we
	 * delete packages in batch.
	 */
-
	pkg_list_empty(pkg, PKG_RDEPS);
+
	pkg_list_free(pkg, PKG_RDEPS);

	/*
	 * Ensure that we have all the informations we need
modified libpkg/pkg_jobs.c
@@ -55,8 +55,8 @@ pkg_jobs_add(struct pkg_jobs *j, struct pkg *pkg)
	return (EPKG_OK);
}

-
bool
-
pkg_jobs_empty(struct pkg_jobs *j)
+
int
+
pkg_jobs_isempty(struct pkg_jobs *j)
{
	assert(j != NULL);

modified pkg/delete.c
@@ -107,7 +107,7 @@ exec_delete(int argc, char **argv)
	}

	/* check if we have something to deinstall */
-
	if (pkg_jobs_empty(jobs) == true) {
+
	if (pkg_jobs_isempty(jobs)) {
		goto cleanup;
	}

modified pkg/info.c
@@ -35,13 +35,13 @@ print_info(struct pkg * const pkg, unsigned int opt)
		printf("Version: %s\n", pkg_get(pkg, PKG_VERSION));
		printf("Origin: %s\n", pkg_get(pkg, PKG_ORIGIN));
		printf("Prefix: %s\n", pkg_get(pkg, PKG_PREFIX));
-
		if (!pkg_list_empty(pkg, PKG_CATEGORIES)) {
+
		if (!pkg_list_isempty(pkg, PKG_CATEGORIES)) {
			printf("Categories:");
			while (pkg_categories(pkg, &cat) == EPKG_OK)
				printf(" %s", pkg_category_name(cat));
			printf("\n");
		}
-
		if (!pkg_list_empty(pkg, PKG_LICENSES)) {
+
		if (!pkg_list_isempty(pkg, PKG_LICENSES)) {
			printf("Licenses: ");
			while (pkg_licenses(pkg, &lic) == EPKG_OK) {
				printf(" %s", pkg_license_name(lic));
@@ -55,7 +55,7 @@ print_info(struct pkg * const pkg, unsigned int opt)
		printf("Maintainer: %s\n", pkg_get(pkg, PKG_MAINTAINER));
		printf("WWW: %s\n", pkg_get(pkg, PKG_WWW));
		printf("Comment: %s\n", pkg_get(pkg, PKG_COMMENT));
-
		if (!pkg_list_empty(pkg, PKG_OPTIONS)) {
+
		if (!pkg_list_isempty(pkg, PKG_OPTIONS)) {
			printf("Options: \n");
			while (pkg_options(pkg, &option) == EPKG_OK)
				printf("\t%s: %s\n", pkg_option_opt(option), pkg_option_value(option));
modified pkg/install.c
@@ -84,7 +84,7 @@ exec_install(int argc, char **argv)
		pkgdb_it_free(it);
	}

-
	if (pkg_jobs_empty(jobs) == true)
+
	if (pkg_jobs_isempty(jobs))
		goto cleanup;

	/* print a summary before applying the jobs */
modified pkg/query.c
@@ -59,34 +59,34 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
					qstr++;
					switch (qstr[0]) {
						case 'd':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_DEPS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_DEPS));
							break;
						case 'r':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_RDEPS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_RDEPS));
							break;
						case 'C':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_CATEGORIES));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_CATEGORIES));
							break;
						case 'F':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_FILES));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_FILES));
							break;
						case 'O':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_OPTIONS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_OPTIONS));
							break;
						case 'D':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_DIRS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_DIRS));
							break;
						case 'L':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_LICENSES));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_LICENSES));
							break;
						case 'U':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_USERS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_USERS));
							break;
						case 'G':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_GROUPS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_GROUPS));
							break;
						case 'K':
-
							sbuf_printf(dest, "%d", !pkg_list_empty(pkg, PKG_CONFLICTS));
+
							sbuf_printf(dest, "%d", !pkg_list_isempty(pkg, PKG_CONFLICTS));
							break;
					}
					break;
modified pkg/search.c
@@ -79,13 +79,13 @@ exec_search(int argc, char **argv)
		printf("Version: %s\n", pkg_get(pkg, PKG_VERSION));
		printf("Origin: %s\n", pkg_get(pkg, PKG_ORIGIN));
		printf("Prefix: %s\n", pkg_get(pkg, PKG_PREFIX));
-
		if (!pkg_list_empty(pkg, PKG_CATEGORIES)) {
+
		if (!pkg_list_isempty(pkg, PKG_CATEGORIES)) {
			printf("Categories:");
			while (pkg_categories(pkg, &cat) == EPKG_OK)
				printf(" %s", pkg_category_name(cat));
			printf("\n");
		}
-
		if (!pkg_list_empty(pkg, PKG_LICENSES)) {
+
		if (!pkg_list_isempty(pkg, PKG_LICENSES)) {
			printf("Licenses: ");
			while (pkg_licenses(pkg, &lic) == EPKG_OK) {
				printf(" %s", pkg_license_name(lic));
@@ -99,7 +99,7 @@ exec_search(int argc, char **argv)
		printf("Maintainer: %s\n", pkg_get(pkg, PKG_MAINTAINER));
		printf("WWW: %s\n", pkg_get(pkg, PKG_WWW));
		printf("Comment: %s\n", pkg_get(pkg, PKG_COMMENT));
-
		if (!pkg_list_empty(pkg, PKG_OPTIONS)) {
+
		if (!pkg_list_isempty(pkg, PKG_OPTIONS)) {
			printf("Options: \n");
			while (pkg_options(pkg, &opt) == EPKG_OK)
				printf("\t%s: %s\n", pkg_option_opt(opt), pkg_option_value(opt));
modified pkg/upgrade.c
@@ -74,7 +74,7 @@ exec_upgrade(int argc, char **argv)
		pkg = NULL;
	}

-
	if (pkg_jobs_empty(jobs) == true) {
+
	if (pkg_jobs_isempty(jobs)) {
		retcode = 0;
		goto cleanup;
	}