diff --git a/utils/plist.c b/utils/plist.c index f623e507ce..12d55caa02 100644 --- a/utils/plist.c +++ b/utils/plist.c @@ -85,8 +85,7 @@ xbps_callback_array_iter_in_dict(prop_dictionary_t dict, const char *key, } prop_dictionary_t -xbps_find_pkg_in_dict(prop_dictionary_t dict, const char *key, - const char *pkgname) +xbps_find_pkg_in_dict(prop_dictionary_t dict, const char *pkgname) { prop_object_iterator_t iter; prop_object_t obj; @@ -95,7 +94,7 @@ xbps_find_pkg_in_dict(prop_dictionary_t dict, const char *key, if (pkgname == NULL) return NULL; - iter = xbps_get_array_iter_from_dict(dict, key); + iter = xbps_get_array_iter_from_dict(dict, "packages"); if (iter == NULL) return NULL; diff --git a/utils/plist.h b/utils/plist.h index e7214f1e9e..8dc24b6033 100644 --- a/utils/plist.h +++ b/utils/plist.h @@ -69,13 +69,12 @@ xbps_callback_array_iter_in_dict(prop_dictionary_t, const char *, * * Arguments: * - prop_dictionary_t: main dictionary to search the object. - * - 1st const char *key: use a dictionary with that key. - * - 2nd const char *pkgname: string of package name. + * - const char *: string of package name. * * Returns the package's dictionary object, otherwise NULL. */ prop_dictionary_t -xbps_find_pkg_in_dict(prop_dictionary_t, const char *, const char *); +xbps_find_pkg_in_dict(prop_dictionary_t, const char *); /* * Finds a string object in an array. diff --git a/utils/sh/binpkg-genindex.sh b/utils/sh/binpkg-genindex.sh index 88699144ac..7817d93c39 100644 --- a/utils/sh/binpkg-genindex.sh +++ b/utils/sh/binpkg-genindex.sh @@ -110,7 +110,7 @@ write_repo_pkgindex_header() $XBPS_PKGINDEX_VERSION location-local $repodir -available-packages +packages _EOF } diff --git a/utils/xbps-pkgdb.c b/utils/xbps-pkgdb.c index 2edfa14629..e1eedb50c5 100644 --- a/utils/xbps-pkgdb.c +++ b/utils/xbps-pkgdb.c @@ -80,7 +80,7 @@ register_pkg(prop_dictionary_t dict, pkg_data_t *pkg, const char *dbfile) exit(1); } - array = prop_dictionary_get(dict, "packages_installed"); + array = prop_dictionary_get(dict, "packages"); if (array == NULL || prop_object_type(array) != PROP_TYPE_ARRAY) { printf("%s: NULL or incorrect array type\n", __func__); exit(1); @@ -109,7 +109,7 @@ unregister_pkg(prop_dictionary_t dict, const char *pkgname, const char *dbfile) exit(1); } - array = prop_dictionary_get(dict, "packages_installed"); + array = prop_dictionary_get(dict, "packages"); if (array == NULL || prop_object_type(array) != PROP_TYPE_ARRAY) { printf("%s: NULL or incorrect array type\n", __func__); exit(1); @@ -137,7 +137,7 @@ unregister_pkg(prop_dictionary_t dict, const char *pkgname, const char *dbfile) } prop_array_remove(array, i); - if (!xbps_add_array_to_dict(dict, array, "packages_installed")) { + if (!xbps_add_array_to_dict(dict, array, "packages")) { printf("=> ERROR: couldn't unregister %s from database\n", pkgname); exit(1); @@ -257,8 +257,7 @@ main(int argc, char **argv) prop_object_release(dbdict); } else { /* Check if pkg is already registered. */ - pkgdict = xbps_find_pkg_in_dict(dbdict, - "packages_installed", argv[2]); + pkgdict = xbps_find_pkg_in_dict(dbdict, argv[2]); if (pkgdict != NULL) { printf("%s=> Package %s-%s already registered.\n", in_chroot ? "[chroot] " : "", @@ -293,7 +292,7 @@ main(int argc, char **argv) dbdict = prop_dictionary_internalize_from_file(dbfile); xbps_callback_array_iter_in_dict(dbdict, - "packages_installed", xbps_list_pkgs_in_dict); + "packages", xbps_list_pkgs_in_dict); } else if (strcmp(argv[1], "version") == 0) { /* Prints version of an installed package */ @@ -301,8 +300,7 @@ main(int argc, char **argv) usage(); pkgdict = xbps_find_pkg_in_dict( - prop_dictionary_internalize_from_file(dbfile), - "packages_installed", argv[2]); + prop_dictionary_internalize_from_file(dbfile), argv[2]); if (pkgdict == NULL) exit(1); if (!prop_dictionary_get_cstring_nocopy(pkgdict, "version",