Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Add %Q to print altabi
Baptiste Daroussin committed 8 years ago
commit ed560558d2db98eaaf44947328b487baec73e5ca
parent 5e0989c
2 files changed +22 -0
modified libpkg/pkg_printf.c
@@ -447,6 +447,15 @@ static const struct pkg_printf_fmt fmt[] = {
		PP_PKG,
		&format_options,
	},
+
	[PP_PKG_ALTABI] =
+
	{
+
		'Q',
+
		'\0',
+
		false,
+
		true,
+
		PP_ALL,
+
		&format_altabi,
+
	},
	[PP_PKG_REPO_PATH] =
	{
		'R',
@@ -1378,6 +1387,17 @@ format_option_description(UT_string *buf, const void *data, struct percent_esc *
}

/*
+
 * %Q -- pkg architecture a.k.a ABI string.  Accepts field-width, left-align
+
 */
+
UT_string *
+
format_altabi(UT_string *buf, const void *data, struct percent_esc *p)
+
{
+
	const struct pkg	*pkg = data;
+

+
	return (string_val(buf, pkg->arch, p));
+
}
+

+
/*
 * %R -- Repo path. string.
 */
UT_string *
modified libpkg/private/pkg_printf.h
@@ -108,6 +108,7 @@ typedef enum _fmt_code_t {
	PP_PKG_OPTION_DEFAULT,
	PP_PKG_OPTION_DESCRIPTION,
	PP_PKG_OPTIONS,
+
	PP_PKG_ALTABI,
	PP_PKG_REPO_PATH,
	PP_PKG_CHAR_STRING,
	PP_PKG_USER_NAME,
@@ -217,6 +218,7 @@ _static UT_string *format_name(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_origin(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_prefix(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_architecture(UT_string *, const void *, struct percent_esc *);
+
_static UT_string *format_altabi(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_requirements(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_flatsize(UT_string *, const void *, struct percent_esc *);
_static UT_string *format_install_tstamp(UT_string *, const void *, struct percent_esc *);