Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge remote-tracking branch 'upstream/master'
Shawn Webb committed 2 years ago
commit 29f999c987a58706a77618629d8a1aa3013b9334
parent f17f98f
3 files changed +21 -27
modified libpkg/pkg_macho.c
@@ -263,30 +263,26 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg, const char *stage)

	/* Determine our system's CPU type */
	if ((ret = host_cpu_type(&cpu_type)) != EPKG_OK)
-
		goto cleanup;
+
		return (EPKG_FATAL);

	/* Create our mach-o handle */
	macho_handle = macho_create_handle();
	if (macho_handle == NULL) {
-
			pkg_emit_error("macho_create_handle() failed");
-
			ret = EPKG_FATAL;
-
			goto cleanup;
+
		pkg_emit_error("macho_create_handle() failed");
+
		return (EPKG_FATAL);
	}

	/* Evaluate all package files */
	while ((ret = pkg_files(pkg, &file)) == EPKG_OK) {
-
		if (stage != NULL)
+
		if (stage != NULL) {
			free(fpath);
-

-
		if (stage != NULL)
			xasprintf(&fpath, "%s/%s", stage, file->path);
-
		else
-
			fpath = file->path;
-

-
		if (fpath == NULL) {
-
			pkg_emit_error("pkg_analyse_files(): path allocation failed");
-
			ret = EPKG_FATAL;
-
			goto cleanup;
+
		} else {
+
			if ((fpath = file->path) == NULL) {
+
				pkg_emit_error("pkg_analyse_files(): path allocation failed");
+
				macho_destroy_handle(macho_handle);
+
				return (EPKG_FATAL);
+
			}
		}

		ret = analyse_macho(pkg, fpath, cpu_type, macho_handle, add_dylibs_to_pkg, db);
@@ -295,19 +291,12 @@ pkg_analyse_files(struct pkgdb *db, struct pkg *pkg, const char *stage)
		}
	}

-
	if (ret != EPKG_OK)
-
		goto cleanup;
-

-
cleanup:
	macho_destroy_handle(macho_handle);

	if (stage != NULL)
		free(fpath);

-
	if (failures)
-
		ret = EPKG_FATAL;
-

-
	return (ret);
+
	return (failures ? EPKG_FATAL : ret);
}

int
modified src/audit.c
@@ -398,8 +398,8 @@ exec_audit(int argc, char **argv)
					if (quiet) {
						if (version != NULL)
							pkg_printf("%n-%v\n", pkg, pkg);
-
							else
-
						pkg_printf("%s\n", pkg);
+
						else
+
							pkg_printf("%s\n", pkg);
						continue;
					}

modified src/create.c
@@ -96,12 +96,17 @@ pkg_create_matches(int argc, char **argv, match_t match, struct pkg_create *pc)
	for (i = 0; i < argc || match == MATCH_ALL; i++) {
		if (match == MATCH_ALL) {
			printf("Loading the package list...\n");
-
			if ((it = pkgdb_query(db, NULL, match)) == NULL)
+
			if ((it = pkgdb_query(db, NULL, match)) == NULL) {
+
				retcode = EXIT_FAILURE;
				goto cleanup;
+
			}
			match = !MATCH_ALL;
-
		} else
-
			if ((it = pkgdb_query(db, argv[i], match)) == NULL)
+
		} else {
+
			if ((it = pkgdb_query(db, argv[i], match)) == NULL) {
+
				retcode = EXIT_FAILURE;
				goto cleanup;
+
			}
+
		}

		foundone = false;
		while ((ret = pkgdb_it_next(it, &pkg, query_flags)) == EPKG_OK) {