From 4676c5d63ac70f4bf2c4e4c945a7fa65941676e9 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 24 Feb 2012 08:42:40 +0200 Subject: test: improve pinning tests --- src/apk.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/apk.c') diff --git a/src/apk.c b/src/apk.c index 254a932..752409f 100644 --- a/src/apk.c +++ b/src/apk.c @@ -462,13 +462,16 @@ int main(int argc, char **argv) } for (i = 0; i < test_repos->num; i++) { struct apk_bstream *bs; - char *fn = test_repos->item[i]; + apk_blob_t spec = APK_BLOB_STR(test_repos->item[i]), name, tag; int repo_tag = 0; - if (fn[0] == '+') { - repo_tag = apk_db_get_tag_id(&db, APK_BLOB_STR("testing")); - fn++; + + if (apk_blob_split(spec, APK_BLOB_STR(":"), &tag, &name)) { + repo_tag = apk_db_get_tag_id(&db, tag); + } else { + name = spec; } - bs = apk_bstream_from_file(AT_FDCWD, fn); + + bs = apk_bstream_from_file(AT_FDCWD, name.ptr); if (bs != NULL) { apk_db_index_read(&db, bs, i); db.repo_tags[repo_tag].allowed_repos |= BIT(i); -- cgit v1.2.3-70-g09d2