Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix up annotate --show --all. Fixes #1185.
Brad Davis committed 11 years ago
commit 877a71b5cbf510ef9aad609c8b996736db287117
parent 918c5a7
2 files changed +25 -3
modified src/annotate.c
@@ -143,8 +143,9 @@ static int
do_show(struct pkg *pkg, const char *tag)
{
	struct pkg_kv *note;
+
	int ret = EPKG_OK;

-
	pkg_get(pkg, PKG_ANNOTATIONS, &note);
+
	ret = pkg_get(pkg, PKG_ANNOTATIONS, &note);
	while (note != NULL) {
		if (strcmp(tag, note->key) == 0) {
			if (quiet)
@@ -157,7 +158,7 @@ do_show(struct pkg *pkg, const char *tag)
		note = note->next;
	}

-
	return (EPKG_FATAL);
+
	return (ret);
}


modified tests/frontend/annotate.shin
@@ -22,7 +22,7 @@ annotate_body() {
	[ -f "./local.sqlite" ] || \
	    atf_fail "Can't populate $PKG_DBDIR/local.sqlite"

-
        atf_check \
+
	atf_check \
	    -o match:"added annotation tagged: TEST1" \
	    -e empty \
	    -s exit:0 \
@@ -87,6 +87,27 @@ annotate_body() {
	    -s exit:0 \
	    -e empty \
	    pkg info -A png
+

+
	# Check multiple annotations
+
	atf_check \
+
	    -o match:"added annotation tagged: TEST1" \
+
	    -e empty \
+
	    -s exit:0 \
+
	    pkg annotate -Ay png TEST1 test1
+

+
	atf_check \
+
	    -o match:"added annotation tagged: TEST1" \
+
	    -e empty \
+
	    -s exit:0 \
+
	    pkg annotate -Ay sqlite3 TEST1 test1
+

+
	atf_check \
+
	    -o match:"^png-1.5.18: Tag: TEST1 Value: test1$" \
+
			-o match:"^sqlite3-3.8.6: Tag: TEST1 Value: test1$" \
+
	    -e empty \
+
	    -s exit:0 \
+
	    pkg annotate --all --show TEST1
+

}

atf_init_test_cases() {