diff --git a/bin/xbps-bin/check.c b/bin/xbps-bin/check.c index 13ed5beb..512dd06f 100644 --- a/bin/xbps-bin/check.c +++ b/bin/xbps-bin/check.c @@ -252,7 +252,8 @@ xbps_check_pkg_integrity(const char *pkgname) rv = EINVAL; goto out; } - if (xbps_check_is_installed_pkg(reqpkg) <= 0) { + rv = xbps_check_is_installed_pkg_by_pattern(reqpkg); + if (rv <= 0) { rv = ENOENT; printf("%s: dependency not satisfied: %s\n", pkgname, reqpkg); diff --git a/bin/xbps-repo/repository.c b/bin/xbps-repo/repository.c index 85a49a22..c194bd98 100644 --- a/bin/xbps-repo/repository.c +++ b/bin/xbps-repo/repository.c @@ -173,7 +173,7 @@ register_repository(const char *uri) if ((idxstr = sanitize_url(uri)) == NULL) return errno; - if (xbps_check_is_repo_string_remote(idxstr)) { + if (xbps_check_is_repository_uri_remote(idxstr)) { printf("Fetching remote package index at %s...\n", idxstr); rv = xbps_repository_sync_pkg_index(idxstr, fetch_file_progress_cb, &xfpd); @@ -306,7 +306,7 @@ repo_sync_pkg_index_cb(struct repository_pool_index *rpi, void *arg, bool *done) (void)arg; (void)done; - if (!xbps_check_is_repo_string_remote(rpi->rpi_uri)) + if (!xbps_check_is_repository_uri_remote(rpi->rpi_uri)) return 0; printf("Syncing package index from: %s\n", rpi->rpi_uri); diff --git a/include/xbps_api.h b/include/xbps_api.h index 70cd00fb..aa08704d 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -1106,7 +1106,7 @@ int xbps_check_file_hash(const char *file, const char *sha256); * didn't match installed package, 1 if \a pkg pattern fully * matched installed package. */ -int xbps_check_is_installed_pkg(const char *pkg); +int xbps_check_is_installed_pkg_by_pattern(const char *pkg); /** * Checks if package \a pkgname is currently installed. @@ -1115,7 +1115,7 @@ int xbps_check_is_installed_pkg(const char *pkg); * * @return True if \a pkgname is installed, false otherwise. */ -bool xbps_check_is_installed_pkgname(const char *pkgname); +bool xbps_check_is_installed_pkg_by_name(const char *pkgname); /** * Checks if the URI specified by \a uri is remote or local. @@ -1124,7 +1124,7 @@ bool xbps_check_is_installed_pkgname(const char *pkgname); * * @return true if URI is remote, false if local. */ -bool xbps_check_is_repo_string_remote(const char *uri); +bool xbps_check_is_repository_uri_remote(const char *uri); /** * Gets the full URI to a binary package file as returned by a diff --git a/lib/package_remove.c b/lib/package_remove.c index e9dd7f4c..f4d7a765 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -181,7 +181,7 @@ xbps_remove_pkg(const char *pkgname, const char *version, bool update) /* * Check if pkg is installed before anything else. */ - if (!xbps_check_is_installed_pkgname(pkgname)) + if (!xbps_check_is_installed_pkg_by_name(pkgname)) return ENOENT; buf = xbps_xasprintf(".%s/metadata/%s/REMOVE", diff --git a/lib/repository_plist.c b/lib/repository_plist.c index e9484b2b..537b13ea 100644 --- a/lib/repository_plist.c +++ b/lib/repository_plist.c @@ -119,7 +119,7 @@ open_archive(const char *url) struct url *u; struct archive *a; - if (!xbps_check_is_repo_string_remote(url)) { + if (!xbps_check_is_repository_uri_remote(url)) { if ((a = archive_read_new()) == NULL) return NULL; diff --git a/lib/repository_register.c b/lib/repository_register.c index 139ce5d1..2387651f 100644 --- a/lib/repository_register.c +++ b/lib/repository_register.c @@ -162,7 +162,7 @@ xbps_repository_unregister(const char *uri) * If it's a remote repository, also remove the stored XBPS_PKGINDEX * file and its directory. */ - if (xbps_check_is_repo_string_remote(uri)) { + if (xbps_check_is_repository_uri_remote(uri)) { pkgindex = xbps_get_pkg_index_plist(uri); if (pkgindex == NULL) { rv = errno; diff --git a/lib/transaction_sortdeps.c b/lib/transaction_sortdeps.c index f321f5af..187b8d9e 100644 --- a/lib/transaction_sortdeps.c +++ b/lib/transaction_sortdeps.c @@ -158,7 +158,7 @@ again: * If dependency is already satisfied or queued, * pass to the next one. */ - if (xbps_check_is_installed_pkg(str)) { + if (xbps_check_is_installed_pkg_by_pattern(str)) { rundepscnt++; xbps_dbg_printf_append("installed.\n"); } else if (xbps_find_pkg_in_dict_by_name(transd, diff --git a/lib/util.c b/lib/util.c index 1ab5e1c6..7d0f469c 100644 --- a/lib/util.c +++ b/lib/util.c @@ -150,7 +150,7 @@ xbps_check_file_hash(const char *file, const char *sha256) } bool -xbps_check_is_repo_string_remote(const char *uri) +xbps_check_is_repository_uri_remote(const char *uri) { assert(uri != NULL); @@ -163,7 +163,7 @@ xbps_check_is_repo_string_remote(const char *uri) } int -xbps_check_is_installed_pkg(const char *pattern) +xbps_check_is_installed_pkg_by_pattern(const char *pattern) { prop_dictionary_t dict; pkg_state_t state; @@ -196,7 +196,7 @@ xbps_check_is_installed_pkg(const char *pattern) } bool -xbps_check_is_installed_pkgname(const char *pkgname) +xbps_check_is_installed_pkg_by_name(const char *pkgname) { prop_dictionary_t pkgd; @@ -347,7 +347,7 @@ xbps_get_pkg_index_plist(const char *uri) if (uname(&un) == -1) return NULL; - if (xbps_check_is_repo_string_remote(uri)) + if (xbps_check_is_repository_uri_remote(uri)) return get_pkg_index_remote_plist(uri); return xbps_xasprintf("%s/%s/%s", uri, un.machine, XBPS_PKGINDEX);