libxbps: if XBPS_FLAG_VERBOSE is set print to stdout some info about binary
packages found in repositories and its dependencies.
This commit is contained in:
parent
855a1d505e
commit
2be6a7b1bc
@ -36,8 +36,8 @@ store_dependency(prop_dictionary_t master, prop_dictionary_t depd,
|
|||||||
{
|
{
|
||||||
prop_dictionary_t dict;
|
prop_dictionary_t dict;
|
||||||
prop_array_t array;
|
prop_array_t array;
|
||||||
const char *pkgname;
|
const char *pkgname, *pkgver;
|
||||||
int rv = 0;
|
int flags = xbps_get_flags(), rv = 0;
|
||||||
pkg_state_t state = 0;
|
pkg_state_t state = 0;
|
||||||
|
|
||||||
assert(master != NULL);
|
assert(master != NULL);
|
||||||
@ -49,6 +49,9 @@ store_dependency(prop_dictionary_t master, prop_dictionary_t depd,
|
|||||||
if (!prop_dictionary_get_cstring_nocopy(depd, "pkgname", &pkgname))
|
if (!prop_dictionary_get_cstring_nocopy(depd, "pkgname", &pkgname))
|
||||||
return errno;
|
return errno;
|
||||||
|
|
||||||
|
if (!prop_dictionary_get_cstring_nocopy(depd, "pkgver", &pkgver))
|
||||||
|
return errno;
|
||||||
|
|
||||||
dict = prop_dictionary_copy(depd);
|
dict = prop_dictionary_copy(depd);
|
||||||
if (dict == NULL)
|
if (dict == NULL)
|
||||||
return errno;
|
return errno;
|
||||||
@ -96,6 +99,9 @@ store_dependency(prop_dictionary_t master, prop_dictionary_t depd,
|
|||||||
prop_object_release(dict);
|
prop_object_release(dict);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf("\n Added package '%s' into the transaction (%s).\n",
|
||||||
|
pkgver, repoloc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -245,7 +251,7 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
pkg_state_t state = 0;
|
pkg_state_t state = 0;
|
||||||
const char *reqpkg, *reqvers, *pkg_queued, *repo_pkgver;
|
const char *reqpkg, *reqvers, *pkg_queued, *repo_pkgver;
|
||||||
char *pkgname;
|
char *pkgname;
|
||||||
int rv = 0;
|
int flags = xbps_get_flags(), rv = 0;
|
||||||
|
|
||||||
iter = prop_array_iterator(array);
|
iter = prop_array_iterator(array);
|
||||||
if (iter == NULL)
|
if (iter == NULL)
|
||||||
@ -261,6 +267,9 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
rv = EINVAL;
|
rv = EINVAL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf(" Requires dependency '%s': ", reqpkg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if required dep is satisfied and installed.
|
* Check if required dep is satisfied and installed.
|
||||||
*/
|
*/
|
||||||
@ -271,11 +280,11 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
break;
|
break;
|
||||||
} else if (rv == 1) {
|
} else if (rv == 1) {
|
||||||
/* Required pkg dependency is satisfied */
|
/* Required pkg dependency is satisfied */
|
||||||
DPRINTF(("Dependency %s satisfied.\n", reqpkg));
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf("satisfied and installed.\n");
|
||||||
rv = 0;
|
rv = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
DPRINTF(("Dependency %s not installed.\n", reqpkg));
|
|
||||||
pkgname = xbps_get_pkgpattern_name(reqpkg);
|
pkgname = xbps_get_pkgpattern_name(reqpkg);
|
||||||
if (pkgname == NULL) {
|
if (pkgname == NULL) {
|
||||||
rv = EINVAL;
|
rv = EINVAL;
|
||||||
@ -310,8 +319,8 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
}
|
}
|
||||||
if (xbps_pkgpattern_match(pkg_queued,
|
if (xbps_pkgpattern_match(pkg_queued,
|
||||||
__UNCONST(reqpkg))) {
|
__UNCONST(reqpkg))) {
|
||||||
DPRINTF(("Dependency %s already queued.\n",
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
pkgname));
|
printf("queued in the transaction.\n");
|
||||||
free(pkgname);
|
free(pkgname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -343,8 +352,8 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
free(pkgname);
|
free(pkgname);
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
DPRINTF(("Added missing dep %s (repo: %s).\n",
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
reqpkg, repoloc));
|
printf("missing package in repository!\n");
|
||||||
free(pkgname);
|
free(pkgname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -403,7 +412,6 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
DPRINTF(("store_dependency failed %s\n", reqpkg));
|
DPRINTF(("store_dependency failed %s\n", reqpkg));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DPRINTF(("Added reqdep %s (repo: %s)\n", reqpkg, repoloc));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If package was added in the missing_deps array, we
|
* If package was added in the missing_deps array, we
|
||||||
@ -430,7 +438,9 @@ find_repo_deps(prop_dictionary_t master, prop_dictionary_t repo,
|
|||||||
/*
|
/*
|
||||||
* Iterate on required pkg to find more deps.
|
* Iterate on required pkg to find more deps.
|
||||||
*/
|
*/
|
||||||
DPRINTF(("Looking for rundeps on %s.\n", reqpkg));
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf(" Finding dependencies for '%s':\n", reqpkg);
|
||||||
|
|
||||||
if ((rv = find_repo_deps(master, repo, repoloc,
|
if ((rv = find_repo_deps(master, repo, repoloc,
|
||||||
curpkg_rdeps)) != 0) {
|
curpkg_rdeps)) != 0) {
|
||||||
DPRINTF(("Error checking %s rundeps %s\n",
|
DPRINTF(("Error checking %s rundeps %s\n",
|
||||||
@ -448,8 +458,8 @@ xbps_repository_find_pkg_deps(prop_dictionary_t master, prop_dictionary_t pkg)
|
|||||||
{
|
{
|
||||||
prop_array_t pkg_rdeps, missing_rdeps;
|
prop_array_t pkg_rdeps, missing_rdeps;
|
||||||
struct repository_pool *rpool;
|
struct repository_pool *rpool;
|
||||||
const char *pkgname;
|
const char *pkgname, *pkgver;
|
||||||
int rv = 0;
|
int flags = xbps_get_flags(), rv = 0;
|
||||||
|
|
||||||
assert(master != NULL);
|
assert(master != NULL);
|
||||||
assert(pkg != NULL);
|
assert(pkg != NULL);
|
||||||
@ -461,10 +471,15 @@ xbps_repository_find_pkg_deps(prop_dictionary_t master, prop_dictionary_t pkg)
|
|||||||
if (!prop_dictionary_get_cstring_nocopy(pkg, "pkgname", &pkgname))
|
if (!prop_dictionary_get_cstring_nocopy(pkg, "pkgname", &pkgname))
|
||||||
return errno;
|
return errno;
|
||||||
|
|
||||||
|
if (!prop_dictionary_get_cstring_nocopy(pkg, "pkgver", &pkgver))
|
||||||
|
return errno;
|
||||||
|
|
||||||
if ((rv = xbps_repository_pool_init()) != 0)
|
if ((rv = xbps_repository_pool_init()) != 0)
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
DPRINTF(("Checking rundeps for %s.\n", pkgname));
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf(" Finding required dependencies for '%s':\n", pkgver);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Iterate over the repository pool and find out if we have
|
* Iterate over the repository pool and find out if we have
|
||||||
* all available binary packages.
|
* all available binary packages.
|
||||||
|
@ -292,7 +292,7 @@ xbps_repository_update_pkg(const char *pkgname, prop_dictionary_t instpkg)
|
|||||||
prop_array_t unsorted;
|
prop_array_t unsorted;
|
||||||
struct repository_pool *rpool;
|
struct repository_pool *rpool;
|
||||||
const char *repover, *instver;
|
const char *repover, *instver;
|
||||||
int rv = 0;
|
int flags = xbps_get_flags(), rv = 0;
|
||||||
bool newpkg_found = false;
|
bool newpkg_found = false;
|
||||||
|
|
||||||
assert(pkgname != NULL);
|
assert(pkgname != NULL);
|
||||||
@ -316,8 +316,9 @@ xbps_repository_update_pkg(const char *pkgname, prop_dictionary_t instpkg)
|
|||||||
rv = errno;
|
rv = errno;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
DPRINTF(("Package %s not found in repo %s.\n",
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
pkgname, rpool->rp_uri));
|
printf("Package '%s' not found in repository "
|
||||||
|
"'%s'.\n", pkgname, rpool->rp_uri);
|
||||||
} else if (pkgrd != NULL) {
|
} else if (pkgrd != NULL) {
|
||||||
/*
|
/*
|
||||||
* Check if version in repository is greater than
|
* Check if version in repository is greater than
|
||||||
@ -334,13 +335,17 @@ xbps_repository_update_pkg(const char *pkgname, prop_dictionary_t instpkg)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
if (xbps_cmpver(repover, instver) > 0) {
|
if (xbps_cmpver(repover, instver) > 0) {
|
||||||
DPRINTF(("Found %s-%s in repo %s.\n",
|
if (flags & XBPS_FLAG_VERBOSE) {
|
||||||
pkgname, repover, rpool->rp_uri));
|
printf("Found '%s-%s' in repository "
|
||||||
|
"'%s'.\n", pkgname, repover,
|
||||||
|
rpool->rp_uri);
|
||||||
|
}
|
||||||
newpkg_found = true;
|
newpkg_found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DPRINTF(("Skipping %s-%s in repo %s.\n",
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
pkgname, repover, rpool->rp_uri));
|
printf("Skipping '%s-%s' from repository "
|
||||||
|
"'%s'.\n", pkgname, repover, rpool->rp_uri);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -411,8 +416,8 @@ xbps_repository_install_pkg(const char *pkg, bool bypattern)
|
|||||||
prop_dictionary_t origin_pkgrd = NULL, pkgrd = NULL;
|
prop_dictionary_t origin_pkgrd = NULL, pkgrd = NULL;
|
||||||
prop_array_t unsorted;
|
prop_array_t unsorted;
|
||||||
struct repository_pool *rpool;
|
struct repository_pool *rpool;
|
||||||
const char *pkgname;
|
const char *pkgname, *pkgver;
|
||||||
int rv = 0;
|
int flags = xbps_get_flags(), rv = 0;
|
||||||
|
|
||||||
assert(pkg != NULL);
|
assert(pkg != NULL);
|
||||||
|
|
||||||
@ -436,8 +441,15 @@ xbps_repository_install_pkg(const char *pkg, bool bypattern)
|
|||||||
rv = errno;
|
rv = errno;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} else if (pkgrd != NULL)
|
} else if (pkgrd != NULL) {
|
||||||
|
if (flags & XBPS_FLAG_VERBOSE) {
|
||||||
|
prop_dictionary_get_cstring_nocopy(pkgrd,
|
||||||
|
"pkgver", &pkgver);
|
||||||
|
printf("Found package '%s' (%s).\n",
|
||||||
|
pkgver, rpool->rp_uri);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pkgrd == NULL) {
|
if (pkgrd == NULL) {
|
||||||
rv = EAGAIN;
|
rv = EAGAIN;
|
||||||
@ -480,6 +492,9 @@ xbps_repository_install_pkg(const char *pkg, bool bypattern)
|
|||||||
if ((rv = xbps_repository_find_pkg_deps(trans_dict, pkgrd)) != 0)
|
if ((rv = xbps_repository_find_pkg_deps(trans_dict, pkgrd)) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add required package dictionary into the unsorted deps dictionary,
|
* Add required package dictionary into the unsorted deps dictionary,
|
||||||
* set package state as not yet installed.
|
* set package state as not yet installed.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user