static void updatables_query_name(HifSack *sack, const char *name) { HyQuery q = hy_query_create(sack); hy_query_filter(q, HY_PKG_NAME, HY_EQ, name); #if 0 // must stil work if enabled hy_query_filter(q, HY_PKG_REPONAME, HY_NEQ, HY_SYSTEM_REPO_NAME); #endif hy_query_filter_upgrades(q, 1); execute_print(sack, q, 0); hy_query_free(q); }
END_TEST START_TEST(test_upgrades) { const char *installonly[] = {"fool", NULL}; hy_sack_set_installonly(test_globals.sack, installonly); HyQuery q = hy_query_create(test_globals.sack); hy_query_filter_upgrades(q, 1); fail_unless(query_count_results(q) == TEST_EXPECT_UPDATES_NSOLVABLES - 2); hy_query_free(q); }
END_TEST START_TEST(test_upgrade_already_installed) { /* if pkg is installed in two versions and the later is available in repos, it shouldn't show as a possible update. */ HyQuery q = hy_query_create(test_globals.sack); hy_query_filter(q, HY_PKG_NAME, HY_EQ, "jay"); hy_query_filter_upgrades(q, 1); HyPackageList plist = hy_query_run(q); fail_unless(hy_packagelist_count(plist) == 0); hy_query_free(q); hy_packagelist_free(plist); }