]> git.ipfire.org Git - pakfire.git/blobdiff - src/libpakfire/package.c
packages: Add weak dependencies supplements/enhances
[pakfire.git] / src / libpakfire / package.c
index 6dc7336b0ba1ff54f18efa797438092fec8e6340..cb6fd38aa71889414c1bf99852c160eeb2cc2eef 100644 (file)
@@ -648,6 +648,22 @@ PAKFIRE_EXPORT void pakfire_package_add_suggests(PakfirePackage pkg, PakfireRela
        pakfire_package_add_relation(pkg, SOLVABLE_SUGGESTS, relation, 0);
 }
 
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_supplements(PakfirePackage pkg) {
+       return pakfire_package_get_relationlist(pkg, SOLVABLE_SUPPLEMENTS, 0);
+}
+
+PAKFIRE_EXPORT void pakfire_package_set_supplements(PakfirePackage pkg, PakfireRelationList relationlist) {
+       pakfire_package_set_relationlist(pkg, SOLVABLE_SUPPLEMENTS, relationlist, 0);
+}
+
+PAKFIRE_EXPORT PakfireRelationList pakfire_package_get_enhances(PakfirePackage pkg) {
+       return pakfire_package_get_relationlist(pkg, SOLVABLE_ENHANCES, 0);
+}
+
+PAKFIRE_EXPORT void pakfire_package_set_enhances(PakfirePackage pkg, PakfireRelationList relationlist) {
+       pakfire_package_set_relationlist(pkg, SOLVABLE_ENHANCES, relationlist, 0);
+}
+
 PAKFIRE_EXPORT PakfireRepo pakfire_package_get_repo(PakfirePackage pkg) {
        if (!pkg->repo) {
                Solvable* s = get_solvable(pkg);
@@ -838,6 +854,8 @@ PAKFIRE_EXPORT char* pakfire_package_dump(PakfirePackage pkg, int flags) {
                        { _("Obsoletes"),    pakfire_package_get_obsoletes, },
                        { _("Recommends"),   pakfire_package_get_recommends, },
                        { _("Suggests"),     pakfire_package_get_suggests, },
+                       { _("Supplements"),  pakfire_package_get_supplements, },
+                       { _("Enhances"),     pakfire_package_get_enhances, },
                        { NULL, NULL},
                };