Use xbps_callback_array_iter_in_repolist() and removed dup code.

--HG--
extra : convert_revision : 7eb9c1b3df3fc7fde2ff61ac0cce1d635c3fef18
This commit is contained in:
Juan RP 2009-02-14 02:26:11 +01:00
parent 90fd3828e6
commit 83ed100fcf
4 changed files with 16 additions and 57 deletions

View file

@ -70,7 +70,6 @@ int
xbps_install_binary_pkg(const char *pkgname, const char *destdir)
{
struct cbargs cb;
char *plist;
int rv = 0;
assert(pkgname != NULL);
@ -80,22 +79,14 @@ xbps_install_binary_pkg(const char *pkgname, const char *destdir)
} else
destdir = "NOTSET";
/*
* Get the dictionary with the list of registered repositories.
*/
plist = xbps_append_full_path(true, NULL, XBPS_REPOLIST);
if (plist == NULL)
return EINVAL;
cb.pkgname = pkgname;
cb.destdir = destdir;
/*
* Iterate over the repository pool and find out if we have
* all available binary packages.
*/
rv = xbps_callback_array_iter_in_repolist(plist,
install_binpkg_repo_cb, (void *)&cb);
free(plist);
rv = xbps_callback_array_iter_in_repolist(install_binpkg_repo_cb,
(void *)&cb);
return rv;
}