diff --git a/bin/xbps-pkgdb/check_pkg_unneeded.c b/bin/xbps-pkgdb/check_pkg_unneeded.c index 32c56f5b..e56387e1 100644 --- a/bin/xbps-pkgdb/check_pkg_unneeded.c +++ b/bin/xbps-pkgdb/check_pkg_unneeded.c @@ -46,11 +46,17 @@ int check_pkg_unneeded(struct xbps_handle *xhp _unused, const char *pkgname _unused, void *arg) { xbps_dictionary_t pkgd = arg; + const char *repo = NULL; xbps_dictionary_remove(pkgd, "download"); xbps_dictionary_remove(pkgd, "remove-and-update"); xbps_dictionary_remove(pkgd, "transaction"); xbps_dictionary_remove(pkgd, "skip-obsoletes"); + xbps_dictionary_get_cstring_nocopy(pkgd, "repository-origin", &repo); + if (repo) { + xbps_dictionary_set_cstring(pkgd, "repository", repo); + xbps_dictionary_remove(pkgd, "repository-origin"); + } return 0; } diff --git a/lib/pkgdb_conversion.c b/lib/pkgdb_conversion.c index 34f546a0..de9c622f 100644 --- a/lib/pkgdb_conversion.c +++ b/lib/pkgdb_conversion.c @@ -67,11 +67,18 @@ pkgdb038(struct xbps_handle *xhp, const char *opkgdb_plist) xbps_dictionary_t pkgd, pkgfilesd, pkgmetad; xbps_object_iterator_t iter2; xbps_object_t obj2; - const char *pkgname; + const char *pkgname, *repo; char *pkgmeta; pkgname = xbps_dictionary_keysym_cstring_nocopy(obj); pkgd = xbps_dictionary_get_keysym(opkgdb, obj); + /* + * Rename "repository-origin" obj to "repository" to match + * the repository index obj. + */ + xbps_dictionary_get_cstring_nocopy(pkgd, "repository-origin", &repo); + xbps_dictionary_set_cstring(pkgd, "repository", repo); + xbps_dictionary_remove(pkgd, "repository-origin"); /* * Copy old pkgdb objects to the new pkgdb. */