diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-24 08:42:40 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-24 08:42:40 +0200 |
commit | 4676c5d63ac70f4bf2c4e4c945a7fa65941676e9 (patch) | |
tree | 95cd25767adde7eb9f07240e22f8859984075bb7 /src/apk.c | |
parent | 1bb2fa7862bb896f1cfefca5bb9f1d0b477f49a5 (diff) | |
download | apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.tar.gz apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.tar.bz2 apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.tar.xz apk-tools-4676c5d63ac70f4bf2c4e4c945a7fa65941676e9.zip |
test: improve pinning tests
Diffstat (limited to 'src/apk.c')
-rw-r--r-- | src/apk.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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); |