Remove dup xbps_cmpver_* func, use just the real one.

--HG--
extra : convert_revision : cde78bdcccc68bb865d5bd76a84c00055f451e96
This commit is contained in:
Juan RP 2009-06-07 05:02:58 +02:00
parent bef5f8c9dd
commit e1e3e254ab
6 changed files with 6 additions and 15 deletions

View file

@ -17,5 +17,5 @@ int main(int argc, char **argv)
return 1;
}
return xbps_cmpver_packages(argv[1], argv[2]);
return xbps_cmpver(argv[1], argv[2]);
}

View file

@ -165,7 +165,7 @@ repoidx_addpkg(const char *file, const char *filename, const char *pkgdir)
if (curpkgd) {
prop_dictionary_get_cstring_nocopy(curpkgd,
"version", &regver);
if (xbps_cmpver_versions(version, regver) <= 0) {
if (xbps_cmpver(version, regver) <= 0) {
printf("Skipping %s. Version %s already "
"registered.\n", filename, regver);
prop_object_release(newpkgd);

View file

@ -67,8 +67,7 @@
#endif
/* from lib/cmpver.c */
int xbps_cmpver_packages(const char *, const char *);
int xbps_cmpver_versions(const char *, const char *);
int xbps_cmpver(const char *, const char *);
/* From lib/fexec.c */
int xbps_file_exec(const char *, ...);

View file

@ -225,7 +225,7 @@ get_component(const char *position, version_component *component)
* multiple components, separated by a period, including letters.
*/
int
xbps_cmpver_packages(const char *pkg1, const char *pkg2)
xbps_cmpver(const char *pkg1, const char *pkg2)
{
const char *v1, *v2, *ve1, *ve2;
unsigned long e1, e2, r1, r2;
@ -281,11 +281,3 @@ xbps_cmpver_packages(const char *pkg1, const char *pkg2)
return result;
}
int
xbps_cmpver_versions(const char *inst, const char *req)
{
int res = xbps_cmpver_packages(inst, req);
return res;
}

View file

@ -224,7 +224,7 @@ xbps_find_new_pkg(const char *pkgname, prop_dictionary_t instpkg)
"version", &instver);
prop_dictionary_get_cstring_nocopy(pkgrd,
"version", &repover);
if (xbps_cmpver_versions(instver, repover) >= 0)
if (xbps_cmpver(instver, repover) >= 0)
goto out;
break;

View file

@ -132,7 +132,7 @@ xbps_check_is_installed_pkg(const char *pkg)
prop_dictionary_get_cstring_nocopy(dict, "version", &instver);
/* Compare installed and required version. */
rv = xbps_cmpver_versions(instver, reqver);
rv = xbps_cmpver(instver, reqver);
free(pkgname);
prop_object_release(dict);