Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Calling it 'abstract metadata' doesn't really do it for me. Change to 'annotation' everywhere, because that's a much better description.
Matthew Seaman committed 13 years ago
commit 1e66afe6f7e8b66d8e911431761056e65d2fd42b
parent 820e840
19 files changed +280 -215
modified libpkg/pkg.c
@@ -112,7 +112,7 @@ pkg_reset(struct pkg *pkg, pkg_t type)
	pkg_list_free(pkg, PKG_GROUPS);
	pkg_list_free(pkg, PKG_SHLIBS_REQUIRED);
	pkg_list_free(pkg, PKG_SHLIBS_PROVIDED);
-
	pkg_list_free(pkg, PKG_ABSTRACT_METADATA);
+
	pkg_list_free(pkg, PKG_ANNOTATIONS);

	pkg->rowid = 0;
	pkg->type = type;
@@ -141,7 +141,7 @@ pkg_free(struct pkg *pkg)
	pkg_list_free(pkg, PKG_GROUPS);
	pkg_list_free(pkg, PKG_SHLIBS_REQUIRED);
	pkg_list_free(pkg, PKG_SHLIBS_PROVIDED);
-
	pkg_list_free(pkg, PKG_ABSTRACT_METADATA);
+
	pkg_list_free(pkg, PKG_ANNOTATIONS);

	free(pkg);
}
@@ -476,11 +476,11 @@ pkg_shlibs_provided(struct pkg *pkg, struct pkg_shlib **s)
}

int
-
pkg_abstract_metadata(struct pkg *pkg, struct pkg_abstract **am)
+
pkg_annotations(struct pkg *pkg, struct pkg_note **an)
{
	assert(pkg != NULL);

-
	HASH_NEXT(pkg->abstract_metadata, (*am));
+
	HASH_NEXT(pkg->annotations, (*an));
}

int
@@ -903,30 +903,30 @@ pkg_addshlib_provided(struct pkg *pkg, const char *name)
}

int
-
pkg_addabstract_metadata(struct pkg *pkg, const char *key, const char *value)
+
pkg_addannotation(struct pkg *pkg, const char *key, const char *value)
{
-
	struct pkg_abstract *am = NULL;
+
	struct pkg_note *an = NULL;

	assert(pkg != NULL);
	assert(key != NULL && key[0] != '\0');
	assert(value != NULL && value[0] != '\0');

	/* The combination of key+value should be unique */
-
	HASH_FIND_STR(pkg->abstract_metadata, __DECONST(char *, key), am);
-
	if (am != NULL && strcmp(value, pkg_abstract_value(am)) == 0) {
-
		pkg_emit_error("duplicate abstract metadata listing: %s -- %s,"
+
	HASH_FIND_STR(pkg->annotations, __DECONST(char *, key), an);
+
	if (an != NULL && strcmp(value, pkg_annotation_value(an)) == 0) {
+
		pkg_emit_error("duplicate annotation listing: %s -- %s,"
			       " ignoring", key, value);
		return (EPKG_OK);
	}
-
	am = NULL;
-
	pkg_abstract_new(&am);
+
	an = NULL;
+
	pkg_annotation_new(&an);

-
	sbuf_set(&am->key, key);
-
	sbuf_set(&am->value, value);
+
	sbuf_set(&an->key, key);
+
	sbuf_set(&an->value, value);

-
	HASH_ADD_KEYPTR(hh, pkg->abstract_metadata,
-
	    __DECONST(char *, pkg_abstract_key(am)),
-
	    strlen(pkg_abstract_key(am)), am);
+
	HASH_ADD_KEYPTR(hh, pkg->annotations,
+
	    __DECONST(char *, pkg_annotation_key(an)),
+
	    strlen(pkg_annotation_key(an)), an);

	return (EPKG_OK);
}
@@ -957,8 +957,8 @@ pkg_list_count(struct pkg *pkg, pkg_list list)
		return (HASH_COUNT(pkg->shlibs_required));
	case PKG_SHLIBS_PROVIDED:
		return (HASH_COUNT(pkg->shlibs_provided));
-
	case PKG_ABSTRACT_METADATA:
-
		return (HASH_COUNT(pkg->abstract_metadata));
+
	case PKG_ANNOTATIONS:
+
		return (HASH_COUNT(pkg->annotations));
	}
	
	return (0);
@@ -1011,10 +1011,9 @@ pkg_list_free(struct pkg *pkg, pkg_list list) {
		HASH_FREE(pkg->shlibs_provided, pkg_shlib, pkg_shlib_free);
		pkg->flags &= ~PKG_LOAD_SHLIBS_PROVIDED;
		break;
-
	case PKG_ABSTRACT_METADATA:
-
		HASH_FREE(pkg->abstract_metadata, pkg_abstract,
-
		    pkg_abstract_free);
-
		pkg->flags &= ~PKG_LOAD_ABSTRACT_METADATA;
+
	case PKG_ANNOTATIONS:
+
		HASH_FREE(pkg->annotations, pkg_note, pkg_annotation_free);
+
		pkg->flags &= ~PKG_LOAD_ANNOTATIONS;
		break;
	}
}
modified libpkg/pkg.h.in
@@ -66,7 +66,7 @@ struct pkg_license;
struct pkg_user;
struct pkg_group;
struct pkg_shlib;
-
struct pkg_abstract;
+
struct pkg_note;

struct pkgdb;
struct pkgdb_it;
@@ -267,7 +267,7 @@ typedef enum {
	PKG_GROUPS,
	PKG_SHLIBS_REQUIRED,
	PKG_SHLIBS_PROVIDED,
-
	PKG_ABSTRACT_METADATA,
+
	PKG_ANNOTATIONS,
} pkg_list;

/**
@@ -588,11 +588,11 @@ int pkg_shlibs_required(struct pkg *pkg, struct pkg_shlib **shlib);
int pkg_shlibs_provided(struct pkg *pkg, struct pkg_shlib **shlib);

/**
-
 * Iterates over the abstract metatdata associated with the package.
-
 * @param abstract must be set to NULL for the first call.
+
 * Iterates over the annotations associated with the package.
+
 * @param note must be set to NULL for the first call.
 * @return An error code
 */
-
int pkg_abstract_metadata(struct pkg *pkg, struct pkg_abstract **abstract);
+
int pkg_annotations(struct pkg *pkg, struct pkg_note **note);

/**
 * Iterate over all of the files within the package pkg, ensuring the
@@ -761,11 +761,11 @@ int pkg_addshlib_required(struct pkg *pkg, const char *name);
 */
