libxbps: change the epoch char to ':' to differentiate the starting char in pkgname.
Added xbps_get_pkg_epoch(), to get the epoch version string.
This commit is contained in:
14
lib/util.c
14
lib/util.c
@@ -183,6 +183,20 @@ xbps_check_is_installed_pkgname(const char *pkgname)
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *
|
||||
xbps_get_pkg_epoch(const char *pkg)
|
||||
{
|
||||
const char *tmp;
|
||||
|
||||
assert(pkg != NULL);
|
||||
|
||||
tmp = strrchr(pkg, ':');
|
||||
if (tmp == NULL)
|
||||
return NULL;
|
||||
|
||||
return tmp + 1; /* skip first ':' */
|
||||
}
|
||||
|
||||
const char *
|
||||
xbps_get_pkg_version(const char *pkg)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user