Skip to content

Commit 4bc6eed

Browse files
committed
lib: remove xbps_{rpool,repo}_get_pkg_plist
Only xbps_rpool_get_pkg_plist was used in one place and was easily replaced with doing it "manually" with less code.
1 parent 546e3e7 commit 4bc6eed

File tree

3 files changed

+0
-91
lines changed

3 files changed

+0
-91
lines changed

include/xbps.h.in

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,29 +1553,6 @@ xbps_array_t xbps_rpool_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg
15531553
*/
15541554
xbps_array_t xbps_rpool_get_pkg_fulldeptree(struct xbps_handle *xhp, const char *pkg);
15551555

1556-
/**
1557-
* Iterate over the the repository pool and search for a metadata plist
1558-
* file in a binary package matching `pattern'. If a package is matched
1559-
* the plist file \a plistf will be internalized into a proplib dictionary.
1560-
*
1561-
* When \a pattern is a pkgname, the newest package available in repositories
1562-
* will be used. Otherwise the first repository matching \a pattern.
1563-
*
1564-
* @param[in] xhp Pointer to the xbps_handle struct.
1565-
* @param[in] pattern Package name or package pattern to match, i.e `foo>=1.0'.
1566-
* @param[in] plistf Plist file name to match, i.e XBPS_PKGPROPS or XBPS_PKGFILES.
1567-
*
1568-
* @return An internalized proplib dictionary of \a plistf, otherwise NULL
1569-
* and errno is set appropiately.
1570-
*
1571-
* @note if NULL is returned and errno is ENOENT, that means that
1572-
* binary package file has been found but the plist file could not
1573-
* be found.
1574-
*/
1575-
xbps_dictionary_t xbps_rpool_get_pkg_plist(struct xbps_handle *xhp,
1576-
const char *pattern,
1577-
const char *plistf);
1578-
15791556
/**@}*/
15801557

15811558
/** @addtogroup repo */
@@ -1724,20 +1701,6 @@ xbps_dictionary_t xbps_repo_get_pkg(struct xbps_repo *repo, const char *pkg);
17241701
*/
17251702
xbps_dictionary_t xbps_repo_get_virtualpkg(struct xbps_repo *repo, const char *pkg);
17261703

1727-
/**
1728-
* Returns a pkg dictionary of the matching \a plist file from a binary package,
1729-
* by looking at its package dictionary (\a pkgd) returned by a repository or rpool.
1730-
*
1731-
* @param[in] xhp Pointer to the xbps_handle struct.
1732-
* @param[in] pkgd Package dictionary returned by xbps_{repo,rpool}_get_xxxpkg().
1733-
* @param[in] plist Plist filename to internalize from matching binary package.
1734-
*
1735-
* @return The pkg dictionary on success, NULL otherwise.
1736-
*/
1737-
xbps_dictionary_t xbps_repo_get_pkg_plist(struct xbps_handle *xhp,
1738-
xbps_dictionary_t pkgd,
1739-
const char *plist);
1740-
17411704
/**
17421705
* Returns a proplib array of strings with reverse dependencies from
17431706
* repository \a repo matching the expression \a pkg.

lib/repo.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -473,22 +473,6 @@ xbps_repo_get_pkg(struct xbps_repo *repo, const char *pkg)
473473
return pkgd;
474474
}
475475

476-
xbps_dictionary_t
477-
xbps_repo_get_pkg_plist(struct xbps_handle *xhp, xbps_dictionary_t pkgd,
478-
const char *plist)
479-
{
480-
xbps_dictionary_t bpkgd;
481-
char *url;
482-
483-
url = xbps_repository_pkg_path(xhp, pkgd);
484-
if (url == NULL)
485-
return NULL;
486-
487-
bpkgd = xbps_archive_fetch_plist(url, plist);
488-
free(url);
489-
return bpkgd;
490-
}
491-
492476
static xbps_array_t
493477
revdeps_match(struct xbps_repo *repo, xbps_dictionary_t tpkgd, const char *str)
494478
{

lib/rpool.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -345,41 +345,3 @@ xbps_rpool_get_pkg_fulldeptree(struct xbps_handle *xhp, const char *pkg)
345345
{
346346
return xbps_get_pkg_fulldeptree(xhp, pkg, true);
347347
}
348-
349-
xbps_dictionary_t
350-
xbps_rpool_get_pkg_plist(struct xbps_handle *xhp,
351-
const char *pkg,
352-
const char *plistf)
353-
{
354-
xbps_dictionary_t pkgd = NULL, plistd = NULL;
355-
char *url;
356-
357-
assert(pkg != NULL);
358-
assert(plistf != NULL);
359-
/*
360-
* Iterate over the the repository pool and search for a plist file
361-
* in the binary package matching `pattern'. The plist file will be
362-
* internalized to a proplib dictionary.
363-
*
364-
* The first repository that has it wins and the loop is stopped.
365-
* This will work locally and remotely, thanks to libarchive and
366-
* libfetch!
367-
*/
368-
if (((pkgd = xbps_rpool_get_pkg(xhp, pkg)) == NULL) &&
369-
((pkgd = xbps_rpool_get_virtualpkg(xhp, pkg)) == NULL))
370-
goto out;
371-
372-
url = xbps_repository_pkg_path(xhp, pkgd);
373-
if (url == NULL) {
374-
errno = EINVAL;
375-
goto out;
376-
}
377-
plistd = xbps_archive_fetch_plist(url, plistf);
378-
free(url);
379-
380-
out:
381-
if (plistd == NULL)
382-
errno = ENOENT;
383-
384-
return plistd;
385-
}

0 commit comments

Comments
 (0)