Reorganize headers and move two funcs into util.c, where they belong.
--HG-- extra : convert_revision : 63d54dddfeb732da2204244fd9f00cff434e5540
This commit is contained in:
parent
d7b5f20e26
commit
3a52668aed
10 changed files with 269 additions and 103 deletions
24
lib/remove.c
24
lib/remove.c
|
@ -36,28 +36,6 @@
|
|||
|
||||
#include <xbps_api.h>
|
||||
|
||||
static bool
|
||||
check_installed_pkgname(const char *pkgname)
|
||||
{
|
||||
prop_dictionary_t pkgd;
|
||||
char *plist;
|
||||
|
||||
assert(pkgname != NULL);
|
||||
|
||||
plist = xbps_append_full_path(true, NULL, XBPS_REGPKGDB);
|
||||
if (plist == NULL)
|
||||
return false;
|
||||
|
||||
pkgd = xbps_find_pkg_from_plist(plist, pkgname);
|
||||
free(plist);
|
||||
if (pkgd) {
|
||||
prop_object_release(pkgd);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int
|
||||
xbps_unregister_pkg(const char *pkgname)
|
||||
{
|
||||
|
@ -136,7 +114,7 @@ xbps_remove_binary_pkg(const char *pkgname, const char *destdir)
|
|||
destdir = "";
|
||||
|
||||
/* Check if pkg is installed */
|
||||
if (check_installed_pkgname(pkgname) == false)
|
||||
if (xbps_check_is_installed_pkgname(pkgname) == false)
|
||||
return ENOENT;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue