Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
pkg-[r]query: Add %q to display architecture
Bryan Drewery committed 12 years ago
commit eef550b1ec4da3ebf8e7731579a91ea57a49dfb4
parent 564df0a
4 files changed +19 -2
modified pkg/pkg-query.8
@@ -15,7 +15,7 @@
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
-
.Dd September 28, 2013
+
.Dd December 5, 2013
.Dt PKG-QUERY 8
.Os
.Sh NAME
@@ -98,6 +98,8 @@ is in bytes, and
is in human readable format.
.It Cm \&%a
Returns 1 if the matched package is an orphan package and can be pkg-autoremove(1)'d, 0 otherwise
+
.It Cm \&%q
+
Architecture of the matched package
.It Cm \&%k
Returns 1 if the matched package is locked against modification or deletion, 0 otherwise
.It Cm \&%M
@@ -254,6 +256,8 @@ WWW address of the package (type string)
Flatsize of the package (type integer)
.It Cm \&%a
Automatic status of the package (type integer)
+
.It Cm \&%q
+
Architecture of the package (type string)
.It Cm \&%k
Locking status of the package (type integer)
.It Cm \&%M
modified pkg/pkg-rquery.8
@@ -15,7 +15,7 @@
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
-
.Dd November 7, 2013
+
.Dd December 5, 2013
.Dt PKG-RQUERY 8
.Os
.Sh NAME
@@ -106,6 +106,8 @@ Comment of the matched package
Description of the matched package
.It Cm \&%w
Home page of the matched package
+
.It Cm \&%q
+
Architecture of the matched package
.It Cm \&%l
license logic of the matched package - nothing for single, & for AND, and | for OR
.It Cm \&%s Ns Op bh
@@ -224,6 +226,8 @@ WWW address of the package (type string)
Flatsize of the package (type integer)
.It Cm \&%a
Automatic status of the package (type integer)
+
.It Cm \&%q
+
Architecture of the package (type string)
.It Cm \&%M
Message of the package (type string)
.It Cm \&%# Ns Op drCOLBbA
modified pkg/query.c
@@ -67,6 +67,7 @@ static struct query_flags accepted_query_flags[] = {
	{ 'e', "",		0, PKG_LOAD_BASIC },
	{ 'w', "",		0, PKG_LOAD_BASIC },
	{ 'l', "",		0, PKG_LOAD_BASIC },
+
	{ 'q', "",		0, PKG_LOAD_BASIC },
	{ 'a', "",		0, PKG_LOAD_BASIC },
	{ 'k', "",		0, PKG_LOAD_BASIC },
	{ 'M', "",		0, PKG_LOAD_BASIC },
@@ -212,6 +213,9 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
					break;
				}
				break;
+
			case 'q':
+
				pkg_sbuf_printf(dest, "%q", pkg);
+
				break;
			case 'l':
				pkg_sbuf_printf(dest, "%l", pkg);
				break;
@@ -475,6 +479,10 @@ format_sql_condition(const char *str, struct sbuf *sqlcond, bool for_remote)
					sbuf_cat(sqlcond, "automatic");
					state = OPERATOR_INT;
					break;
+
				case 'q':
+
					sbuf_cat(sqlcond, "arch");
+
					state = OPERATOR_STRING;
+
					break;
				case 'k':
					if (for_remote)
						goto bad_option;
modified pkg/rquery.c
@@ -64,6 +64,7 @@ static struct query_flags accepted_rquery_flags[] = {
	{ 'c', "",		0, PKG_LOAD_BASIC },
	{ 'w', "",		0, PKG_LOAD_BASIC },
	{ 'l', "",		0, PKG_LOAD_BASIC },
+
	{ 'q', "",		0, PKG_LOAD_BASIC },
	{ 'M', "",		0, PKG_LOAD_BASIC }
};