Added the concept of package properties in the API.

See the NEWS file and xbps-bin(8) for more information.
This commit is contained in:
Juan RP
2011-02-05 11:25:04 +01:00
parent d25bc35711
commit de296d8192
12 changed files with 820 additions and 212 deletions

View File

@@ -216,10 +216,13 @@ xbps_set_pkg_state_installed(const char *pkgname, pkg_state_t state)
}
array = prop_dictionary_get(dict, "packages");
if (array == NULL) {
rv = EINVAL;
if (newpkg)
prop_object_release(pkgd);
goto out;
array = prop_array_create();
if (!prop_dictionary_set(dict, "packages", array)) {
rv = EINVAL;
if (newpkg)
prop_object_release(pkgd);
goto out;
}
}
if ((rv = set_new_state(pkgd, state)) != 0) {
if (newpkg)