xbps-repo: fix search and show targets when first repo doesn't exist.
--HG-- extra : convert_revision : 2e5410f4461c62ceb51bb1296cab8a9076bc666a
This commit is contained in:
parent
8fa094ff02
commit
cbb1d1bef5
1 changed files with 7 additions and 4 deletions
|
@ -137,13 +137,15 @@ search_string_in_pkgs(prop_object_t obj, void *arg, bool *loop_done)
|
||||||
assert(repofile != NULL);
|
assert(repofile != NULL);
|
||||||
|
|
||||||
plist = xbps_get_pkg_index_plist(repofile);
|
plist = xbps_get_pkg_index_plist(repofile);
|
||||||
if (plist == NULL)
|
if (plist == NULL) {
|
||||||
return EINVAL;
|
errno = ENOENT;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
dict = prop_dictionary_internalize_from_file(plist);
|
dict = prop_dictionary_internalize_from_file(plist);
|
||||||
if (dict == NULL) {
|
if (dict == NULL) {
|
||||||
free(plist);
|
free(plist);
|
||||||
return EINVAL;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("From %s repository ...\n", repofile);
|
printf("From %s repository ...\n", repofile);
|
||||||
|
@ -210,7 +212,8 @@ show_pkg_info_from_repolist(prop_object_t obj, void *arg, bool *loop_done)
|
||||||
dict = prop_dictionary_internalize_from_file(plist);
|
dict = prop_dictionary_internalize_from_file(plist);
|
||||||
if (dict == NULL || prop_dictionary_count(dict) == 0) {
|
if (dict == NULL || prop_dictionary_count(dict) == 0) {
|
||||||
free(plist);
|
free(plist);
|
||||||
return EINVAL;
|
errno = ENOENT;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
pkgdict = xbps_find_pkg_in_dict(dict, "packages", arg);
|
pkgdict = xbps_find_pkg_in_dict(dict, "packages", arg);
|
||||||
|
|
Loading…
Reference in a new issue