Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge pull request #475 from vstakhov/master
Baptiste Daroussin committed 13 years ago
commit 4d592ed969299f64f248b82595d015c1bd26bb50
parent f35f588
5 files changed +24 -4
modified libpkg/pkg_repo.c
@@ -330,7 +330,7 @@ set_repo_user_version(sqlite3 *sqlite, const char *database, int reposcver)
	int		 retcode = EPKG_OK;
	char		 sql[BUFSIZ];
	char		*errmsg;
-
	const char	*fmt = "PRAGMA %Q.user_version = %" PRId64 ";" ;
+
	const char	*fmt = "PRAGMA %Q.user_version = %d;" ;

	assert(database != NULL);

modified pkg/pkg-query.8
@@ -84,8 +84,10 @@ Prefix of the matched package
Maintainer of the matched package
.It Cm \&%c
Comment of the matched package
+
.It Cm \&%e
+
Description of the matched package
.It Cm \&%i
-
Additionnal information about the package
+
Additional information about the package
.It Cm \&%w
Home page of the matched package
.It Cm \&%l
@@ -229,6 +231,8 @@ Prefix of the package (type string)
Maintainer of the package (type string)
.It Cm \&%c
Comment of the package (type string)
+
.It Cm \&%e
+
Description of the package (type string)
.It Cm \&%w
WWW address of the package (type string)
.It Cm \&%s
modified pkg/pkg-rquery.8
@@ -91,6 +91,8 @@ Prefix of the matched package
Maintainer of the matched package
.It Cm \&%c
Comment of the matched package
+
.It Cm \&%e
+
Description of the matched package
.It Cm \&%w
Home page of the matched package
.It Cm \&%l
@@ -186,6 +188,8 @@ Prefix of the package (type string)
Maintainer of the package (type string)
.It Cm \&%c
Comment of the package (type string)
+
.It Cm \&%e
+
Description of the package (type string)
.It Cm \&%w
WWW address of the package (type string)
.It Cm \&%s
modified pkg/query.c
@@ -63,13 +63,14 @@ static struct query_flags accepted_query_flags[] = {
	{ 'p', "",		0, PKG_LOAD_BASIC },
	{ 'm', "",		0, PKG_LOAD_BASIC },
	{ 'c', "",		0, PKG_LOAD_BASIC },
+
	{ 'e', "",		0, PKG_LOAD_BASIC },
	{ 'w', "",		0, PKG_LOAD_BASIC },
	{ 'l', "",		0, PKG_LOAD_BASIC },
	{ 'a', "",		0, PKG_LOAD_BASIC },
	{ 'k', "",		0, PKG_LOAD_BASIC },
	{ 'M', "",		0, PKG_LOAD_BASIC },
	{ 'i', "",		0, PKG_LOAD_BASIC },
-
	{ 't', "",		0, PKG_LOAD_BASIC },
+
	{ 't', "",		0, PKG_LOAD_BASIC }
};

static void
@@ -156,6 +157,11 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
					sbuf_printf(dest, "%" PRId64, flatsize);
				}
				break;
+
			case 'e':
+
				pkg_get(pkg, PKG_DESC, &tmp);
+
				if (tmp != NULL)
+
					sbuf_cat(dest, tmp);
+
				break;
			case '?':
				qstr++;
				switch (qstr[0]) {
@@ -360,6 +366,7 @@ print_query(struct pkg *pkg, char *qstr, char multiline)
			printf("%s\n", sbuf_data(output));
			break;
		}
+
		break;
	case 'r':
		while (pkg_rdeps(pkg, &dep) == EPKG_OK) {
			format_str(pkg, output, qstr, dep);
@@ -511,6 +518,10 @@ format_sql_condition(const char *str, struct sbuf *sqlcond, bool for_remote)
					sbuf_cat(sqlcond, "time");
					state = OPERATOR_INT;
					break;
+
				case 'e':
+
					sbuf_cat(sqlcond, "desc");
+
					state = OPERATOR_STRING;
+
					break;
				case '#':
					str++;
					const char *dbstr = for_remote ? "%1$s." : "";
modified pkg/rquery.c
@@ -54,6 +54,7 @@ static struct query_flags accepted_rquery_flags[] = {
	{ '#', "drCOLBb",	1, PKG_LOAD_BASIC },	/* dbflags handled in analyse_query_string() */
	{ 's', "hb",		0, PKG_LOAD_BASIC },
	{ 'n', "",		0, PKG_LOAD_BASIC },
+
	{ 'e', "",		0, PKG_LOAD_BASIC },
	{ 'v', "",		0, PKG_LOAD_BASIC },
	{ 'o', "",		0, PKG_LOAD_BASIC },
	{ 'R', "",		0, PKG_LOAD_BASIC },
@@ -62,7 +63,7 @@ static struct query_flags accepted_rquery_flags[] = {
	{ 'c', "",		0, PKG_LOAD_BASIC },
	{ 'w', "",		0, PKG_LOAD_BASIC },
	{ 'l', "",		0, PKG_LOAD_BASIC },
-
	{ 'M', "",		0, PKG_LOAD_BASIC },
+
	{ 'M', "",		0, PKG_LOAD_BASIC }
};

void