int pkg_addshlib_provided(struct pkg *pkg, const char *name);

-
/*
-
 * Add abstract_metatdata key+value pair
+
/**
+
 * Add annotation key+value pair
 * @return An error code
 */
-
int pkg_addabstract_metadata(struct pkg *pkg, const char *key, const char *value);
+
int pkg_addannotation(struct pkg *pkg, const char *key, const char *value);

/**
 * Parse a manifest and set the attributes of pkg accordingly.
@@ -836,9 +836,9 @@ const char *pkg_option_value(struct pkg_option const * const);
/* pkg_shlib */
const char *pkg_shlib_name(struct pkg_shlib const * const);

-
/* pkg_abstract */
-
const char *pkg_abstract_key(struct pkg_abstract const * const);
-
const char *pkg_abstract_value(struct pkg_abstract const * const);
+
/* pkg_note */
+
const char *pkg_annotation_key(struct pkg_note const * const);
+
const char *pkg_annotation_value(struct pkg_note const * const);

/**
 * @param db A pointer to a struct pkgdb object
@@ -971,7 +971,7 @@ struct pkgdb_it * pkgdb_query_shlib_provided(struct pkgdb *db, const char *shlib
#define PKG_LOAD_GROUPS			(1U << 10)
#define PKG_LOAD_SHLIBS_REQUIRED	(1U << 11)
#define PKG_LOAD_SHLIBS_PROVIDED	(1U << 12)
-
#define PKG_LOAD_ABSTRACT_METADATA      (1U << 13)
+
#define PKG_LOAD_ANNOTATIONS		(1U << 13)
/* Make sure new PKG_LOAD don't conflict with PKG_CONTAINS_* */

/**
modified libpkg/pkg_attributes.c
@@ -416,41 +416,41 @@ pkg_shlib_name(struct pkg_shlib const * const sl)
}

/*
-
 * Abstract Metadata
+
 * Annotations
 */

int
-
pkg_abstract_new(struct pkg_abstract **am)
+
pkg_annotation_new(struct pkg_note **an)
{
-
	if ((*am = calloc(1, sizeof(struct pkg_abstract))) == NULL)
+
	if ((*an = calloc(1, sizeof(struct pkg_note))) == NULL)
		return (EPKG_FATAL);

	return (EPKG_OK);
}

void
-
pkg_abstract_free(struct pkg_abstract *am)
+
pkg_annotation_free(struct pkg_note *an)
{
-
	if (am == NULL)
+
	if (an == NULL)
		return;

-
	sbuf_free(am->key);
-
	sbuf_free(am->value);
-
	free(am);
+
	sbuf_free(an->key);
+
	sbuf_free(an->value);
+
	free(an);
}

const char *
-
pkg_abstract_key(struct pkg_abstract const * const am)
+
pkg_annotation_key(struct pkg_note const * const an)
{
-
	assert(am != NULL);
+
	assert(an != NULL);

-
	return (sbuf_get(am->key));
+
	return (sbuf_get(an->key));
}

const char *
-
pkg_abstract_value(struct pkg_abstract const * const am)
+
pkg_annotation_value(struct pkg_note const * const an)
{
-
	assert(am != NULL);
+
	assert(an != NULL);

-
	return (sbuf_get(am->value));
+
	return (sbuf_get(an->value));
}
modified libpkg/pkg_manifest.c
@@ -58,7 +58,7 @@
#define PKG_DIRECTORIES -11
#define PKG_SHLIBS_REQUIRED -12
#define PKG_SHLIBS_PROVIDED -13
-
#define PKG_ABSTRACT_METADATA -14
+
#define PKG_ANNOTATIONS -14

