char * hy_package_get_location(HyPackage pkg) { Solvable *s = get_solvable(pkg); repo_internalize_trigger(s->repo); return solv_strdup(solvable_get_location(s, NULL)); }
/** * dnf_package_get_location: * @pkg: a #DnfPackage instance. * * Gets the location (XXX??) for the package. Note that the returned string has * an undefined lifetime and may become invalid at a later time. You should copy * the string if storing it into a long-lived data structure. * * Returns: (transfer none): string * * Since: 0.7.0 */ const char * dnf_package_get_location(DnfPackage *pkg) { Solvable *s = get_solvable(pkg); if (s->repo) { repo_internalize_trigger(s->repo); } return solvable_get_location(s, NULL); }
void langdemo(Pool *pool) { Id screenid, p, pp; screenid = str2id(pool, "3ddiag", 1); static const char *languages[] = {"es", "de"}; pool_set_languages(pool, languages, 2); FOR_PROVIDES(p, pp, screenid) { unsigned int medianr; Id chktype = 0; char *loc = solvable_get_location(pool->solvables + p, &medianr); const char *chksum; chksum = solvable_lookup_checksum(pool->solvables + p, SOLVABLE_CHECKSUM, &chktype); printf("%s: %s\n%s[%d] %s:%s\n", solvable2str(pool, pool->solvables + p), solvable_lookup_str_poollang(pool->solvables + p, SOLVABLE_DESCRIPTION), loc, medianr, id2str(pool, chktype), chksum); printf("DE: %s\n", solvable_lookup_str_lang(pool->solvables + p, SOLVABLE_DESCRIPTION, "de", 1)); }