pkgdb: repository-origin -> repository to match the repo pkg obj.

This commit is contained in:
Juan RP 2014-09-13 10:49:13 +02:00
parent 287665009b
commit 411480e43d
2 changed files with 14 additions and 1 deletions

View File

@ -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;
}

View File

@ -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.
*/