static int pkg_set_from_node(struct pkg *, yaml_node_t *, yaml_document_t *, int);
static int pkg_set_size_from_node(struct pkg *, yaml_node_t *, yaml_document_t *, int);
@@ -78,7 +78,7 @@ static struct manifest_key {
	yaml_node_type_t valid_type;
	int (*parse_data)(struct pkg *, yaml_node_t *, yaml_document_t *, int);
} manifest_keys[] = {
-
	{ "abstract_metadata", PKG_ABSTRACT_METADATA, YAML_MAPPING_NODE, parse_mapping},
+
	{ "annotations", PKG_ANNOTATIONS, YAML_MAPPING_NODE, parse_mapping},
	{ "arch", PKG_ARCH, YAML_SCALAR_NODE, pkg_set_from_node},
	{ "categories", PKG_CATEGORIES, YAML_SEQUENCE_NODE, parse_sequence},
	{ "comment", PKG_COMMENT, YAML_SCALAR_NODE, pkg_set_from_node},
@@ -445,12 +445,12 @@ parse_mapping(struct pkg *pkg, yaml_node_t *item, yaml_document_t *doc, int attr
			urldecode(val->data.scalar.value, &tmp);
			pkg_addscript(pkg, sbuf_get(tmp), script_type);
			break;
-
		case PKG_ABSTRACT_METADATA:
+
		case PKG_ANNOTATIONS:
			if (val->type != YAML_SCALAR_NODE)
-
				pkg_emit_error("Skipping malformed abstract metadata %s",
+
				pkg_emit_error("Skipping malformed annotation %s",
				    key->data.scalar.value);
			else
-
				pkg_addabstract_metadata(pkg, key->data.scalar.value,
+
				pkg_addannotation(pkg, key->data.scalar.value,
				    val->data.scalar.value);
			break;
		}
@@ -858,17 +858,17 @@ emit_manifest(struct pkg *pkg, yaml_emitter_t *emitter, bool compact)
{
	yaml_document_t doc;
	char tmpbuf[BUFSIZ];
-
	struct pkg_dep *dep = NULL;
-
	struct pkg_option *option = NULL;
-
	struct pkg_file *file = NULL;
-
	struct pkg_dir *dir = NULL;
-
	struct pkg_category *category = NULL;
-
	struct pkg_license *license = NULL;
-
	struct pkg_user *user = NULL;
-
	struct pkg_group *group = NULL;
-
	struct pkg_shlib *shlib = NULL;
-
	struct pkg_abstract *abstract = NULL;
-
	struct sbuf *tmpsbuf = NULL;
+
	struct pkg_dep		*dep      = NULL;
+
	struct pkg_option	*option   = NULL;
+
	struct pkg_file		*file     = NULL;
+
	struct pkg_dir		*dir      = NULL;
+
	struct pkg_category	*category = NULL;
+
	struct pkg_license	*license  = NULL;
+
	struct pkg_user		*user     = NULL;
+
	struct pkg_group	*group    = NULL;
+
	struct pkg_shlib	*shlib    = NULL;
+
	struct pkg_note		*note     = NULL;
+
	struct sbuf		*tmpsbuf  = NULL;
	int rc = EPKG_OK;
	int mapping;
	int seq = -1;
@@ -984,11 +984,11 @@ emit_manifest(struct pkg *pkg, yaml_emitter_t *emitter, bool compact)
		    pkg_option_value(option), PLAIN);
	}
	map = -1;
-
	while (pkg_abstract_metadata(pkg, &abstract) == EPKG_OK) {
+
	while (pkg_annotations(pkg, &note) == EPKG_OK) {
		if (map == -1)
-
			manifest_append_map(map, mapping, "abstract_metadata", FLOW);
-
		manifest_append_kv(map, pkg_abstract_key(abstract),
-
		    pkg_abstract_value(abstract), PLAIN);
+
			manifest_append_map(map, mapping, "annotations", FLOW);
+
		manifest_append_kv(map, pkg_annotation_key(note),
+
		    pkg_annotation_value(note), PLAIN);
	}

	if (!compact) {
modified libpkg/pkgdb.c
@@ -637,16 +637,16 @@ pkgdb_init(sqlite3 *sdb)
			" ON DELETE RESTRICT ON UPDATE RESTRICT,"
		"UNIQUE (package_id, shlib_id)"
	");"
-
	"CREATE TABLE abstract ("
-
                "abstract_id INTEGER PRIMARY KEY,"
-
                "abstract TEXT NOT NULL UNIQUE"
+
	"CREATE TABLE annotation ("
+
                "annotation_id INTEGER PRIMARY KEY,"
+
                "annotation TEXT NOT NULL UNIQUE"
        ");"
-
        "CREATE TABLE pkg_abstract ("
+
        "CREATE TABLE pkg_annotation ("
                "package_id INTERGER REFERENCES packages(id)"
                      " ON DELETE CASCADE ON UPDATE RESTRICT,"
-
                "key_id INTEGER NOT NULL REFERENCES abstract(abstract_id)"
+
                "key_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
                      " ON DELETE CASCADE ON UPDATE RESTRICT,"
-
		"value_id INTEGER NOT NULL REFERENCES abstract(abstract_id)"
+
		"value_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
		      " ON DELETE CASCADE ON UPDATE RESTRICT,"
		"UNIQUE (package_id, key_id, value_id)"
	");"
@@ -666,7 +666,7 @@ pkgdb_init(sqlite3 *sdb)
	"CREATE INDEX pkg_shlibs_required_package_id ON pkg_shlibs_required (package_id);"
	"CREATE INDEX pkg_shlibs_provided_package_id ON pkg_shlibs_provided (package_id);"
	"CREATE INDEX pkg_directories_directory_id ON pkg_directories (directory_id);"
-
	"CREATE INDEX pkg_abstract_package_id ON pkg_abstract(package_id);"
+
	"CREATE INDEX pkg_annotation_package_id ON pkg_annotation(package_id);"
	"CREATE INDEX pkg_digest_id ON packages(origin, manifestdigest);"

	"PRAGMA user_version = %d;"
@@ -1290,7 +1290,7 @@ static struct load_on_flag {
	{ PKG_LOAD_GROUPS,		pkgdb_load_group },
	{ PKG_LOAD_SHLIBS_REQUIRED,	pkgdb_load_shlib_required },
	{ PKG_LOAD_SHLIBS_PROVIDED,	pkgdb_load_shlib_provided },
-
	{ PKG_LOAD_ABSTRACT_METADATA,   pkgdb_load_abstract_metadata },
+
	{ PKG_LOAD_ANNOTATIONS,		pkgdb_load_annotations },
	{ -1,			        NULL }
};

@@ -1962,15 +1962,15 @@ pkgdb_load_shlib_provided(struct pkgdb *db, struct pkg *pkg)
}

int
-
pkgdb_load_abstract_metadata(struct pkgdb *db, struct pkg *pkg)
+
pkgdb_load_annotations(struct pkgdb *db, struct pkg *pkg)
{
	char		 sql[BUFSIZ];
	const char	*reponame = NULL;
	const char	*basesql = ""
-
		"SELECT k.abstract AS key, v.abstract AS value"
-
		"  FROM %Q.pkg_abstract p"
-
		"    JOIN %Q.abstract k ON (p.key_id = k.abstract_id)"
-
		"    JOIN %Q.abstract v ON (p.key_id = v.abstract_id)"
+
		"SELECT k.annotation AS key, v.annotation AS value"
+
		"  FROM %Q.pkg_annotation p"
+
		"    JOIN %Q.annotation k ON (p.key_id = k.annotation_id)"
+
		"    JOIN %Q.annotation v ON (p.key_id = v.annotation_id)"
		"  WHERE p.package_id = ?1"
		"  ORDER BY key, value";

@@ -1985,8 +1985,8 @@ pkgdb_load_abstract_metadata(struct pkgdb *db, struct pkg *pkg)
		sqlite3_snprintf(sizeof(sql), sql, basesql, "main",
                    "main", "main");

-
	return (load_key_val(db->sqlite, pkg, sql, PKG_LOAD_ABSTRACT_METADATA,
-
		   pkg_addabstract_metadata, PKG_ABSTRACT_METADATA));
+
	return (load_key_val(db->sqlite, pkg, sql, PKG_LOAD_ANNOTATIONS,
+
		   pkg_addannotation, PKG_ANNOTATIONS));
}

int
@@ -2091,8 +2091,8 @@ typedef enum _sql_prstmt_index {
	SHLIBS1,
	SHLIBS_REQD,
	SHLIBS_PROV,
-
	ABSTRACT1,
-
	ABSTRACT2,
+
	ANNOTATE1,
+
	ANNOTATE2,
	PRSTMT_LAST,
} sql_prstmt_index;

@@ -2220,18 +2220,18 @@ static sql_prstmt sql_prepared_statements[PRSTMT_LAST] = {
		"VALUES (?1, (SELECT id FROM shlibs WHERE name = ?2))",
		"IT",
	},
-
	[ABSTRACT1] = {
+
	[ANNOTATE1] = {
		NULL,
-
		"INSERT OR IGNORE INTO abstract(abstract) "
+
		"INSERT OR IGNORE INTO annotation(annotation) "
		"VALUES (?1)",
		"T",
	},
-
	[ABSTRACT2] = {
+
	[ANNOTATE2] = {
		NULL,
-
		"INSERT OR ROLLBACK INTO pkg_abstract(package_id, key_id, value_id) "
+
		"INSERT OR ROLLBACK INTO pkg_annotation(package_id, key_id, value_id) "
		"VALUES (?1,"
-
		" (SELECT abstract_id FROM abstract WHERE abstract=?2),"
-
		" (SELECT abstract_id FROM abstract WHERE abstract=?3))",
+
		" (SELECT annotation_id FROM annotation WHERE annotation=?2),"
+
		" (SELECT annotation_id FROM annotation WHERE annotation=?3))",
		"ITT",
	},
	/* PRSTMT_LAST */
@@ -2604,9 +2604,9 @@ pkgdb_register_pkg(struct pkgdb *db, struct pkg *pkg, int complete, int forced)
		goto cleanup;

	/*
-
	 * Insert abstract metadata
+
	 * Insert annotations
	 */
-
	if (pkgdb_insert_abstract_metadata(pkg, package_id, s) != EPKG_OK)
+
	if (pkgdb_insert_annotations(pkg, package_id, s) != EPKG_OK)
		goto cleanup;

	retcode = EPKG_OK;
@@ -2655,20 +2655,20 @@ pkgdb_update_shlibs_provided(struct pkg *pkg, int64_t package_id, sqlite3 *s)
}

int
-
pkgdb_insert_abstract_metadata(struct pkg *pkg, int64_t package_id, sqlite3 *s)
+
pkgdb_insert_annotations(struct pkg *pkg, int64_t package_id, sqlite3 *s)
{
-
	struct pkg_abstract	*abstract = NULL;
+
	struct pkg_note	*note = NULL;

-
	while (pkg_abstract_metadata(pkg, &abstract) == EPKG_OK) {
-
		if (run_prstmt(ABSTRACT1, pkg_abstract_key(abstract))
+
	while (pkg_annotations(pkg, &note) == EPKG_OK) {
+
		if (run_prstmt(ANNOTATE1, pkg_annotation_key(note))
		    != SQLITE_DONE
		    ||
-
		    run_prstmt(ABSTRACT1, pkg_abstract_value(abstract))
+
		    run_prstmt(ANNOTATE1, pkg_annotation_value(note))
		    != SQLITE_DONE
		    ||
-
		    run_prstmt(ABSTRACT2, package_id,
-
			pkg_abstract_key(abstract),
-
			pkg_abstract_value(abstract))
+
		    run_prstmt(ANNOTATE2, package_id,
+
			pkg_annotation_key(note),
+
			pkg_annotation_value(note))
		    != SQLITE_DONE) {
			ERROR_SQLITE(s);
			return (EPKG_FATAL);
modified libpkg/pkgdb_repo.c
@@ -75,8 +75,8 @@ typedef enum _sql_prstmt_index {
	SHLIB1,
	SHLIB_REQD,
	SHLIB_PROV,
-
	ABSTRACT1,
-
	ABSTRACT2,
+
	ANNOTATE1,
+
	ANNOTATE2,
	EXISTS,
	VERSION,
	DELETE,
@@ -149,18 +149,18 @@ static sql_prstmt sql_prepared_statements[PRSTMT_LAST] = {
		"SELECT count(*) FROM packages WHERE cksum=?1",
		"T",
	},
-
	[ABSTRACT1] = {
+
	[ANNOTATE1] = {
		NULL,
-
		"INSERT OR IGNORE INTO abstract(abstract) "
+
		"INSERT OR IGNORE INTO annotation(annotation) "
		"VALUES (?1)",
		"T",
	},
-
	[ABSTRACT2] = {
+
	[ANNOTATE2] = {
		NULL,
-
		"INSERT OR ROLLBACK INTO pkg_abstract(package_id, key_id, value_id) "
+
		"INSERT OR ROLLBACK INTO pkg_annotate(package_id, key_id, value_id) "
		"VALUES (?1,"
-
		" (SELECT abstract_id FROM abstract WHERE abstract=?2),"
-
		" (SELECT abstract_id FROM abstract WHERE abstract=?3))",
+
		" (SELECT annotation_id FROM annotation WHERE annotation=?2),"
+
		" (SELECT annotation_id FROM annotation WHERE annotation=?3))",
		"ITT",
	},
	[VERSION] = {
@@ -464,12 +464,12 @@ pkgdb_repo_add_package(struct pkg *pkg, const char *pkg_path,
	int64_t			 flatsize, pkgsize;
	lic_t			 licenselogic;
	int			 ret;
-
	struct pkg_dep		*dep = NULL;
+
	struct pkg_dep		*dep      = NULL;
	struct pkg_category	*category = NULL;
-
	struct pkg_license	*license = NULL;
-
	struct pkg_option	*option = NULL;
-
	struct pkg_shlib	*shlib = NULL;
-
	struct pkg_abstract	*abstract = NULL;
+
	struct pkg_license	*license  = NULL;
+
	struct pkg_option	*option   = NULL;
+
	struct pkg_shlib	*shlib    = NULL;
+
	struct pkg_note		*note     = NULL;
	int64_t			 package_id;

	pkg_get(pkg, PKG_ORIGIN, &origin, PKG_NAME, &name,
@@ -585,17 +585,17 @@ try_again:
		}
	}

-
	abstract = NULL;
-
	while (pkg_abstract_metadata(pkg, &abstract) == EPKG_OK) {
-
		const char *abstract_key = pkg_abstract_key(abstract);
-
		const char *abstract_val = pkg_abstract_value(abstract);
+
	note = NULL;
+
	while (pkg_annotations(pkg, &note) == EPKG_OK) {
+
		const char *note_key = pkg_annotation_key(note);
+
		const char *note_val = pkg_annotation_value(note);

-
		ret = run_prepared_statement(ABSTRACT1, abstract_key);
+
		ret = run_prepared_statement(ANNOTATE1, note_key);
		if (ret == SQLITE_DONE) 
-
			ret = run_prepared_statement(ABSTRACT1, abstract_val);
+
			ret = run_prepared_statement(ANNOTATE1, note_val);
		if (ret == SQLITE_DONE)
-
			ret = run_prepared_statement(ABSTRACT2, package_id,
-
				  abstract_key, abstract_val);
+
			ret = run_prepared_statement(ANNOTATE2, package_id,
+
				  note_key, note_val);
		if (ret != SQLITE_DONE) {
			ERROR_SQLITE(sqlite);
			return (EPKG_FATAL);
modified libpkg/private/db_upgrades.h
@@ -306,6 +306,28 @@ static struct db_upgrades {
	"ALTER TABLE packages ADD COLUMN manifestdigest TEXT NULL;"
	"CREATE INDEX IF NOT EXISTS pkg_digest_id ON packages(origin, manifestdigest);"
	},
+
	{17,
+
	"CREATE TABLE annotation ("
+
                "annotation_id INTEGER PRIMARY KEY,"
+
                "annotation TEXT NOT NULL UNIQUE"
+
        ");"
+
        "CREATE TABLE pkg_annotation ("
+
                "package_id INTERGER REFERENCES packages(id)"
+
                      " ON DELETE CASCADE ON UPDATE RESTRICT,"
+
                "key_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
+
                      " ON DELETE CASCADE ON UPDATE RESTRICT,"
+
		"value_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
+
		      " ON DELETE CASCADE ON UPDATE RESTRICT"
+
	");"
+
	"CREATE INDEX pkg_annotation_package_id ON pkg_annotation(package_id);"
+
	"INSERT INTO annotation (annotation_id, annotation)"
+
	        "SELECT abstract_id, abstract FROM abstract;"
+
	"INSERT INTO pkg_annotation (package_id,key_id,value_id)"
+
	        "SELECT package_id,key_id,value_id FROM pkg_abstract;"
+
	"DROP INDEX pkg_abstract_package_id;"
+
	"DROP TABLE pkg_abstract;"
+
	"DROP TABLE abstract;"
+
	},

	/* Mark the end of the array */
	{ -1, NULL }
modified libpkg/private/pkg.h
@@ -105,18 +105,18 @@ struct pkg {
	int64_t		 new_flatsize;
	int64_t		 new_pkgsize;
	struct sbuf	*scripts[PKG_NUM_SCRIPTS];
-
	struct pkg_license *licenses;
-
	struct pkg_category *categories;
-
	struct pkg_dep *deps;
-
	struct pkg_dep *rdeps;
-
	struct pkg_file *files;
-
	struct pkg_dir *dirs;
-
	struct pkg_option *options;
-
	struct pkg_user *users;
-
	struct pkg_group *groups;
-
	struct pkg_shlib *shlibs_required;
-
	struct pkg_shlib *shlibs_provided;
-
	struct pkg_abstract *abstract_metadata;
+
	struct pkg_license	*licenses;
+
	struct pkg_category	*categories;
+
	struct pkg_dep		*deps;
+
	struct pkg_dep		*rdeps;
+
	struct pkg_file		*files;
+
	struct pkg_dir		*dirs;
+
	struct pkg_option	*options;
+
	struct pkg_user		*users;
+
	struct pkg_group	*groups;
+
	struct pkg_shlib	*shlibs_required;
+
	struct pkg_shlib	*shlibs_provided;
+
	struct pkg_note		*annotations;
	unsigned       	 flags;
	int64_t		 rowid;
	int64_t		 time;
@@ -243,7 +243,7 @@ struct pkg_config_value {
	UT_hash_handle hh;
};

-
struct pkg_abstract {
+
struct pkg_note {
	struct sbuf	*key;
	struct sbuf	*value;
	UT_hash_handle	 hh;
@@ -338,8 +338,8 @@ int pkg_jobs_resolv(struct pkg_jobs *jobs);
int pkg_shlib_new(struct pkg_shlib **);
void pkg_shlib_free(struct pkg_shlib *);

-
int pkg_abstract_new(struct pkg_abstract **);
-
void pkg_abstract_free(struct pkg_abstract *);
+
int pkg_annotation_new(struct pkg_note **);
+
void pkg_annotation_free(struct pkg_note *);

struct packing;

@@ -389,12 +389,12 @@ int pkgdb_load_user(struct pkgdb *db, struct pkg *pkg);
int pkgdb_load_group(struct pkgdb *db, struct pkg *pkg);
int pkgdb_load_shlib_required(struct pkgdb *db, struct pkg *pkg);
int pkgdb_load_shlib_provided(struct pkgdb *db, struct pkg *pkg);
-
int pkgdb_load_abstract_metadata(struct pkgdb *db, struct pkg *pkg);
+
int pkgdb_load_annotations(struct pkgdb *db, struct pkg *pkg);

int pkgdb_register_pkg(struct pkgdb *db, struct pkg *pkg, int complete, int forced);
int pkgdb_update_shlibs_required(struct pkg *pkg, int64_t package_id, sqlite3 *s);
int pkgdb_update_shlibs_provided(struct pkg *pkg, int64_t package_id, sqlite3 *s);
-
int pkgdb_insert_abstract_metadata(struct pkg *pkg, int64_t package_id, sqlite3 *s);
+
int pkgdb_insert_annotations(struct pkg *pkg, int64_t package_id, sqlite3 *s);
int pkgdb_register_finale(struct pkgdb *db, int retcode);

int pkg_register_shlibs(struct pkg *pkg);
modified libpkg/private/repodb.h
@@ -115,16 +115,16 @@ static const char initsql[] = ""
	    "  ON DELETE RESTRICT ON UPDATE RESTRICT,"
	    "UNIQUE(package_id, shlib_id)"
	");"
-
	"CREATE TABLE abstract ("
-
	    "abstract_id INTEGER PRIMARY KEY,"
-
	    "abstract TEXT NOT NULL UNIQUE"
+
	"CREATE TABLE annotation ("
+
	    "annotation_id INTEGER PRIMARY KEY,"
+
	    "annotation TEXT NOT NULL UNIQUE"
	");"
-
	"CREATE TABLE pkg_abstract ("
+
	"CREATE TABLE pkg_annotation ("
	    "package_id INTERGER REFERENCES packages(id)"
	    " ON DELETE CASCADE ON UPDATE RESTRICT,"
-
	    "key_id INTEGER NOT NULL REFERENCES abstract(abstract_id)"
+
	    "key_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
	    " ON DELETE CASCADE ON UPDATE RESTRICT,"
-
	    "value_id INTEGER NOT NULL REFERENCES abstract(abstract_id)"
+
	    "value_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
	    " ON DELETE CASCADE ON UPDATE RESTRICT,"
	    "UNIQUE (package_id, key_id, value_id)"
	");"
@@ -184,7 +184,28 @@ static const struct repo_changes repo_upgrades[] = {
	"ALTER TABLE %Q.packages ADD COLUMN manifestdigest TEXT NULL;"
	"CREATE INDEX IF NOT EXISTS %Q.pkg_digest_id ON packages(origin, manifestdigest);"
	},
-

+
	{2004,
+
	 2005,
+
	 "Rename 'abstract metadata' to 'annotations'",
+
	 "CREATE TABLE %Q.annotation ("
+
	        "annotation_id INTEGER PRIMARY KEY,"
+
	        "annotation TEXT NOT NULL UNIQUE"
+
	 ");"
+
	 "CREATE TABLE %Q.pkg_annotation ("
+
	        "package_id INTEGER REFERENCES packages(id)"
+
	        " ON DELETE CASCADE ON UPDATE RESTRICT,"
+
	        "key_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
+
	        " ON DELETE CASCADE ON UPDATE RESTRICT,"
+
	        "value_id INTEGER NOT NULL REFERENCES annotation(annotation_id)"
+
	        " ON DELETE CASCADE ON UPDATE RESTRICT"
+
	 ");"
+
	 "INSERT INTO %Q.annotation (annotation_id, annotation)"
+
	        " SELECT abstract_id, abstract FROM %Q.abstract;"
+
	 "INSERT INTO %Q.pkg_annotation (package_id,key_id,value_id)"
+
	        " SELECT package_id,key_id,value_id FROM %Q.pkg_abstract;"
+
	 "DROP TABLE pkg_abstract;"
+
	 "DROP TABLE abstract;"
+
	},
	/* Mark the end of the array */
	{ -1, -1, NULL, NULL, }

@@ -193,6 +214,29 @@ static const struct repo_changes repo_upgrades[] = {
/* How to downgrade a newer repo to match what the current system
   expects */
static const struct repo_changes repo_downgrades[] = {
+
	{2005,
+
	 2004,
+
	 "Revert rename of 'abstract metadata' to 'annotations'",
+

+
	 "CREATE TABLE %Q.abstract ("
+
	        "abstract_id INTEGER PRIMARY KEY,"
+
	        "abstract TEXT NOT NULL UNIQUE"
+
	 ");"
+
	 "CREATE TABLE %Q.pkg_abstract ("
+
	        "package_id INTEGER REFERENCES packages(id)"
+
	        " ON DELETE CASCADE ON UPDATE RESTRICT,"
+
	        "key_id INTEGER NOT NULL REFERENCES abstract(abstract_id)"
+
	        " ON DELETE CASCADE ON UPDATE RESTRICT,"
+
	        "value_id INTEGER NOT NULL REFERENCES abstract(abstract_id)"
+
	        " ON DELETE CASCADE ON UPDATE RESTRICT"
+
	 ");"
+
	 "INSERT INTO %Q.abstract (abstract_id, abstract)"
+
	        " SELECT annotation_id, annotation FROM %Q.annotation;"
+
	 "INSERT INTO %Q.pkg_abstract (package_id,key_id,value_id)"
+
	        " SELECT package_id,key_id,value_id FROM %Q.pkg_annotation;"
+
	 "DROP TABLE pkg_annotation;"
+
	 "DROP TABLE annotation;"
+
	},
	{2004,
	 2003,
	 "Drop manifest digest index",
modified pkg/info.c
@@ -89,7 +89,7 @@ exec_info(int argc, char **argv)
			match = MATCH_ALL;
			break;
		case 'A':
-
			opt |= INFO_ABSTRACT_METADATA;
+
			opt |= INFO_ANNOTATIONS;
			break;
		case 'O':
			origin_search = true;  /* only for ports compat */
modified pkg/pkg-info.8
@@ -42,7 +42,7 @@ The following options are supported by
.It Fl a
Display all installed packages.
.It Fl A
-
Display any abstract metadata added to the package.
+
Display any annotations added to the package.
.It Fl f
Display full information about the packages matching
.Ar <pkg-name> .
modified pkg/pkg-query.8
@@ -132,7 +132,7 @@ for required shared libraries
.It Cm b
for provided shared libraries
.It Cm A
-
for abstract metadata
+
for annotations
.El
.It Cm \&%# Ns Op drCFODLUGBbA
Returns the number of element in the list
@@ -162,7 +162,7 @@ for required shared libraries
.It Cm b
for provided shared libraries
.It Cm A
-
for abstract metadata
+
for annotations
.El
.El
.Ss Multiline patterns:
@@ -210,12 +210,12 @@ Expands to the list of shared libraries used by programs from the matched packag
.It Cm \&%b
Expands to the list of shared libraries provided by the matched package.
.It Cm \&A Ns Op kv
-
Expands to the list of abstract metadata items for the matched package,
+
Expands to the list of annotations for the matched package,
where
.Cm k
-
stands for the item key, and
+
stands for the annotation key, and
.Cm v
-
stands for the item value.
+
stands for the annotation value.
.El
.Sh EVALUATION FORMAT
Packages can be selected by using expressions comparing
modified pkg/pkg-rquery.8
@@ -123,7 +123,7 @@ for required shared libraries
.It Cm b
for provided shared libraries
.It Cm A
-
for abstract metadata
+
for annotations
.It Cm \&%# Ns Op drCOLBbA
Returns the number of elements in the list
.Bl -tag -width indent
@@ -142,7 +142,7 @@ for required shared libraries
.It Cm b
for provided shared libraries
.It Cm A
-
for abstract metadata
+
for annotations
.El
.El
.El
@@ -179,12 +179,12 @@ Expands to the list of shared libraries used by programs from the matched packag
.It Cm \&%b
Expands to the list of shared libraries provided by the matched package.
.It Cm \&%A Ns Op kv
-
Expands to the list of abstract metadata items associated with the matched
+
Expands to the list of annotations associated with the matched
package, where
.Cm k
-
stands for the item key, and
+
stands for the annotation key, and
.Cm v
-
stands for the item value.
+
stands for the annotation value.
.El
.Sh EVALUATION FORMAT
.Ss Variables
modified pkg/pkg-search.8
@@ -233,8 +233,8 @@ or
.Fl "L description"
options, then each output field will be tagged with the field name.
.Bl -tag -width 2n
-
.It Sy abstract-metadata
-
Freeform arbitrary text in key-value format that can be incorporated in
+
.It Sy annotations
+
Freeform arbitrary text in key-value format that can be added to
any package. 
.It Sy arch
The architecture string indicating what OS version and CPU architecture
@@ -287,7 +287,7 @@ Show a standard set of fields, equivalent to a combination of the
.Sy options ,
.Sy shared-libs-required ,
.Sy shared-libs-provided ,
-
.Sy abstract-metadata ,
+
.Sy annotations ,
.Sy size ,
.Sy pkg-size
and
modified pkg/pkgcli.h
@@ -182,7 +182,7 @@ void usage_ssh(void);
#define INFO_OPTIONS		(1<<10)
#define INFO_SHLIBS_REQUIRED	(1<<11)
#define INFO_SHLIBS_PROVIDED	(1<<12)
-
#define INFO_ABSTRACT_METADATA	(1<<13)
+
#define INFO_ANNOTATIONS	(1<<13)
#define INFO_FLATSIZE		(1<<14)
#define INFO_PKGSIZE		(1<<15)
#define INFO_DESCR		(1<<16)
@@ -215,12 +215,12 @@ void usage_ssh(void);
			 INFO_REPOSITORY|INFO_CATEGORIES|INFO_LICENSES|	 \
			 INFO_MAINTAINER|INFO_WWW|INFO_COMMENT|		 \
			 INFO_OPTIONS|INFO_SHLIBS_REQUIRED|		 \
-
			 INFO_SHLIBS_PROVIDED|INFO_ABSTRACT_METADATA|    \
+
			 INFO_SHLIBS_PROVIDED|INFO_ANNOTATIONS|		 \
			 INFO_FLATSIZE|INFO_PKGSIZE|INFO_DESCR)

/* Everything that can take more than one line to print */
#define INFO_MULTILINE	(INFO_OPTIONS|INFO_SHLIBS_REQUIRED|	       \
-
			 INFO_SHLIBS_PROVIDED|INFO_ABSTRACT_METADATA|  \
+
			 INFO_SHLIBS_PROVIDED|INFO_ANNOTATIONS|	       \
			 INFO_DESCR|INFO_MESSAGE|INFO_DEPS|INFO_RDEPS| \
			 INFO_FILES|INFO_DIRS)

modified pkg/query.c
@@ -54,7 +54,7 @@ static struct query_flags accepted_query_flags[] = {
	{ 'G', "",		1, PKG_LOAD_GROUPS },
	{ 'B', "",		1, PKG_LOAD_SHLIBS_REQUIRED },
	{ 'b', "",		1, PKG_LOAD_SHLIBS_PROVIDED },
-
	{ 'A', "kv",            1, PKG_LOAD_ABSTRACT_METADATA },
+
	{ 'A', "kv",            1, PKG_LOAD_ANNOTATIONS },
	{ '?', "drCFODLUGBbA",	1, PKG_LOAD_BASIC },	/* dbflags handled in analyse_query_string() */
	{ '#', "drCFODLUGBbA",	1, PKG_LOAD_BASIC },	/* dbflags handled in analyse_query_string() */
	{ 's', "hb",		0, PKG_LOAD_BASIC },
@@ -200,7 +200,7 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
					sbuf_printf(dest, "%d", pkg_list_count(pkg, PKG_SHLIBS_PROVIDED) > 0);
					break;
				case 'A':
-
					sbuf_printf(dest, "%d", pkg_list_count(pkg, PKG_ABSTRACT_METADATA) > 0);
+
					sbuf_printf(dest, "%d", pkg_list_count(pkg, PKG_ANNOTATIONS) > 0);
					break;
				}
				break;
@@ -241,7 +241,7 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
					sbuf_printf(dest, "%d", pkg_list_count(pkg, PKG_SHLIBS_PROVIDED));
					break;
				case 'A':
-
					sbuf_printf(dest, "%d", pkg_list_count(pkg, PKG_ABSTRACT_METADATA));
+
					sbuf_printf(dest, "%d", pkg_list_count(pkg, PKG_ANNOTATIONS));
					break;
				}
				break;
@@ -313,9 +313,9 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
			case 'A':
				qstr++;
				if (qstr[0] == 'k')
-
					sbuf_cat(dest, pkg_abstract_key((struct pkg_abstract *)data));
+
					sbuf_cat(dest, pkg_annotation_key((struct pkg_note *)data));
				else if (qstr[0] == 'v')
-
					sbuf_cat(dest, pkg_abstract_value((struct pkg_abstract *)data));
+
					sbuf_cat(dest, pkg_annotation_value((struct pkg_note *)data));
				break;
			case 'M':
				pkg_get(pkg, PKG_MESSAGE, &tmp);
@@ -362,17 +362,17 @@ format_str(struct pkg *pkg, struct sbuf *dest, const char *qstr, void *data)
void
print_query(struct pkg *pkg, char *qstr, char multiline)
{
-
	struct sbuf *output = sbuf_new_auto();
-
	struct pkg_dep *dep = NULL;
-
	struct pkg_category *cat = NULL;
-
	struct pkg_option *option = NULL;
-
	struct pkg_file *file = NULL;
-
	struct pkg_dir *dir = NULL;
-
	struct pkg_license *lic = NULL;
-
	struct pkg_user *user = NULL;
-
	struct pkg_group *group = NULL;
-
	struct pkg_shlib *shlib = NULL;
-
	struct pkg_abstract *abstract = NULL;
+
	struct sbuf		*output = sbuf_new_auto();
+
	struct pkg_dep		*dep    = NULL;
+
	struct pkg_category	*cat    = NULL;
+
	struct pkg_option	*option = NULL;
+
	struct pkg_file		*file   = NULL;
+
	struct pkg_dir		*dir    = NULL;
+
	struct pkg_license	*lic    = NULL;
+
	struct pkg_user		*user   = NULL;
+
	struct pkg_group	*group  = NULL;
+
	struct pkg_shlib	*shlib  = NULL;
+
	struct pkg_note		*note   = NULL;

	switch (multiline) {
	case 'd':
@@ -442,8 +442,8 @@ print_query(struct pkg *pkg, char *qstr, char multiline)
		}
		break;
	case 'A':
-
		while (pkg_abstract_metadata(pkg, &abstract) == EPKG_OK) {
-
			format_str(pkg, output, qstr, abstract);
+
		while (pkg_annotations(pkg, &note) == EPKG_OK) {
+
			format_str(pkg, output, qstr, note);
			printf("%s\n", sbuf_data(output));
		}
		break;
@@ -588,7 +588,7 @@ format_sql_condition(const char *str, struct sbuf *sqlcond, bool for_remote)
							sbuf_printf(sqlcond, "(SELECT COUNT(*) FROM %spkg_shlibs_provided AS d WHERE d.package_id=p.id)", dbstr);
							break;
						case 'A':
-
							sbuf_printf(sqlcond, "(SELECT COUNT(*) FROM %spkg_abstract AS d WHERE d.package_id=p.id)", dbstr);
+
							sbuf_printf(sqlcond, "(SELECT COUNT(*) FROM %spkg_annotation AS d WHERE d.package_id=p.id)", dbstr);
							break;
						default:
							goto bad_option;
modified pkg/rquery.c
@@ -50,7 +50,7 @@ static struct query_flags accepted_rquery_flags[] = {
	{ 'L', "",		1, PKG_LOAD_LICENSES },
	{ 'B', "",		1, PKG_LOAD_SHLIBS_REQUIRED },
	{ 'b', "",		1, PKG_LOAD_SHLIBS_PROVIDED },
-
	{ 'A', "kv",		1, PKG_LOAD_ABSTRACT_METADATA },
+
	{ 'A', "kv",		1, PKG_LOAD_ANNOTATIONS },
	{ '?', "drCOLBbA",	1, PKG_LOAD_BASIC },	/* dbflags handled in analyse_query_string() */
	{ '#', "drCOLBbA",	1, PKG_LOAD_BASIC },	/* dbflags handled in analyse_query_string() */
	{ 's', "hb",		0, PKG_LOAD_BASIC },
modified pkg/search.c
@@ -53,7 +53,7 @@ static const cliopt search_label[] = {
};

static const cliopt modifiers[] = {
-
	{ "abstract-metadata",    'A'  },
+
	{ "annotations",          'A'  },
	{ "arch",                 'a'  },
	{ "categories",           'C'  },
	{ "comment",              'c'  },
@@ -140,7 +140,7 @@ modifier_opt(const char *optionarg)
	/* output modifiers */
	switch(match_optarg(modifiers, optionarg)) {
	case 'A':
-
		opt = INFO_ABSTRACT_METADATA;
+
		opt = INFO_ANNOTATIONS;
		break;
	case 'a':
		opt = INFO_ARCH;
modified pkg/utils.c
@@ -183,8 +183,8 @@ info_flags(unsigned int opt)
		flags |= PKG_LOAD_SHLIBS_REQUIRED;
	if (opt & INFO_SHLIBS_PROVIDED)
		flags |= PKG_LOAD_SHLIBS_PROVIDED;
-
	if (opt & INFO_ABSTRACT_METADATA)
-
		flags |= PKG_LOAD_ABSTRACT_METADATA;
+
	if (opt & INFO_ANNOTATIONS)
+
		flags |= PKG_LOAD_ANNOTATIONS;
	if (opt & INFO_DEPS)
		flags |= PKG_LOAD_DEPS;
	if (opt & INFO_RDEPS)
@@ -198,17 +198,17 @@ info_flags(unsigned int opt)
	if (opt & INFO_GROUPS)
		flags |= PKG_LOAD_GROUPS;
	if (opt & INFO_RAW) {
-
		flags |= PKG_LOAD_CATEGORIES        |
-
			 PKG_LOAD_LICENSES          |
-
			 PKG_LOAD_OPTIONS           |
-
			 PKG_LOAD_SHLIBS_REQUIRED   |
-
			 PKG_LOAD_SHLIBS_PROVIDED   |
-
			 PKG_LOAD_ABSTRACT_METADATA |
-
			 PKG_LOAD_DEPS              |
-
			 PKG_LOAD_FILES             |
-
			 PKG_LOAD_DIRS              |
-
			 PKG_LOAD_USERS             |
-
			 PKG_LOAD_GROUPS            |
+
		flags |= PKG_LOAD_CATEGORIES      |
+
			 PKG_LOAD_LICENSES        |
+
			 PKG_LOAD_OPTIONS         |
+
			 PKG_LOAD_SHLIBS_REQUIRED |
+
			 PKG_LOAD_SHLIBS_PROVIDED |
+
			 PKG_LOAD_ANNOTATIONS     |
+
			 PKG_LOAD_DEPS            |
+
			 PKG_LOAD_FILES           |
+
			 PKG_LOAD_DIRS            |
+
			 PKG_LOAD_USERS           |
+
			 PKG_LOAD_GROUPS          |
			 PKG_LOAD_SCRIPTS;
	}

@@ -218,16 +218,16 @@ info_flags(unsigned int opt)
void
print_info(struct pkg * const pkg, unsigned int options)
{
-
	struct pkg_category *cat      = NULL;
-
	struct pkg_dep	    *dep      = NULL;
-
	struct pkg_dir	    *dir      = NULL;
-
	struct pkg_file	    *file     = NULL;
-
	struct pkg_group    *group    = NULL;
-
	struct pkg_license  *lic      = NULL;
-
	struct pkg_option   *option   = NULL;
-
	struct pkg_shlib    *shlib    = NULL;
-
	struct pkg_abstract *abstract = NULL;
-
	struct pkg_user	    *user     = NULL;
+
	struct pkg_category *cat    = NULL;
+
	struct pkg_dep	    *dep    = NULL;
+
	struct pkg_dir	    *dir    = NULL;
+
	struct pkg_file	    *file   = NULL;
+
	struct pkg_group    *group  = NULL;
+
	struct pkg_license  *lic    = NULL;
+
	struct pkg_option   *option = NULL;
+
	struct pkg_shlib    *shlib  = NULL;
+
	struct pkg_note	    *note   = NULL;
+
	struct pkg_user	    *user   = NULL;
	bool multirepos_enabled = false;
	bool print_tag = false;
	bool show_locks = false;
@@ -437,14 +437,14 @@ print_info(struct pkg * const pkg, unsigned int options)
					printf("%s%s\n", tab, pkg_shlib_name(shlib));
			}
			break;
-
		case INFO_ABSTRACT_METADATA:
-
			if (pkg_list_count(pkg, PKG_ABSTRACT_METADATA) > 0) {
+
		case INFO_ANNOTATIONS:
+
			if (pkg_list_count(pkg, PKG_ANNOTATIONS) > 0) {
				if (print_tag)
-
					printf("%-15s:\n", "Abstract Metadata");
-
				while (pkg_abstract_metadata(pkg, &abstract) == EPKG_OK)
+
					printf("%-15s:\n", "Annotations");
+
				while (pkg_annotations(pkg, &note) == EPKG_OK)
					printf("%s%-15s: %s\n", tab,
-
					       pkg_abstract_key(abstract),
-
					       pkg_abstract_value(abstract));
+
					       pkg_annotation_key(note),
+
					       pkg_annotation_value(note));
			}
			break;
		case INFO_FLATSIZE: