Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Turn pkg_suggest_arch into an internal function
Baptiste Daroussin committed 6 years ago
commit 4475a2f85e889739c01e7c6944f92e3ed017968a
parent 2715cbc
5 files changed +8 -14
modified libpkg/libpkg.ver
@@ -150,7 +150,6 @@ global:
	pkg_solve_sat_to_jobs;
	pkg_sshserve;
	pkg_status;
-
	pkg_suggest_arch;
	pkg_test_filesum;
	pkg_try_installed;
	pkg_type;
modified libpkg/pkg.h.in
@@ -697,12 +697,6 @@ int pkg_config_files(const struct pkg *pkg, struct pkg_config_file **cf);
int pkg_analyse_files(struct pkgdb *, struct pkg *, const char *);

/**
-
 * Suggest if a package could be marked architecture independent or
-
 * not.
-
 */
-
int pkg_suggest_arch(struct pkg *, const char *, bool);
-

-
/**
 * Generic setter for simple attributes.
 */
int pkg_set2(struct pkg *pkg, ...);
modified libpkg/pkg_arch.c
@@ -36,21 +36,21 @@
#include "private/event.h"

int
-
pkg_suggest_arch(struct pkg *pkg, const char *arch, bool isdefault)
+
suggest_arch(struct pkg *pkg, bool isdefault)
{
	bool iswildcard;

-
	iswildcard = (strchr(arch, '*') != NULL);
+
	iswildcard = (strchr(pkg->abi, '*') != NULL);

	if (iswildcard && isdefault)
		pkg_emit_developer_mode("Configuration error: arch \"%s\" "
-
		    "cannot use wildcards as default", arch);
+
		    "cannot use wildcards as default", pkg->abi);

	if (pkg->flags & (PKG_CONTAINS_ELF_OBJECTS|PKG_CONTAINS_STATIC_LIBS)) {
		if (iswildcard) {
			/* Definitely has to be arch specific */
			pkg_emit_developer_mode("Error: arch \"%s\" -- package "
-
			    "installs architecture specific files", arch);
+
			    "installs architecture specific files", pkg->abi);
		}
	} else {
		if (pkg->flags & PKG_CONTAINS_H_OR_LA) {
@@ -59,7 +59,7 @@ pkg_suggest_arch(struct pkg *pkg, const char *arch, bool isdefault)
				pkg_emit_developer_mode("Warning: arch \"%s\" "
				    "-- package installs C/C++ headers or "
				    "libtool files,\n**** which are often "
-
				    "architecture specific", arch);
+
				    "architecture specific", pkg->abi);
			}
		} else {
			/* Might be arch independent */
@@ -67,7 +67,7 @@ pkg_suggest_arch(struct pkg *pkg, const char *arch, bool isdefault)
				pkg_emit_developer_mode("Notice: arch \"%s\" -- "
				    "no architecture specific files found:\n"
				    "**** could this package use a wildcard "
-
				    "architecture?", arch);
+
				    "architecture?", pkg->abi);
		}
	}
	return (EPKG_OK);
modified libpkg/pkg_create.c
@@ -387,7 +387,7 @@ pkg_load_metadata(struct pkg *pkg, const char *mfile, const char *md_dir,
		pkg_analyse_files(NULL, pkg, rootdir);

	if (ctx.developer_mode)
-
		pkg_suggest_arch(pkg, pkg->abi, defaultarch);
+
		suggest_arch(pkg, defaultarch);

cleanup:
	if (mfd != -1)
modified libpkg/private/pkg.h
@@ -875,5 +875,6 @@ struct pkg_dep* pkg_adddep_chain(struct pkg_dep *chain,
		struct pkg *pkg, const char *name, const char *origin, const
		char *version, bool locked);
void backup_library(struct pkg *pkg, const char *name);
+
int suggest_arch(struct pkg *, bool);

#endif