X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=examples%2Fsolv%2Frepoinfo_system_rpm.c;h=b5cfd8a2700833fd7c5ea38db40b3194990a5224;hb=refs%2Ftags%2Fupstream%2F0.7.27;hp=b556afc5d6b7eb25df157c7d0690c78e5b84124c;hpb=2d757ccc60324e7bfcc07f6f46d7f38e30642fcb;p=platform%2Fupstream%2Flibsolv.git diff --git a/examples/solv/repoinfo_system_rpm.c b/examples/solv/repoinfo_system_rpm.c index b556afc..b5cfd8a 100644 --- a/examples/solv/repoinfo_system_rpm.c +++ b/examples/solv/repoinfo_system_rpm.c @@ -161,4 +161,29 @@ commit_transactionelement_rpm(Pool *pool, Id type, Id p, FILE *fp) } } +#ifdef SUSE +char * +suse_find_baseproduct_evr(Pool *pool) +{ + char *evrstr = 0; + Pool *productspool = pool_create(); + Repo *productsrepo = repo_create(productspool, "products"); + Id p; + Solvable *s; + + pool_set_rootdir(productspool, pool_get_rootdir(pool)); + repo_add_products(productsrepo, PRODUCTS_PATH, REPO_USE_ROOTDIR); + FOR_REPO_SOLVABLES(productsrepo, p, s) + { + const char *type = solvable_lookup_str(s, PRODUCT_TYPE); + if (!type || strcmp(type, "base") != 0) + continue; + evrstr = solv_strdup(pool_id2str(productspool, s->evr)); + break; + } + pool_free(productspool); + return evrstr; +} +#endif + #endif