Skip to content

Commit 96db706

Browse files
committed
lib: remove useless xbps_pkg_has_rundeps function
In the only place where this was required it doesn't have any effect and results in going through the package directory twice to receive and use the array after checking separately if it exists.
1 parent b3026da commit 96db706

File tree

3 files changed

+0
-26
lines changed

3 files changed

+0
-26
lines changed

bin/xbps-pkgdb/check_pkg_rundeps.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ check_pkg_rundeps(struct xbps_handle *xhp, const char *pkgname, void *arg)
5252
const char *reqpkg = NULL;
5353
int rv = 0;
5454

55-
if (!xbps_pkg_has_rundeps(pkg_propsd))
56-
return 0;
57-
5855
array = xbps_dictionary_get(pkg_propsd, "run_depends");
5956
for (unsigned int i = 0; i < xbps_array_count(array); i++) {
6057
xbps_array_get_cstring_nocopy(array, i, &reqpkg);

include/xbps.h.in

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,15 +2155,6 @@ int xbps_pkgpattern_match(const char *pkgver, const char *pattern);
21552155
*/
21562156
const char *xbps_pkg_revision(const char *pkg);
21572157

2158-
/**
2159-
* Checks if a package has run dependencies.
2160-
*
2161-
* @param[in] dict Package dictionary.
2162-
*
2163-
* @return True if package has run dependencies, false otherwise.
2164-
*/
2165-
bool xbps_pkg_has_rundeps(xbps_dictionary_t dict);
2166-
21672158
/**
21682159
* Returns true if provided string is valid for target architecture.
21692160
*

lib/util.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -418,20 +418,6 @@ xbps_remote_binpkg_exists(struct xbps_handle *xhp, xbps_dictionary_t pkgd)
418418
return access(path, R_OK) == 0;
419419
}
420420

421-
bool
422-
xbps_pkg_has_rundeps(xbps_dictionary_t pkgd)
423-
{
424-
xbps_array_t array;
425-
426-
assert(xbps_object_type(pkgd) == XBPS_TYPE_DICTIONARY);
427-
428-
array = xbps_dictionary_get(pkgd, "run_depends");
429-
if (xbps_array_count(array))
430-
return true;
431-
432-
return false;
433-
}
434-
435421
bool
436422
xbps_pkg_arch_match(struct xbps_handle *xhp, const char *orig,
437423
const char *target)

0 commit comments

Comments
 (0)